2017-06-30

apache 最大連接數

以 ubuntu 為例
sudo vim /etc/apache/apache.conf
<ifmodule mpm_prefork_module="">
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</ifmodule>

如 伺服器記憶體有16G,保守基本服務需要6g,還剩10G可用,假如每個進程用5m(很大用量) 那麼理論上可以支援10000/5 = 2000
更新為
<ifmodule mpm_prefork_module="">
StartServers 5
MinSpareServers 5
MaxSpareServers 10
ServerLimit 2500
MaxClients 2000
MaxRequestsPerChild 0
</ifmodule>

查看當前的連接數可以用:
ps aux | grep apache2 | wc -l
或:
pgrep apache2|wc -l

即時檢測HTTPD連接數:
watch -n 1 -d "ps aux | grep apache2 | wc -l"
或:
watch -n 1 -d "pgrep apache2|wc -l"

2017-06-16

vm,esx,esxi要連外部的 iscsi 或 nfs ,網卡須新增 VMkernel ,

vm,esx,esxi要連外部的 iscsi 或 nfs ,網卡須新增 VMkernel ,並且要vmkping 的 ping 外部的ip