0

Practical Challenge: I have a LR script that runs against an app being mocked and do not have a logout button (yet). The test runs fine With stable response time for about 10 minutes, but after that the response time peaks and the server goes into 99% memory usage and transactions start to fail. I suspect this is due to the script does not terminate the vusers after each run anf it builds up a lot of running sessions against the server wich is not terminated. But I might be wrong. Anyays I want to programatically close each run after it has competed the business process. I have red somewhere that web_set_sockets_option ("SHUTDOWN_MODE", "ABRUPT") could be used for this, but I want to be sure that this function actually does what I want and what does 'ABRUPT' means? Are there better ways of closing sessions? Clicking the close browser during recording does not result in anything being captured in the script.

Magnus Jensen
  • 905
  • 6
  • 36
  • 73
  • Ok, I get it. The Application has no logout (taking care of the session/closing it) and that is a bug. I will ask my team to implement code for logging out and cleaning up. – Magnus Jensen Feb 18 '13 at 20:02

3 Answers3

1

It's a server issue on session aging. Your server admin for your website can adjust the timeout values where no activity has taken place on a given session. By default most places have this set at 30 minutes. Trim it to what you need rather than taking the default value on the server.

Also, you may have hit a leak situation if resources are constantly accumulated on the server side but never released.

James Pulley
  • 5,606
  • 1
  • 14
  • 14
  • Ok, so 'no activity has taken place on a given session' should be set to a little bit more than the entire business process takes? Then the session would be released after 'a little bit more than the entire business process', right? – Magnus Jensen Feb 18 '13 at 21:08
  • Most people will not log out, even with a logout option available. They will simply close their browser or go to another site. This will leave a set of session variables and attached resources on the server. The server has a setting which allows this information to be cleared after an idle period. I like to analyze the existing users and find a value which is at the ~98th percentile for timeout on idle period. Look to your existing users (website logs) to set your timeout value appropriately to minimize impacts to users. – James Pulley Feb 19 '13 at 01:14
0

Based on your question I assume you're using the WEB/HTML protocol. I agree that the core issue is that your app's sessions should expire more elegantly and probably sooner. But, in order to get beyond this while testing you can try this. It isn't a guarantee, but it has worked sometimes for me in the past when dealing with similar situations. Try changing your Run-time Settings for the script:
Run-time Settings > Browser > Browser Emulation

Make sure you have the box checked for "Simulate a new user on each iteration". You can also try playing with the other settings here, like clearing the cache each iteration. This could cause a new connection setting with the web page for each iteration depending on the server's session settings. Again, this isn't 100%, but it has worked for me from time to time.

Nathan
  • 341
  • 1
  • 4
  • Does web_cleanup_cookies() and web_cach_cleanup() at the beginning of the script perform the same as enabling "Simulate a New user on each iteration"? AND is the path to set this option in VUgen and save the script before uploading to the Controller for scenario constuction OR is this setting possible to set for the entire scenario (in the settings for the scenario as a whole) and if yes where is this to be set? – Magnus Jensen Apr 11 '13 at 18:06
  • Also having no pacing set in my sceenario/VUser script. Could that cause this to happen? I only run with two (!) VUsers so there must be something wrong with my script/settings or with the application under test. We have established that the script runs so fast that memory is not released before a new iteration starts (we assume this could be the case). Any ideas/experience that having no pacing might result in thhe described pehenomen happening even with a small number of users over time? – Magnus Jensen Apr 11 '13 at 18:32
0

try this:

web_set_sockets_option("CLOSE_KEEPALIVE_CONNECTIONS", "1");
FelixSFD
  • 6,052
  • 10
  • 43
  • 117
  • Welcome to Stack Overflow! While this code snippet may solve the question, [including an explanation](//meta.stackexchange.com/questions/114762/explaining-entirely-code-based-answers) really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion. Please also try not to crowd your code with explanatory comments, this reduces the readability of both the code and the explanations! – kayess Dec 13 '16 at 14:18