I run nginx and tornadoes in c1.medium instances.
When I run ab, below is my output. Nginx will not work. I tried setting up the config file for ninx to no avail. If I start only one port, passing nginx, for example. `
http:
then its fast. Look at the very bottom. This should be a nginx problem, so how can I solve this problem? Also below is the conf file for nginx.
root@ip-10-130-167-230 :/etc/service# ab -n 10000 -c 50 http://127.0.0.1/pixel?tt=ff This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient) Completed 1000 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests apr_socket_recv: Connection reset by peer (104) Total of 9100 requests completed
It should smoke, but it is not.
I installed the following parmamerts
ulimit is at 100000
Here is my nginx conf:
user www-data; worker_processes 1; # 2*number of cpus pid /var/run/nginx.pid; worker_rlimit_nofile 32768; events { worker_connections 30000; multi_accept on; use epoll; } http { upstream frontends { server 127.0.0.1:8050; server 127.0.0.1:8051; } sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; # Only retry if there was a communication error, not a timeout # on the Tornado server (to avoid propagating "queries of death" # to all frontends) proxy_next_upstream error; server { listen 80; server_name 127.0.0.1; ##For tornado location / { proxy_pass_header Server; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; proxy_pass http://frontends; }
if I ran ab by passing nginx:
ab -n 100000 -c 1000 http://127.0.0.1:8050/pixel?tt=ff root@ip-10-130-167-230 :/home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbTornadoServer
Oupput when using the -v 10 option to ab:
GIF89a LOG: Response code = 200 LOG: header received: HTTP/1.1 200 OK Date: Wed, 16 May 2012 21:56:50 GMT Content-Type: image/gif Content-Length: 42 Connection: close Etag: "d5fceb6532643d0d84ffe09c40c481ecdf59e15a" Server: TornadoServer/2.2.1 Set-Cookie: rtbhui=867bccde-2bc0-4518-b422-8673e07e19f6; Domain=rtb.rtbhui.com; expires=Fri, 16 May 2014 21:56:50 GMT; Path=/