0

I’m having a problem with AWS. Im using Elastic Container Service that is created as on link https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html Instance type is t2.xlarge (https://aws.amazon.com/ec2/instance-types/). Inside the container I have nginx + php7.0-fpm configuration. To be sure I have also tested the same stuff using apache2 instead of nginx. Everything else was the same.

I have been using loader.io (https://loader.io/) and ApacheBench (https://en.wikipedia.org/wiki/ApacheBench) in order to perform load testing.

As you can see on the instance types list, instance I’m using should be able to receive some load. But when I tested it results were a bit a shocking. That machine did perform 1500 req/s on PHP Hello World progam. So basically it was a simple echo command in whole file. I’ve manage to get the same results on my personal computer (MacBook Pro 13 Mid 2014) which should, by the available specs, be less powerful machine than t2.xlarge. Also, for the AWS instance almost all resources were available of the Docker container and services within, while on my Mac bunch of other “heavy” software was running in parallel.

Surfing the net I’ve found some examples where people had similar result to mine using smaller instances than I did. (for example https://stackoverflow.com/questions/32495636/is-there-any-limitation-on-ec2-machine-or-network)

I was wondering did any of you did ever meet something like this? Is this normal behaviour? Can I get better results?

On this link https://www.dropbox.com/s/22antrony35fhq0/Archive.zip?dl=0 you can download my fpm and nginx (and apache) configuration.

Hope someone can help me.

EDIT:

I've figured out that using the same EC2 machine without ECS I can get about 10x increase in req/s than using it within ECS.

Can anyone know something about this? Can Docker decrease performances that much? Or could it be due to bad implementation from AWS?

Ante Braovic
  • 101
  • 1

1 Answers1

0

t2 instances are throttled (with the ability to burst to handle spikes) - there's some discussion of this here, so it's possible you might want to look into another instance type (eg c5.large) or the t2 unlimited mode.

Make sure you've got php's opcache enabled in your php.ini, and that your using php7+, as this makes a big difference to 'hello world' type examples. Also bear in mind that they're often not a very good benchmark, there's lots of good benchmark scripts out there on google that might better measure real-world performance.

  • thanks for your answer, this did get me some improvement but still it is approx. two time better which is what other guys get on weaker and cheaper machine than this one. So sorry but I can mark this as answered. Nevertheless thanks for your effort. @Jonathon – Ante Braovic Jan 16 '18 at 12:57