I have created a performance test suite in Jmeter. The suite contains one thread group: Thread properties: Number of threads: 100 Ramp-up period: 5 Loop count: 1 Clearing cache and cookies on each iteration.
Thread group has 30 samplers (HTTP Requests for 30 pages), each samplers has "View Results Tree" and "View Results in table" listeners.
With this I am running the test suite.
Problem: I am getting "502 Response" for some requests on some threads.
I am new to performance testing and Jmeter. Please let me know what is the reason for getting 502 in this case and how can I solve this.
All HTTP status codes 5xx are server errors which means that you cannot "solve" them from JMeter perspective.
Particular HTTP status code 502 means "Bad gateway", as per description:
So in order to "solve" it you need to inspect your application and middleware logs and see what is the root cause of the problem.
If it happens only under the load of 100 users and not reproducible with less amount of threads it indicates that your application is overloaded hence cannot properly respond to certain requests. So you can just report it as a performance bottleneck.
A good idea would be implementing monitoring of the system under test to measure CPU, RAM, Network, Disk usage, etc. as the reason could be as simple as the lack of resources, it can be done using JMeter PerfMon Plugin
If the machine is not overloaded but you're getting this error it means that either system under test is not properly configured for high loads or uses inefficient algorithms somewhere, you can discover what's going on under the hood by looking at profiler tool or APM tool output