How to Change the TimeOut on LoadRunner

I’m seeing a lot of searches for Timeout issues landing on the blog these days.

This is a very common issue when executing a scenario, meaning basically that the server has not responded in a specified amount of time. LoadRunner defaults to 120 seconds on all Web based protocols (HTTP, WebServices, Click & Script), but this can be easily changed using a command on the begging of the script, web_set_timeout.

The command have only two parameters, the operation and the new value. The operation can be one of these three:

  • CONNECT: To establish the connection to the Web server.
  • RECEIVE: Time–out on the next “portion” of server response to arrive.
  • STEP: Time–out on each VuGen step.

Usually the one we see expiring the most is STEP, for obvious reasons. The error message should look something like “Step Download Timeout”.

The second parameter is the new value, expressed in seconds. So if we want to set up a new value for STEP we have to insert this code in the beginning of our action:

web_set_timeout("STEP","240");

Being 240 seconds our new value.

Usually I change the timeout value of all three operations, just to be sure:

web_set_timeout("STEP","240");
web_set_timeout("CONNECT","240");
web_set_timeout("RECEIVE","240");

Simple, isn’t it??

We just have to be careful when changing this configuration, because the default value is already too high for most user actions.

From my point of view, this should only be used in two cases:

  • When we really expect a transaction to be slow, like a large report or file upload, something that the users already expect to be slow;
  • Also when we need to troubleshoot a slow transaction, meaning, waiting for a longer period to get the response.

That’s it!!

Tweet about this on TwitterShare on LinkedInShare on FacebookShare on Google+

2 thoughts on “How to Change the TimeOut on LoadRunner

  1. Hi Martin,
    working on Vugen script for web application with Async Ajax calls. For these AJAX calls Vuser should not wait to get the response but proceed to next transaction. tried to use web_reg_cross_step_download() which works fine for me but I cannot validate the response of the call. can web_set_timeout() function can be used for Async AJAX?
    Thanks

    • Hi Sandy,
      I only had to use web_reg_cross_step_download a few times and it wasn’t for to simulate a concurrent AJAX call. I don’t believe that you can, with the current implementation, check the response from a web_reg_cross_step_download request, at least not in the usual way.
      web_set_timeout should not make any difference with this, because it will only change the timeout for the web requests. LoadRunner will still not execute JavaScript during runtime.
      My usual approach is to make the calls one after the other, serial, even for async. My assumption is that even not doing things in parallel at a script level, once I have more VUsers running the same script, calls will be made in parallel and final load should be adequate. One other option to keep it cleaner is have the AJAX calls in a separate script.

      Cheers,
      Martin

Leave a Reply