Performance / Stress Testing Java EE applications

cmd picture cmd · Sep 23, 2013 · Viewed 13.3k times · Source

It's difficult to find all bottlenecks, deadlocks, and memory leaks in a Java application using unit tests alone.

I'd like to add some level of stress testing for my application. I want to test the limits of the application and determine how it reacts under high load.

I'd like to gauge the following:

  • Availablity under high load
  • Performance under high load
  • Memory / CPU / Disk Usage under high load
  • Does it crash under high load or react gracefully

It would also be interesting to measure and contrast such characteristics under normal load.

Are their well known, standard techniques to address stress testing. I am looking for help / direction in setting up such an environment. Ideally, I would like to run these tests regularly, so that wecan determine if recent deliveries impact performance.

Answer

duane musser picture duane musser · Oct 17, 2013

I am a big fan of JMeter. You can set up calls directly against the server just as users would access it. You can control the number of user (concurrent threads) and accesses. It can follow a workflow, scraping pertinent information page to page. It takes 1 to 2 days to learn it well enough to be productive. (You can do the basics within an hour of downloading!)

As for seeing how all that affects the server, that is a tougher question. I have used professional tools from CA and IBM. (I am drawing a blank on specific tool names - maybe due to PTSD!) I have used out-of-the-box JVM profilers. I have used native linux and windows tools. If you are not too concerned about profiling what parts of your application causes issues, then you can just use the native tools for your OS to monitor CPU/Memory/IO.