LoadRunner場景運行錯誤解決方法


前言

本文主要是收集以往性能測試中碰到的錯誤,所做的總結,主要根據不同的報錯類型進行歸類,如1、下的錯誤類型是同類型錯誤。

1、超時問題Error -27783、-27782、-27730、 -27728

錯誤:-27783=Timeout(XXX seconds) exceeded while attempting to etablish connnectgion to houst “http://...”
解決方法:增加連接超時時間(HTTP-request connect timeout)
錯誤:-27782=Timeout(XXX seconds)exceeded while waiting to receive data for URL"http://......"
解決方法:增加接收超時時間( HTTP-request receive timeout)
錯誤:-27730=Timeout ofXXX expired when waiting for the completion of URL "http://......"
解決方法: 增加接收超時時間( HTTP-request receive timeout)
Error -27728: Step download timeout (120 seconds) has expired
解決方法:run time setting中>Internet Protocol:Preferences>Options中三項參數HTTP-request connect timeout,HTTP-request receieve timeout,Step download timeout,分別建議修改為1200、1200、1200。

2、Error -27796

Error -27796: Failed to connect to server "www.baidu.com:80": [10048] Address already in use
Try changing the registry value
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\tcpip\Parameters\TcpTimedWaitDelay to 30
and HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\tcpip\Parameters\MaxUserPort to 65534
and rebooting the machine
See the readme.doc file for more information

Error -27796: Failed to connect to server "192.168.5.132:8083": [10055] No buffer space available
解決方法:run-time Settings > Browser Emulation 去掉勾選Simulate a new user on each iteration

3、Oracle協議腳本報錯

vuser_init.c(23): Error: lrdo_initialize_db: "OCIInitialize" return-code=256818888, error-code is unavailable. The message text is unavailable
vuser_init.c(23): lrd.c/fjInitDB: None of the library combinations specified in section [ORACLE_WINNT] in the "lrd.ini" file could be loaded. Initializing for ORACLE failed
vuser_init.c(23): lrd_initialize_db: ERROR, return-code=LRDE2015
解決方法:本機安裝Oracle服務端

4、cannot connect to server:無法連接到服務器。

原因分析:服務器的配置有問題,服務器無法承受過多的並發連接了。
解決方法:優化服務器的配置,如tomcat的配置。
Error -27791: Server has shut down the connection prematurely HTTP Status-Code=503 (Service Temporarily Unavailable)
原因分析:一般都是由於服務器配置不夠好引起的,
解決方法:tomcat優化,如果仍舊不行,需要優化硬件和調整程序了。
HTTP Status-Code=500 (Internal Server Error) for
解決方法:
1、應用服務宕掉,重新啟動應用服務。
2、當應用系統處於的可用內存處於閥值以下時,出現HTTP Status-Code=500的概率非常高,此時只要增加應用系統的內存,問題即可解決。

5、服務器日志報錯open many files

原因分析:問題一般都在壓力較大的時候出現,由於服務器或者應用中間件本身對於打開的文件數有最大值限制造成
查看當前系統設置的最大句柄數:ulimit -a
open files一行就代表系統目前允許單個進程打開的最大句柄數
使用命令lsof -p 進程id可以查看單個進程所有打開的文件詳情,使用命令lsof -p 進程id | wc -l可以統計進程打開了多少文件,使用命令lsof |wc -l 可以統計總共打開多少文件
如果文件數過多使用lsof -p 進程id命令無法完全查看的話,可以使用lsof -p 進程id > openfiles.log將執行結果內容輸出到日志文件中查看。
解決方法:
1、增大允許打開的文件數——命令方式
1)增大允許打開的文件數——修改系統配置文件
vim /etc/security/limits.conf
在最后加入
root soft nofile 819200

root hard nofile 819200
修改完后xshell重新登錄執行命令ulimit -a 驗證是否生效
注意”nofile”項有兩個可能的限制措施。就是項下的hard和soft。 要使修改過得最大打開文件數生效,必須對這兩種限制進行設定。 如果使用”-“字符設定, 則hard和soft設定會同時被設定。
2)修改系統總限制:修改 /etc/sysctl.conf, 加入fs.file-max = 6553560

執行生效命令sysctl.conf -p

再執行命令ulimit -a驗證是否已生效

