關(guān)于webman項目運行后會有多個休眠中的數(shù)據(jù)庫連接進程,這個如何解決呢?
在服務(wù)器上面查看了mysql的進程,發(fā)現(xiàn)有多個睡眠中的進程,會導(dǎo)致無謂的消耗cpu,這個有大佬知道怎么處理嗎
這里寫問題描述
每個進程一個數(shù)據(jù)庫連接,每55秒會發(fā)送一個select 1的操作確保連接不斷開
return [
'listen' => 'http://'.env('SERVER_HOST', '0.0.0.0').':'.env('SERVER_PORT', '8787'),
'transport' => 'tcp',
'context' => [],
'name' => 'webman',
'count' => cpu_count() 4,
'user' => '',
'group' => '',
'reusePort' => false,
'event_loop' => '',
'stop_timeout' => 2,
'pid_file' => runtime_path() . '/webman.pid',
'status_file' => runtime_path() . '/webman.status',
'stdout_file' => runtime_path() . '/logs/stdout.log',
'log_file' => runtime_path() . '/logs/workerman.log',
'max_package_size' => 10 1024 * 1024
];
我是8核心cpu * 4 = 32個進程,數(shù)據(jù)庫連接進程是48個,多出來的16個進程是主進程的連接嗎?