php-fpm hangs

php-fpm hangs

by Pin Jin -
Number of replies: 1

i am running Moodle 3.1.7 on a private network redhat 7.1 server ( 16Gb ram, 8core cpu). Recently we upgraded to php7.0 running php-fpm with apache2.4.

Since the upgrade when I try to restore a course backup with greater than 300mb it will hang at step 6.process. I monitor the process with top command and at about 18.1% of the progress, the php-fpm process handling the restore will disappear and the process will not finish.

When I switch back to the original php5.4 running on mod_php it will finish restoring the file. I have tried many things including increase max_execution_time to 7200s (2hours), memory limit to 1gb but nothing resolves the issue.

below is my php-fpm customized settings 

php_admin_value[memory_limit] = 1024M

request_terminate_timeout = 3600

pm.max_children = 500

pm.start_servers = 30

pm.min_spare_servers = 30

pm.max_spare_servers = 250

pm.max_requests = 2000


Please help if you know how to fix it

Average of ratings: -
In reply to Pin Jin

Re: php-fpm hangs

by Pin Jin -

I found out it is not php-fpm process issue.. with sqlsrv_connect('TraceOn'=>1)


          Statement = 0x558884b11f70

                        SQL = [UPDATE #mdl_backup_files_temp SET newcontextid = '96',newitemid = '0' WHERE id = '748'][length = 86 (SQL_NTS)]

this line is when sqlsrv.so (v4.3.0) stopped the whole process.


Reading from google, they believed it was a deadlock ...

Does anyone know the solution?

when we had php5.4 we were running it with freetds which was all good, but php7.0 does not support freetds.