Search code examples
spring-bootjava-8redhat

Spring Boot application not responding after pushing a large number of requests


I have a problem with a server that called server A: Server A: Red Hat Enterprise Linux Server release 7.2 (Maipo) Server B: Red Hat Enterprise Linux Server release 7.7 (Maipo)

jdk-8u231 installed on all of servers.

I have an Spring Boot application running on 2 servers. Whenever i use Jmeter to send 100 concurrency request to application running on each servers, the application running on Server B have no problem.

But in Server A, the application will be not responding, that mean the Process (PID) still running but I can't visit actuator endpoint, cannot visit Swagger page, cannot send new request ... log file show nothing since that time.

Thread dump and heap dump have no significant difference.

Could anyone show me how to analysis that problem? I still have no idea why the problem occur.


Solution

  • Well, I can only speculate here, but here some ideas that can help:

    1. There are two possible sources of issue here Java Application and Linux (+its network policies, firewalls and so forth).

    2. Since You don't know for sure, what happens, try working by "elimination".

      Create a script that will run 100 concurrent requests. Place the script at the Server A (the problematic one) and run The script will run against "localhost" (obviously). If you see that it works, then the issue is not in Java at all. Probably some network policies or linux setup, who knows.

    3. Place a log message in the controller of the java application and examine the log. The log should print the request number among other things, so that you'll be able to understand whether you get stuck after a well defined number of requests or its always a different number.

    4. Check the configurations of Spring Boot application. Maybe there is a difference in the number of threads allocated to serve the request by the embedded web server that runs inside the spring boot application (assuming you're not using a reactive stack) and this number differs. In this case you won't be able to call rest endpoints, actuator, etc.

    5. If JMX connection is available to the setup, connect via the JMX and check the MBean of Tomcat (again, assuming there is a tomcat under the hood) to check pretty much the same information as in 4.

    6. You've mentioned thread dumps. Try to take more than one thread dump but one before you're running JMeter test, one during the running (when everything still works), one when everything is stuck.

    7. In the thread dumps check the actual stacktraces, maybe all the threads are stuck working with Database or something and can't serve requests like I've explained in "4"

    8. Examine GC logs, maybe GC works so hard that you can't really interact with the application.