Welcome! Log In Create A New Profile

Advanced

Re: nginx performance on Amazon EC2

Anoop Alias
February 20, 2013 11:06PM
On Thu, Feb 21, 2013 at 1:43 AM, Rakan Alhneiti <rakan.alhneiti@gmail.com>wrote:

> Hello,
>
> I am running a django app with nginx & uwsgi on an amazon ec2 instance and
> a vmware machine almost the same size as the ec2 one. Here's how i run
> uwsgi:
>
> sudo uwsgi -b 25000 --chdir=/www/python/apps/pyapp --module=wsgi:application --env DJANGO_SETTINGS_MODULE=settings --socket=/tmp/pyapp.socket --cheaper=8 --processes=16 --harakiri=10 --max-requests=5000 --vacuum --master --pidfile=/tmp/pyapp-master.pid --uid=220 --gid=499
>
> & nginx configurations:
>
> server {
> listen 80;
> server_name test.com
>
> root /www/python/apps/pyapp/;
>
> access_log /var/log/nginx/test.com.access.log;
> error_log /var/log/nginx/test.com.error.log;
>
> # https://docs.djangoproject.com/en/dev/howto/static-files/#serving-static-files-in-production
> location /static/ {
> alias /www/python/apps/pyapp/static/;
> expires 30d;
> }
>
> location /media/ {
> alias /www/python/apps/pyapp/media/;
> expires 30d;
> }
>
> location / {
> uwsgi_pass unix:///tmp/pyapp.socket;
> include uwsgi_params;
> proxy_read_timeout 120;
> }
>
> # what to serve if upstream is not available or crashes
> #error_page 500 502 503 504 /media/50x.html;}
>
> Here comes the problem. When doing "ab" (ApacheBenchmark) on both machines
> i get the following results: (vmware machine being almost the same size as
> the ec2 small instance)
>
> *Amazon EC2:*
>
> nginx version: nginx version: nginx/1.2.6
>
> uwsgi version:1.4.5
>
> Concurrency Level: 500Time taken for tests: 21.954 secondsComplete requests: 5000Failed requests: 126
> (Connect: 0, Receive: 0, Length: 126, Exceptions: 0)Write errors: 0Non-2xx responses: 4874Total transferred: 4142182 bytes
> HTML transferred: 3384914 bytesRequests per second: 227.75 [#/sec] (mean)Time per request: 2195.384 [ms] (mean)Time per request: 4.391 [ms] (mean, across all concurrent requests)Transfer rate: 184.25 [Kbytes/sec] received
>
> *Vmware machine (CentOS 6):*
>
> nginx version: nnginx version: nginx/1.0.15
>
> uwsgi version: 1.4.5
>
> Concurrency Level: 1000Time taken for tests: 1.094 secondsComplete requests: 5000Failed requests: 0Write errors: 0Total transferred: 30190000 bytes
> HTML transferred: 28930000 bytesRequests per second: 4568.73 [#/sec] (mean)Time per request: 218.879 [ms] (mean)Time per request: 0.219 [ms] (mean, across all concurrent requests)Transfer rate: 26939.42 [Kbytes/sec] received
>
> As you can see... all requests on the ec2 instance fail with either
> timeout errors or "Client prematurely disconnected". However, on my vmware
> machine all requests go through with no problems. The other thing is the
> difference in reqs / second i am doing on both machines.
>
> What am i doing wrong on ec2?
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>


Is there any data in the nginX error logs?


--
*Anoop P Alias*
GNUSYS http://gnusys.net
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Fwd: nginx performance on Amazon EC2

Rakan Alhneiti February 20, 2013 03:14PM

Re: nginx performance on Amazon EC2

Anoop Alias February 20, 2013 11:06PM

Re: nginx performance on Amazon EC2

David | StyleFlare February 20, 2013 11:34PM

Re: nginx performance on Amazon EC2

Rakan Alhneiti February 21, 2013 12:06AM

Re: nginx performance on Amazon EC2

mex February 21, 2013 02:29AM

Re: Fwd: nginx performance on Amazon EC2

Jan-Philip Gehrcke February 21, 2013 03:02AM

Re: Fwd: nginx performance on Amazon EC2

Rakan Alhneiti February 21, 2013 05:40PM

Re: Fwd: nginx performance on Amazon EC2

mex February 22, 2013 01:54AM

Re: Fwd: nginx performance on Amazon EC2

Rakan Alhneiti February 22, 2013 10:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 85
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready