Welcome! Log In Create A New Profile

Advanced

Re: Tuning nginx on EC2

Chetan Sarva
December 22, 2010 11:36AM
For the record, it turns out that the limiting factor is the
throughput of the virtual NIC itself. Specifically, it can push a max
of about 100k packets/sec. Without some improvements in that area, it
seems the max requests possible on a standard ec2 instance is about
12k/sec (a 10gbps instance can actually do about double that number).

On Sun, Dec 12, 2010 at 5:28 AM, <slogster@gmail.com> wrote:
> At Sat, 11 Dec 2010 11:53:17 -0500,
> Chetan Sarva wrote:
>>
>> On Sat, Dec 11, 2010 at 9:12 AM, Dennis Jacobfeuerborn
>> <dennisml@conversis.de> wrote:
>>
>> > I don't have any direct experience with services like EC2 but remember that
>> > before the traffic hits your machine it first has to pass through various
>> > routers and switches in Amazons infrastructure that is shared between
>> > probably millions of EC2 instances. You might either hit a bottleneck on
>> > these shared components or maybe Amazon just has put some limitations in
>> > place to prevent abuse.
>>
>> With shared resources you would expect to see a range of throughput
>> numbers from when resources are constrained and when they are not. On
>> EC2, disk & network I/O is a shared resource and both can be measured.
>> I've done raw network throughput tests and they confirm this. With my
>> nginx tests (and, to be fair, other webservers as well), I
>> consistently get around 12k reqs/sec.
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://nginx.org/mailman/listinfo/nginx
>
> There are some things you have to consider, when doing network benchmarks:
> 1) bandwidth (as you were told) - you can test with iperf
> 2) rtt
> 3) statefull firewall (statefull NAT goes in here too) - big penalty especially when every new request is a new connection and you are using keepalive
> 4) OS max and per nginx process limits for file descriptors
> 5) network buffers
> 6) polling
> 7) backlog
> 8) tcp fin timeout
> 9) nginx number of processes
> 10) nginx backlog per socket
> 11) nginx regexp in locations, ifs and so on...
> 12) nginx keepalive? this is important when you are benchmarking req/s, becase a) 3 way tcp handshake takes some time, closing connections too, b) requests cannot be parallelized per connection
>
> good luck with benchmarking :)
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Tuning nginx on EC2

Chetan Sarva December 11, 2010 12:36AM

Re: Tuning nginx on EC2

Dennis Jacobfeuerborn December 11, 2010 09:16AM

Re: Tuning nginx on EC2

Chetan Sarva December 11, 2010 11:56AM

Re: Tuning nginx on EC2

valor December 11, 2010 02:24PM

Re: Tuning nginx on EC2

Chetan Sarva December 11, 2010 02:34PM

Re: Tuning nginx on EC2

Anonymous User December 12, 2010 05:32AM

Re: Tuning nginx on EC2

Chetan Sarva December 22, 2010 11:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 323
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready