Script continues to die out for a while, not a timeout / memory issue

I have a long script that dies for no reason. It should work for more than 8 hours, but it dies in an hour or two, no mistakes, nothing. I tried to run it through the CLI and through http, no difference.

I have the following options:

set_time_limit(0);
ini_set('memory_limit', '1024M');

I track memory usage and it does not go through 200M

Is there anything else that I am missing. Why should he die?

+3
source share
4 answers

One possible explanation may be that the PHP garbage collector interferes with the script. That is why you see random deaths. When the garbage collector is enabled, the loop search algorithm is executed whenever the root buffer is fully operational.

PHP :

, .

PHP gc_disable. gc_collect_cycles , .

. 8- script script, , , - script. , , , error_reporting(-1);.

, script , , , , , . , , script . , / script, . , .

script , , , . , , . , MySQL , -, .

:

[START 2011/01/21 13:12:23] MySQL Connection: TRUE [END 2011/01/21 13:12:28] Query took 5s
[START 2011/01/21 13:12:28] MySQL Connection: TRUE [END 2011/01/21 13:12:37] Query took 9s
[START 2011/01/21 13:12:39] MySQL Connection: TRUE [END 2011/01/21 13:12:51] Query took 12s
+6

- .

, .

. , filedescriptors, . , . .

, selinux . , script . , (. Ulimit).

, , , segfault. stdout, stderr?

0

, . script :

$ ulimt -c unlimited
$ PHP .php

, (core.xxxx) ,

0

Apache also has its own script timeout, you will need to configure the httpd.conf file

-1
source

Source: https://habr.com/ru/post/1784743/


All Articles