1. 程式人生 > >Error -27791: Server "" has shut down the connection prematurely的一個解決辦法

Error -27791: Server "" has shut down the connection prematurely的一個解決辦法

測試中,併發200,300,400人時,LR沒報錯,在併發500人時,LR報錯”Error -27791: Server "172.16.xx.xxx" has shut down the connection prematurely“,同時檢視WEB伺服器日誌:出現這樣一條資訊:

”INFO: Maximum number of threads (200) created for connector with address null and port 8081“

檢視配置檔案引數:

<Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />

採用的是預設配置,這樣在高併發情況下肯定撐不住,所以修改引數配置如下:

<Connector port="8081" protocol="HTTP/1.1" 
              maxThreads="500" acceptCount="500" connectionTimeout="20000" 
               redirectPort="8443" />

重新測試,事物全部成功,系統也未報錯。

出現”Error -27791: Server "172.16.xx.xxx" has shut down the connection prematurely“的原因即有可能是作業系統網路執行緒連線資源的原因,也可能是應用軟體的原因,當出現問題,隨時檢視系統日誌,能幫助我們更快的定位問題。