0

we are currently load testing our application, a java rest services webapp. At first glance the performance was poor, but we have no comparison point.

The environment : - ubuntu 12.04 server on Amazon micro EC2 instance - tomcat 7, maxThreads=500, Xmx=450m - java 6, installed by default.

The webapp / service : A simpled webapp with on service called "getVersion". It return a string "1" - there is no processing (db, file etc.) - just return "1".

The test : We load tested it with multimechanize : 100 concurrent users for 60 seconds. We had effectively 76 requests per second.

The result : between 0,X and 5 seconds to respond. 5 seconds appearing once every 10 requests approximatively.

We thought Tomcat would handle easily this ammount of concurrent requests. Is this normal ? Is there anything to tune besides memory, maxThreads ?

Eran Medan
  • 44,555
  • 61
  • 184
  • 276
user1003331
  • 239
  • 1
  • 4
  • 8
  • Any database I/O for each request? what process each request is performing? or is it a plain noop? Also you didn't say what Tomcat version you use. – Eran Medan Sep 17 '12 at 15:19
  • No I/O, the method is just return "1". – user1003331 Sep 17 '12 at 15:22
  • what is the Tomcat version? and are you running the JVM in server of client mode (http://stackoverflow.com/questions/198577/real-differences-between-java-server-and-java-client). Also what are the GC params, and heap size, you might be wasting time on GC? Also what is the current maxThreads setup – Eran Medan Sep 17 '12 at 15:23
  • We setup Tomcat 7, I installed the JRE by default. I believe also we lose time on GC as response time sometimes rockups and come back to a normal time. Is there anything to do to tune GC ? – user1003331 Sep 17 '12 at 15:39
  • What performance do you get from other JEE servlet containers? What performance do you get from local physical environments? You're being very quick to 'shoot the messenger'! Tomcat, running a well designed application, on responsive hardware should be able to handle several hundred (if not thousands) of requests per second... – Michael Sep 17 '12 at 15:58
  • 2
    Also keep in mind that an EC2 micro instance has only 613 MB of memory, low IO and CPU. It is not even classified as a "standard instance" in the Amazon EC2 doc (http://aws.amazon.com/ec2/instance-types/). You can't expect software to be faster than the hardware on which it runs. – David Levesque Sep 17 '12 at 16:57

3 Answers3

2

The result : between 0,X and 5 seconds to respond. 5 seconds appearing once every 10 requests approximatively.

Based on the above I would attach a profiler (e.g. jvisualvm) and watch the GC cycles, try setting parallel GC, or simply increase the heap size and see if it has an affect, 450m should be enough but the bloat of each request and having many users might cause frequent GC cycles, just a guess, but worth a check

Eran Medan
  • 44,555
  • 61
  • 184
  • 276
0

I'd try the same load test on your local laptop first, to rule out the micro instance as the issue (If its a dead simple app as you say that shouldn't be hard).

It's also easy to run up jvisualvm then and profile a little. Occasional very slow outliers smell like GC issues tome.

(Those numbers sound pretty dreadful, if it helps. I'd expect a dummy app like that to handle far more than that).

Rasputnik
  • 313
  • 2
  • 4
0

Your issue could be due to Micro instances approach:

They get up to 2 ECUs, but they do not maintain that process power. If you abuse your cpu share, your instance is given less processing for some time.