解决 无法连接数据库:Lost connection to MySQL server at 'reading initial communication packet', system error: 111
报错现象:
无法连接数据库:Lost connection to MySQL server at 'reading initial communication packet', system error: 111
数据库错误日志:
InnoDB: mmap(274726912 bytes) failed; errno 12
解决方案,调整以下参数:
pm = ondemand
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes to be created when pm is set to 'dynamic'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI.
; Note: Used when pm is set to either 'static' or 'dynamic'
; Note: This value is mandatory.
pm.max_children = 100
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
;pm.max_requests = 500
pm.max_requests =5000