0
votes

I am running a test script on jmeter. The design of the system I'm testing is multi-profile. Meaning, as I login using an HTTP server, I am redirected to either Server1 or Server2 (randomly). On the test script I recorded, I was redirected to Server2. So whenever I run this pre-recorded test script again (with 100 users/threads), only those requests redirected to Server2 are processed successfully and those requests redirected to Server1 are returning a 'User session Not Found' error. How do I fix this?

I have an HTTP Cache and HTTP Cookie Manager in my test plan before the HTTP samplers.

1
please share the screenshots of view results tree - Naveen Kumar R B

1 Answers

0
votes

It seems like a bad configuration of two servers as they are not sharing the session data. normally, the servers share the session related information such as cookies so that client can get the response from either of the servers.

I am not sure whether you can really control which server to hit (though it hit the second server during recording, because load balancer has chosen that server for you at that point in time), it is completely Load balancer decision (based on the algorithms used, like least response times, client IP-based etc)

I suggest to check the server configurations whether they are sharing cookie level data or not. Also, suggest check which algorithm is being used by the load balancer to distribute the load across two servers.

If they are not causing the issues, then look at how the cookies are sent by the server and how the(JMeter) client is resending them (by HTTP Cookie Manager) i.e., check whether Cookies are sent by the JMeter as expected by the server(s). sometimes it is possible that partial cookies are being sent.

Please answer the following questions:

  1. Is the request always sent to Server2 when one thread is used?
  2. Whether the request is getting succeeded when the requests hit the server1 for single thread?
  3. Are you hitting the load balancer URL (which inturn decides the server to hit)? Or hardcoded one of the server address?