我阿里云 1核1G1M的主機(jī) ,
在沒(méi)有開啟 workerman前 內(nèi)存情況如下:
# free -m
total used free shared buffers cached
Mem: 994 438 556 0 21 185
-/+ buffers/cache: 231 763
Swap: 1023 0 1023
free 是 556M
開啟后 如下:
Workerman start in DAEMON mode
----------------------- WORKERMAN -----------------------------
Workerman version:3.2.5 PHP version:5.6.99-hhvm
------------------------ WORKERS -------------------------------
user worker listen processes status
root MsBusinessWorker none 3
root MspGateway Websocket://0.0.0.0:8282 4
root Register text://0.0.0.0:1238 1
----------------------------------------------------------------
Input "php start.php stop" to quit. Start success.
free -m
total used free shared buffers cached
Mem: 994 839 155 0 21 186
-/+ buffers/cache: 631 363
Swap: 1023 0 1023
free 是 155M
也就是說(shuō) gateway 用去我401M內(nèi)存?
再看一下 具體使用情況:
ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
www 1861 0.0 14.3 775732 146448 ? Sl 14:02 0:00 /usr/bin/hhvm --mode server --user www --config /etc/hhvm/server.ini --config /etc/hhvm/php.ini --config /etc/hhvm/config.hdf
root 2705 2.8 6.7 768776 68588 ? S 14:43 0:00 hhvm start.php start -d
root 2700 3.3 6.7 768776 68628 ? S 14:43 0:00 hhvm start.php start -d
root 2699 3.3 6.7 768776 68628 ? S 14:43 0:00 hhvm start.php start -d
root 2698 3.5 6.7 768776 68624 ? S 14:43 0:00 hhvm start.php start -d
root 2704 3.3 6.5 768776 66752 ? S 14:43 0:00 hhvm start.php start -d
root 2703 3.3 6.5 768776 66752 ? S 14:43 0:00 hhvm start.php start -d
root 2702 3.3 6.5 768776 66732 ? S 14:43 0:00 hhvm start.php start -d
root 2701 3.5 6.5 768776 66732 ? S 14:43 0:00 hhvm start.php start -d
root 2683 1.8 6.4 768776 66188 ? S 14:43 0:00 hhvm start.php start -d
為什么一下開了這么多進(jìn)程?。?我手動(dòng)把bussinesworker 進(jìn)程 和gatwway 進(jìn)程類都調(diào)低成了 2,3 還是差不多 沒(méi)有什么改善 。
我想請(qǐng)問(wèn) gateway worker 為什么需要這么多的內(nèi)存?