Tuesday 30 July 2013

Server has shut down the connection prematurely | Server has shut down the connection prematurely error in load runner

The issue "Server ABC has shut down the connection prematurely" typically arises within LoadRunner and can be a significant challenge to address. Here are steps to troubleshoot and resolve this issue:

1. Sequential Ramp-Up: Ensure that the load is not ramping up all users simultaneously. Gradual ramp-up of virtual users can help prevent sudden spikes in server load.

2. Rendezvous Points: Check if rendezvous points in the script are not holding up too many users simultaneously. Rendezvous points should be strategically placed to synchronize virtual user activities without overwhelming the server.

3. Retry Option: Verify that the retry option in LoadRunner is set to a value greater than 5. This can help handle connection retries effectively, reducing the likelihood of premature shutdown errors.

4. Network Connectivity: Investigate network connectivity issues or blockages between the LoadRunner Controller/Load Generator and the server under test. Network instability can lead to connection problems.

5. Reduce Load: Consider reducing the load generated from the LoadRunner machine to lessen the strain on the server. This can involve decreasing the number of concurrent users or adjusting the workload distribution.

6. Clear Temp Folder: Clear the temporary files in the local settings folder on the machine where LoadRunner is installed. Restart the machine afterward. This step has proven effective for resolving the issue, particularly if scripts previously ran successfully without errors.

7. Restart Machines and Servers: If the issue persists, restart all machines and servers within your network or load test domain. While the reason behind this solution may not be clear, it often resolves the problem.

Additionally, consider implementing the following script modifications as workarounds:

- Add the line `web_set_sockets_option("NEW_BEHAVIOR_OF_OVERLAPPED_SEND", "1");` to the script. Although not a solution, it can sometimes mitigate the issue.
  
- If none of the above options are effective, include `web_set_sockets_option("IGNORE_PREMATURE_SHUTDOWN", "1");` in the `vuser_init()` function. This setting instructs LoadRunner to ignore premature shutdown errors during script execution.

Furthermore, you may explore the following LoadRunner settings:

- Navigate to Run-time Settings → Preferences and select "Use WinInet Replay instead of Sockets" (for Windows environments only). Note that while this option has worked in specific cases, it may not provide a universal solution.

It's essential to note that the recommendation regarding the retry option ("Make sure retry option is greater than 5") specifically applies to Oracle 10g applications and may not be relevant in all scenarios.

3 comments:

Unknown said...

Great! but how could you are sure that this issue is not a web server issue.

Unknown said...

Great! But how could you are sure that this is not a webserver issue?

Anonymous said...

But when we choose winelt mode replay, it is not generating snapshots for the replay in multi protocol (http , web services)