
我在使用新伺服器 Ubuntu 16 時遇到問題,它不斷打開 apache2 進程數小時,將伺服器和處理器的所有 RAM 填滿至 100% 使用率。我不確定是否是因為某些惡意軟體或配置錯誤。
這是最上面的流程 頂級工藝
這裡是設置Apache2.conf
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_event_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
我有 8GB RAM 和 4 個處理器,所以我認為這些設定可以嗎?
答案1
在我們這裡收集一堆配置選項和一些有關您系統的隨機數據根本沒有用。
你需要運用科學的方法。
- 安裝監控
- 收集資料
- 使用數據幫助理解系統
- 根據您在上面學到的知識進行更改
- 監控變化
- 重複分析並根據需要進行更改
- 文件變更
這不是火箭工程,甚至不是替代事實。您所需要的只是簡單的應用系統管理原則。
答案2
弄清楚這一點,這是因為某些擴充功能繼續運行,幾分鐘後 CPU 就達到了 100%。
最好top
使用 SSH 命令來檢查這一點