Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a .jar file that represents a server which receives over TCP an image in bytes (of size at most 500 kb) and writes it file. It then sobels this image and sends it over TCP socket to the client side.

I ran it on my laptop and it was very fast. But when I put it on Amazon EC2 server m1.large instance, i found out it is very slow - around 10 times slower. It might be the inefficiency in the code algorithm but in fact my code is nothing but receive image (like any byte file) run the sobel algorithm and send.

I have the following questions:

1- Is it normal performance of Amazon EC2 server- I have read the following links link1 and link2

2- Even if the code is not that efficient, the server is finally handling a very low load (just one client), does the "inefficient" code justify such performance?

3- My laptop is dual core only...Why would the amazon ec2 server have worse performance that my laptop? How is this explained?

Excuse me for my ignorance.

share|improve this question
You won't know until you analyze the performance and figure out what's taking so long. – David Schwartz Jun 27 '12 at 21:07
I am using a windows instance. Can you help me pls how i should analyze the performance? – Adroidist Jun 27 '12 at 21:22
You can start by logging. Log how long it takes to read the data, how long it takes to process the data, and how long it takes to write the data. That will at least narrow it down to one out of three places. – David Schwartz Jun 27 '12 at 21:23
How good is your laptop? An m1.large has 4 EC2 Compute Units. Per AWS, "One EC2 Compute Unit provides the equivalent CPU capacity of a 1.0-1.2 GHz 2007 Opteron or 2007 Xeon processor." Many modern laptops would exceed that performance level. – ceejayoz Jun 27 '12 at 21:24
Personally, in my experience the Amazon servers perform on par with physical servers. You must be having some other issue. – djangofan Aug 29 '12 at 23:13

Like djangofan said, I have found AWS servers to perform on par with physical servers. You can try profiling the server jar using VisualVM (this should be fairly straightforward if you remote desktop into the Windows instance).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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