3、檢查程序問題
如果你對你的程序有一定了解的話,應該對程序打開文件數(鏈接數)上限有一定的估算,如果感覺數字異常,請使用第一步的lsof -p 進程id > openfiles.log命令,獲得當前占用句柄的全部詳情進行分析,
1)打開的這些文件是不是都是必要的?
2)定位到打開這些文件的代碼
3)是否程序操作了文件寫入,但是沒有進行正常關閉
4)是否程序進行了通訊,但是沒有正常關閉(也就是沒有超時結束的機制)
如果程序中存在這些問題的話,無論系統句柄數設置的多么大,隨着時間的推移,也一定會占用完。

6、壓測時出現超出游標問題

java.sql.SQLException: ORA-01000: maximum open cursors exceeded

查看參數值(默認值300):

su - oracle;
sqlplus / as sysdba;
show parameter open_cursors;
修改參數值:
alter system set open_cursors =3000;
commit;
該值調整后,依然出現超出游標問題,就有可能是代碼或者測試腳本中有連接未關閉。

7、webservice協議接口場景執行報錯

腳本使用 web_service_call方法,並發時報錯
Error -108824:Action.c(6) Error

Failed to retrieve output arguments/checkpoints - SOAP fault occurred

Error -108825:Action.c(6) Error
Expected SOAP result_ received SOAP fault

Error -108960:Action.c(6) Error Web service call "PageQuery_102" execution failed
LR的webservice三種使用方法 https://wenku.baidu.com/view/c10647738e9951e79b89277f.html
解決方法:使用HTTP方式

8、上傳類場景添加多個負載機報錯:Action.c(38): Error -26488: Could not obtain information about submitted

Action.c(38): Error -26488: Could not obtain information about submitted file "C:\Users\csb\AppData\Local\Temp\brr_mYv.387\netdir\D\2019年_6月_全區公安機關自助信息資源采集上傳子系統\腳本\上傳excel200colum3w\200colum3w32820.xls": _stat32 rc=-1, errno=2 [No such file or directory]. Using an empty file
解決方法:
1.先執行一次場景,讓其報錯,主要是為了創建完整的路徑

2.在負載機查找路徑C:\Users\csb\AppData\Local\Temp\brr_mYv.387
3.brr_mYv.387目錄下會產生從controller機器傳送過來的腳本文件,從報錯信息可知完整路徑C:\Users\csb\AppData\Local\Temp\brr_mYv.387\netdir\D\2019年_6月_全區公安機關自助信息資源采集上傳子系統\腳本\上傳excel200colum3w\200colum3w32820.xls
將原始腳本的文件放在該目錄下即可解決

9、測試中需要在本地緩存數據導致內存不足報錯

Action.c(38): Fatal Error -26000: Not enough memory (53036360 bytes) for "submission data buffer". Aborting
Action.c(38): Error: C interpreter run time error: Action.c (38): Error -- memory violation : Exception ACCESS_VIOLATION received.
解決思路:
1)釋放內存
例:使用函數 lr_free_parameter釋放參數內存,lr_free_parameter("schemaName");
2)增加負載機

10、IP欺騙跑場景時報錯60990(驗證不通過,待解決) IP欺騙不能使用時直接采用多台負載機即可

  1. Code -60990 Error: Two Way Communication Error: Function two_way_comm_post_message /two_way_comm_post_message_ex failed.
  2. Code -29739 Error: Service client with id=1 failed to post a message, reason -communication error.
  3. Code -16895 Error: Failed to post xdr buffers data array by post_ex.
  4. Code -10343 Error: Communication error: Cannot send the message since reached theshared memory buffer max size.
    原因:共享內存緩存溢出,造成Controller和Load Generator之間通訊出現問題。IP設置較多,客戶端空間不足。
    解決方案(配置后不一定能解決,空間不足):
      修改兩個配置文件。
      1.安裝目錄下\dat\channel_configure.dat
      2. 安裝目錄下\launch_service\dat\channel_configure.dat
      在這兩個文件中的[general]部分下添加如下配置。
      shared_memory_max_size=100(修改共享內存為100MB,默認是50MB)
      重新啟動Controller,問題解決。
      問題誘因2——驗證不通過,待解決
      打開 controller中的 diagnostics菜單,點掉復選框..點掉 Enable the following diagnostics

11、錯誤 -26601: 解壓縮函數(wgzMemDecompressBuffer)失敗,返回代碼=-5 (Z_BUF_ERROR)、inSize=0、inUse=0、outUse=0


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM