Solution to an incorrect deadlock in linux + php5.3

Source: Internet
Author: User
Tags apc
PHP-fpm/cgi and APC or xcache encounter deadlocks. A machine keeps running PHP5.3.x (fpm or fastcgi mode), and deadlock often occurs from time to time. The performance is that the FCGI service cannot be connected. NGINX reports 502 badgateway. in this case, php in the system...

PHP-fpm/cgi and APC or xcache encounter deadlocks.
A machine keeps running PHP 5.3.x (fpm or fastcgi mode), and deadlock often occurs from time to time.

The performance is that the FCGI service cannot be connected. NGINX reports 502 bad gateway. at this time, the php processes in the system are still running, but they are all stuck in the futex () system call, it is obvious that a deadlock has occurred.

I checked some information and found that this BUG was submitted two years ago. so far, it seems that there is no proper solution because if the script times out when the resource is locked, in this case, PHP closes the request through longjmp jump, causing the lock to be released incorrectly.

Currently, you can add exit_on_timeout = On to php. ini in PHP5.3 to solve this problem. This means that the process will be killed when timeout occurs, so that the system can reclaim such lock resources and avoid deadlocks.


Author: "linux"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.