2009/08/12

Limiting open port RST response from XXX to 200 packets/sec

還是那台爆量的伺服器,系統出現以下訊息:

Limiting open port RST response from 253 to 200 packets/sec
Limiting open port RST response from 392 to 200 packets/sec
Limiting open port RST response from 924 to 200 packets/sec
Limiting open port RST response from 689 to 200 packets/sec
Limiting open port RST response from 284 to 200 packets/sec
Limiting open port RST response from 398 to 200 packets/sec
Limiting open port RST response from 219 to 200 packets/sec
Limiting open port RST response from 224 to 200 packets/sec
Limiting open port RST response from 223 to 200 packets/sec
Limiting open port RST response from 425 to 200 packets/sec
Limiting open port RST response from 436 to 200 packets/sec
Limiting open port RST response from 600 to 200 packets/sec
Limiting open port RST response from 265 to 200 packets/sec
Limiting open port RST response from 693 to 200 packets/sec
Limiting open port RST response from 263 to 200 packets/sec
Limiting open port RST response from 505 to 200 packets/sec
Limiting open port RST response from 355 to 200 packets/sec
Limiting open port RST response from 225 to 200 packets/sec
Limiting open port RST response from 228 to 200 packets/sec
Limiting open port RST response from 370 to 200 packets/sec
Limiting open port RST response from 344 to 200 packets/sec
Limiting open port RST response from 288 to 200 packets/sec
Limiting open port RST response from 287 to 200 packets/sec
Limiting open port RST response from 359 to 200 packets/sec
Limiting open port RST response from 355 to 200 packets/sec
Limiting open port RST response from 702 to 200 packets/sec
Limiting open port RST response from 299 to 200 packets/sec
Limiting open port RST response from 345 to 200 packets/sec
Limiting open port RST response from 329 to 200 packets/sec
Limiting open port RST response from 332 to 200 packets/sec
Limiting open port RST response from 211 to 200 packets/sec
Limiting open port RST response from 462 to 200 packets/sec
Limiting open port RST response from 295 to 200 packets/sec
Limiting open port RST response from 800 to 200 packets/sec
Limiting open port RST response from 623 to 200 packets/sec
Limiting open port RST response from 416 to 200 packets/sec
Limiting open port RST response from 256 to 200 packets/sec
Limiting open port RST response from 578 to 200 packets/sec
Limiting open port RST response from 443 to 200 packets/sec
Limiting open port RST response from 264 to 200 packets/sec
Limiting open port RST response from 656 to 200 packets/sec
Limiting open port RST response from 649 to 200 packets/sec
Limiting open port RST response from 426 to 200 packets/sec
Limiting open port RST response from 444 to 200 packets/sec
Limiting open port RST response from 334 to 200 packets/sec
Limiting open port RST response from 240 to 200 packets/sec
Limiting open port RST response from 289 to 200 packets/sec
Limiting open port RST response from 236 to 200 packets/sec
Limiting open port RST response from 600 to 200 packets/sec
Limiting open port RST response from 319 to 200 packets/sec
Limiting open port RST response from 286 to 200 packets/sec
Limiting open port RST response from 363 to 200 packets/sec
Limiting open port RST response from 1279 to 200 packets/sec
Limiting open port RST response from 416 to 200 packets/sec
Limiting open port RST response from 688 to 200 packets/sec
Limiting open port RST response from 771 to 200 packets/sec
Limiting open port RST response from 971 to 200 packets/sec
Limiting open port RST response from 603 to 200 packets/sec
Limiting open port RST response from 228 to 200 packets/sec
Limiting open port RST response from 254 to 200 packets/sec
Limiting open port RST response from 326 to 200 packets/sec
Limiting open port RST response from 441 to 200 packets/sec
Limiting open port RST response from 315 to 200 packets/sec
Limiting open port RST response from 357 to 200 packets/sec
Limiting open port RST response from 591 to 200 packets/sec
Limiting open port RST response from 300 to 200 packets/sec
Limiting open port RST response from 325 to 200 packets/sec
Limiting open port RST response from 332 to 200 packets/sec
Limiting open port RST response from 281 to 200 packets/sec
Limiting open port RST response from 302 to 200 packets/sec
Limiting open port RST response from 560 to 200 packets/sec
Limiting open port RST response from 368 to 200 packets/sec
Limiting open port RST response from 459 to 200 packets/sec
Limiting open port RST response from 388 to 200 packets/sec
Limiting open port RST response from 349 to 200 packets/sec

從網上找到一篇好文章,解釋的十分清楚:
Limiting open port RST response from 952 to 200 packets per second

Apache 之謎樣 ServerLimit 指令 (directive)

最近某個客戶網站的流量暴增,需要將 Apache 的 MaxClients 調高以應付暴增的連線數。
調高之後先用 apachectl configtest 測試一下,結果出現以下的訊息:

WARNING: MaxClients of 300 exceeds ServerLimit value of 256 servers,
lowering MaxClients to 256. To increase, please see the ServerLimit
directive.

組態檔裡沒看到 ServerLimit 的說明,但在官方網站上找到了 ServerLimit Directive 的說明,於是在 httpd-mpm.conf 裡先把 ServerLimit 設定成 500 試試看:


StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 300
MaxRequestsPerChild 0
ServerLimit 500 # 新設定


但執行 apachectl configtest 卻還是出現同樣的錯誤訊息?

而後總算在網友的文章Apache 2.0 中 prefork.c 模組與 worker.c 模組的比較中找到端倪:
ServerLimit 要放在 MaxClients 前面!!!
改成下面這樣就可以了:


ServerLimit 500 # ServerLimit 放在 MaxClients 前面!!!
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 300
MaxRequestsPerChild 0



另外,調整之後如果以 apachectl graceful 重開 Apache,ServerLimit 的設定並不會生效,log 檔裡會出現以下的錯誤訊息:

[Wed Aug 11 22:31:41 2009] [warn] WARNING: Attempt to change ServerLimit ignored during restart

如果以 apachectl restart 重開也沒用,一樣會出現前面提過的錯誤訊息:

WARNING: MaxClients of 300 exceeds ServerLimit value of 256 servers,
lowering MaxClients to 256. To increase, please see the ServerLimit
directive.


在前面提過的官網說明中有一段隱晦的說明:

Any attempts to change this directive during a restart will be ignored, but MaxClients can be modified during a restart.

因此要使 ServerLimit 生效,必須先停止 Apache: apachectl stop,再開啟 Apache: apachectl start

2009/08/07

MegaCLI

最近剛接手一台 Dell PowerEdge 1950,這幾天發現系統出現以下訊息:

mfi0: 3637 (302889152s/0x0002/WARN) - Predictive failure: PD 00(e0x20/s0)

上網查了一下,應該是 RAID 中的某一顆硬碟出狀況。

順便也找到在 FreeBSD 下查看 Dell PowerEdge RAID Controller (PERC) 6/i 的套件: MegaCLI
ports 路徑: /usr/ports/sysutils/megacli
到目錄下直接輸入 make install clean 便可完成安裝。

2009/08/03

插座燒掉了...

每次趕程式的時候,硬體都會出狀況...

最近進了兩台新伺服器,一直擔心備援的 UPS 會撐不了多久,沒想到是插座先撐不住了


插頭也爛掉了


後續的處理是直接從電箱拉條絞線給負載用,中間用 no fuse break 連接,不再使用插頭、插座。