PHP log error exited with code 0 after seconds from start

Source: Internet
Author: User
Because 502 has occurred before, the log prompt

[27-may-2015 13:54:34] WARNING: [Pool www] seems busy (you could need to increase pm.start_servers, or pm.min/max_spare_servers), spawning Ren, there is all idle, and 602 total children

Then I arbitrarily added the pm.start_servers parameter, after some time, the PHP log/usr/local/php/var/log/php-fpm.log part of the information as follows:


[27-may-2015 15:13:48] NOTICE: [Pool www] child 3998 started

[27-may-2015 15:13:59] NOTICE: [Pool www] child 9242 exited with code 0 after 47575.960999 seconds from start

[27-may-2015 15:13:59] NOTICE: [Pool www] child 4210 started

[27-may-2015 15:14:42] NOTICE: [Pool www] child 9217 exited with code 0 after 47619.884065 seconds from start

[27-may-2015 15:14:42] NOTICE: [Pool www] child 5621 started

[27-may-2015 15:14:43] NOTICE: [Pool www] child 9561 exited with code 0 after 47620.024499 seconds from start


The reason is that there is no pm.start_servers this parameter does not follow the following formula:

pm.start_servers= min_spare_servers + (max_spare_servers-min_spare_servers)/2

General Min_spare_servers set to 20

Max_spare_servers is calculated based on the memory of the server itself, the standard algorithm is the memory size divided by 30M

Of course, some PHP programs may occupy relatively small, less than 30M, which depends on the situation to calculate.

That's what I'm setting up.

Filter the comment section:

cat/usr/local/php/etc/php-fpm.conf | Grep-v "^;" | Grep-v "^$"


[Global]

PID = Run/php-fpm.pid

Error_log = Log/php-fpm.log

Emergency_restart_threshold = 10

Emergency_restart_interval = 1m

Process_control_timeout = 10s

Rlimit_files = 65535

Events.mechanism = Epoll

[WWW]

user = www

Group = www

Listen = 127.0.0.1:9000

PM = dynamic

Pm.max_children = 1400

Pm.start_servers = 710

Pm.min_spare_servers = 20

Pm.max_spare_servers = 1400

Pm.max_requests = 10000

Slowlog = log/$pool. Log.slow


And then reload the next
/usr/local/nginx/sbin/nginx-s Reload

After a few days the log did not appear information.

  • 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.