51Testing软件测试论坛

标题: controller运行过程中27796报错的解决方法 [打印本页]

作者: 城邦    时间: 2013-4-28 09:57
标题: controller运行过程中27796报错的解决方法
本帖最后由 城邦 于 2013-5-9 09:41 编辑

在controller运行过程中,有时会出现27796这个错误,详细的提示错误如下
Action.c(7): Error -27796: Failed to connect to server "192.168.1.57:8088": [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

这个错误,loadrunner会提供解决方法,方法如下:


•Try to address the reason provided for the connection failure.

•Try to access the application with a browser from the injector machine and from another machine (such as the recording machine).

•Check that you accurately specified the correct host name and port.

•ing the host/port.

•Check if the server application you are trying to access is running.

•If you used a hostname, check if it was resolved to the correct address.

•Check if the server application is listening to the right port.

按照上面的方法有可能解决问题。
我们这里出现的就是上面的方法都解决不了该错误,
认真分析这个错误,其实比较容易理解,就是连接不上服务,由于端口已经满了,那么自己的本机已经修改成65534,服务器已经修成成65534,那么这就是唯一的解决方式么?后来仔细思考,我找到了两种解决方式:
1、通过让每次迭代不启用新的连接,我想就可以解决此问题,经过验证,发现这个问题确实不发生了。操作如下,在controller的运行时设置中的-->browser Emulation-->不扣选simulate a new user on each iteration,这样运行时并发人数是多少,那么就启动多少个端口。还是上面的问题,是否勾选这个选项就一定会报27796错误么?
2、回答上面的提问,答案是不一定。如果你每次迭代启用新的端口,但是由于迭代次数*并发数<65534就不会报这个错误。如果设置的迭代次数*并发数>65534,也不一定会出现这个错误,例如:并发人数为1000,平均响应时间为1s,那么也就是说1s会占用1000个端口,也就是说不到66s时端口就会占满,如果服务器能在65s内关闭之前占用的端口之间的连接,也就是说65s超时时间,或者会话保持为65s以内,那么就能解决此问题。

以上提出两种解决方式,都可以解决27796error,一个是修改loadrunner中的controller设置,另一个就是设置服务器的超时时间在合理范围之内,不要太长,也不要太短。
作者: lsekfe    时间: 2013-5-2 09:48
感谢LZ的分享




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2