Browse Source

Fix process count error. (#4335)

* Fix process count error.

`$http_worker->count = (get_processor_cores_number() * 2) || 64; ` `$http_worker->count` will be `true` and only one process be created.

* default process count 64
walkor 6 years ago
parent
commit
0047816595
1 changed files with 1 additions and 1 deletions
  1. 1 1
      frameworks/PHP/workerman/server.php

+ 1 - 1
frameworks/PHP/workerman/server.php

@@ -12,7 +12,7 @@ function get_processor_cores_number() {
 }
 
 $http_worker = new Worker('http://0.0.0.0:8080');
-$http_worker->count = (get_processor_cores_number() * 2) || 64;
+$http_worker->count = ($count = get_processor_cores_number()) ? $count : 64;
 $http_worker->onWorkerStart = function()
 {
   global $pdo;