I am attempting to stress a server as much as I can before it goes into production. I’m using Jmeter and have been able to add a little more stress by modifying scripts. I’ve also modified JVM options but still not enough. What are some of the best ways to increase server load?


Several ways to do that. You can simply use dd, like :

dd if=/dev/zero of=/dev/null

Or there are other tools like stress :

stress --cpu 2 --timeout 60

The above will stress two cores for 60 seconds.
Or you can also use an endless while loop :

while true; do true; done

Another possibility is this fork bomb - careful with this as it might even crash your computer :

:(){ :|:& };:

There are many other possibilities.

  • 1
    Thanks Mazs. I'm a Developer and have been tasked with this so excuse my novelty. Where would this dd command be ran? Probably a System Admin needs to do it? Where would the while loop be placed? Configuration file? – Angular_Newbie May 11 '16 at 14:28
  • All of these should be executed in a terminal / bash. The dd command is usually present on every Linux system. while and the fork bomb are bash internal commands. stress is an external tool, must be installed (here is a link on howto install stress on Solaris : opencsw.org/package/stress). – mazs May 11 '16 at 14:36
  • but these will increase load on the OS level - do you want to increase load for the Java server, like generating traffic and requests and so on ? – mazs May 11 '16 at 14:37
  • Yes. Load on Java Server. Web Traffic/ requests, etc. – Angular_Newbie May 11 '16 at 14:38
  • yeah thats a different thing....on others forums ppl speak about Jmeter, The Grinder, Pylot, but i think you have to create more complex tests to really stress the server. There is more info on this link : stackoverflow.com/questions/7492/… – mazs May 11 '16 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.