Loadrunner 錯誤碼解析

1.關於Error -27791: Error -27790:Error -27740:

       錯誤如下:
       Action.c(198): Error -27791: Server "www.zcpx.cn" has shut down the connection prematurely
       Action.c(198): Error -27790: Failed to read data from server "www.zcpx.cn": [10053] Software caused connection abort
       Action.c(198): Error -27740: Overlapped transmission of request to "www.zcpx.cn" for URL

       "http://www.zcpx.cn/userEntry.do" failed: WSA_IO_PENDING

      解決辦法:
      在腳本的最前面加上web_set_sockets_option("OVERLAPPED","0");

2.Error -27796: Failed to connect to server

      解決辦法:
      在註冊表HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters裏,有如下兩個鍵值:
      TcpTimedWaitDelay
      MaxUserPort
      1,這裏的TcpTimedWaitDelay默認值應該中是30s,所以這裏,把這個值調小爲5s(按需要調整)。
      2,也可以把MaxUserPort調大(如果這個值不是最大值的話)。

3. Error -27727: Step download timeout (120 seconds)

      查閱相關信息

      應用服務參數設置太大導致服務器的瓶頸
      頁面中圖片太多
      在程序處理表的時候檢查字段太大多
      解決方法:

      Run-Time Setting ->Internet Protocol ->Preferences ->Option -> Step download timeout(sec)改爲32000.另外還有HTTP-request connect timeout和HTTP-request   receive timeout出現以上問題時最大可設爲1000.

 

4. Error -27791 connection prematurely

      運行Controller時遇到這個error:
      Action.c(7): Error -27791: Server "10.10.0.88" has shut down the connection prematurely
      解決方案如下:
      1、應用服務器死掉。小用戶時程序上的問題,程序上處理數據庫的問題
      2、應用服務沒有死。應用服務參數設置問題。例如:在許多客戶端weblogic應用服務器被拒絕,而在服務器端沒有錯誤顯示,則有可能是 weblogic中的server元素的acceptbacklog屬性   值設得過低。如果連接時收到connection refused消息,說明應提高該值,每次增加25%。
      3、數據庫的連接。在應用服務的性能參數可能太小了,數據庫啓動的最大連接數(跟硬件的內存有關)
      4、有時關閉殺毒軟件也會解決如上問題

5. Others

      1. Failed to connect to server "域名:80": [10065] No Route to Host

  解決:

  這種錯誤信息有兩種情況,一是交換機堵塞,一是服務器網絡堵塞或者CPU無法響應(網卡中斷處理不過來了)。

  從服務器端檢查下iptables 是否開啓,看看 /proc/sys/net/ipv4/ip_conntrack_max 是多少。

  2. TTP Status-Code=500 (Internal Server Error)

  解決:

  A. 這個問題,開發人員從程序和環境進行調優了。

  B. 通過抓包發現有大量的sql語句重複執行,建議優化sql。

  C. 優化JVM。機器配置:4G的內存,32個線程併發能力

  -Xmx3800m -Xms3800m -Xmn2g -Xss128k -XX:+UseParallelGC -XX:ParallelGCThreads=20

  3. HTTP Status-Code=504 (Gateway Time-out)

  解決:

  502 bad Gateway 服務器作爲網關或者代理時,爲了完成請求訪問下一個服務器,但該服務器返回了非法的應答。

  504Gateway Timeout 由作爲代理或網關的服務器使用,表示不能及時地從遠程服務器獲得應答。

  解決:可以啓動多個tomcat服務,一個tomcat服務可能支撐不了那麼大的併發。(一般情況下像IBM高配的服務一個tomcat能支持2000併發吧。)(只能讓部署環境的同事幫忙調整,我們沒這權利啊。)

  4. Step download timeout (120 seconds) has expired when downloading non-resource(s)

  解決:

  可以修改配置參數(tomcat的),也可以程序上進行調整超時時間。

  如 <Connector port="8080"

  maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

  enableLookups="false" redirectPort="8443" acceptCount="100"

  debug="0" connectionTimeout="20000"

  disableUploadTimeout="true" />

  當然了也可以調整LR的配置但最好不這樣。

11、運行場景時提示“Step download timeout (120 seconds) has expired when downloading resource(s)”

vuser_init.c(12): Error -27728: Step download timeout (120 seconds) has expired when downloading non-resource(s)(出現個別,可以忽略)

vuser_init.c(12): Error -27727: Step download timeout (120 seconds) has expired when downloading resource(s). Set the "Step Timeout caused by resources is a warning" Run-Time Setting to Yes/No to have this message as a warning/error, respectively

如果覺得下載一個頁面超過2分鐘不是錯誤的話,可以在Run-Time設置中選擇Preferences->Options,修改Step download timeout(sec)的時間

或者把“Step timeout caused by resources is a warning”設置爲Yes,這樣下載資源超時也只是作爲警告,不作爲錯誤提示,但是對於非資源的下載超時,則總是會提示錯誤的

 用LoadRunner測試時,總會報下載超時的錯誤
vuser_init.c(26): Error -27727: Step download timeout (120 seconds) has expired when downloading resource(s). Set the "Step Timeout caused by resources is a warning" Run-Time Setting to Yes/No to have this message as a warning/error, respectively


上面報的是超時的意思,不一定是代碼的問題,可能是負載比較大,服務器的響應超過了120秒,就彙報這個錯誤,解決方法如下:

1、 修改run time setting中的請求超時時間,默認120,你改大一些,其中有三項的參數可以一次都修改了,HTTP-request connect timeout,HTTP-request receieve timeout,Step download timeout,分別建議修改爲600、600、5000;run time setting設置完了後記住還需要在control組件的option的run time setting中設置相應的參數;

2、 設置run time setting中的internet protocol-preferences中的advaced區域有一個winlnet replay instead of sockets選項,勾選。

  5. Abnormal termination, caused by mdrv process termination

  解決:

  大膽嘗試了修改了LR中的D:\Program Files\Mercury\LoadRunner\dat\protocols 中的http.lrp信息,在[Vugen]下面新加一條MaxThreadPerProcess=要設置的vuser數量 。

 Message Code 27979
Requested form not found

The form was not found in the page received from the server. Possible reasons: (i) The current or a previous HTML page was changed after the script was recorded. (ii) A previous request navigated to a wrong page or failed. (iii) One or more web_submit_form arguments are missing or incorrect (especially for manually coded, parameterized, or correlated functions). (iv) The server returned an unexpected page (e.g., under excessive load).

Troubleshooting
If the current or previous HTML page was changed, look for the correct properties of the form used in the text (e.g., action), and change it in the script.
If your snapshots and extended log are disabled, enable them and run the script again.
(i) To enable Snapshots: Select Tools > General Options > Correlation, and check the Save correlation information during replay box.
(ii) To enable Extended Log: Select Run-time Settings > General: Log, and check Enable logging, Always send messages, Extended log, Data returned by server, Advanced trace.
Compare the record and replay snapshots for each step in the script from the beginning, and locate the first difference. If you identify a difference in the snapshots, locate the corresponding HTTP request in both the recording log and the extended log. Compare the requests and, if they are different, have the replay issue exactly the same request. This can be done, for example, by adding web_add_header (for adding missing headers or adjusting existing ones), web_remove_auto_header (for removing extra headers), and web_add_cookie (for missing cookies).
If some correlation is missing, (e.g., the recording and replay runs have different session IDs), use the correlation tool to locate and handle such cases.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章