2

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.

Adroidist
  • 121
  • 2
  • 2
    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
  • 1
    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
  • 5
    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
  • 1
    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

1 Answers1

1

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).

Abhi
  • 11
  • 1