Hi,
I have a site that is using a load balancer to 4 front end nodes (Each node
has access to 3 DB Servers) with 4GB ram and quad processors each. However
all the servers seem to slow down to a crawl when there is 1.8k - 2k
concurrent connections to the node balancer.
My question is how do I correctly set uwsgi for a heavy load concurrent
connections?
More information:
All servers are running nginx + uwsgi + web2py
>From below uwsgi finds 4 CPU's but it looks like it only ever uses one core.
*** Starting uWSGI 1.2.3 (64bit) on [Thu Jul 5 20:53:33 2012] ***
compiled with version: 4.6.3 on 28 June 2012 08:00:11
detected number of CPU cores: 4
current working directory: /
detected binary path: /usr/local/bin/uwsgi
your memory page size is 4096 bytes
*** WARNING: you have enabled harakiri without post buffering. Slow upload
could be rejected on post-unbuffered webservers ***
detected max file descriptor number: 11000
lock engine: pthread robust mutexes
shared area mapped at 0x7f6f0d141000, you can access it with
uwsgi.sharedarea* functions.
uwsgi socket 0 bound to TCP address 127.0.0.1:9001 fd 3
Python version: 2.7.3 (default, Apr 20 2012, 23:04:22) [GCC 4.6.3]
*** Python threads support is disabled. You can enable it with
--enable-threads ***
Python main interpreter initialized at 0x1dc7120
your server socket listen backlog is limited to 1024 connections
*** Operational MODE: preforking ***
added /home/developer/projects/yaw/ to pythonpath.
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1dc7120 pid:
1347 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 1347)
spawned uWSGI worker 1 (pid: 1355, cores: 1)
spawned uWSGI worker 2 (pid: 1356, cores: 1)
spawned uWSGI worker 3 (pid: 1357, cores: 1)
spawned uWSGI worker 4 (pid: 1358, cores: 1)
-----------------------------------------------------------
Start up script:
DAEMON=/usr/local/bin/uwsgi
DAEMON_OPTS="-s 127.0.0.1:9001 -M 4 -t 30 -A 4 -p 4 -d /var/log/uwsgi.log
--pythonpath $PYTHONPATH --module $MODULE --limit-post 4096 --listen 1024"
start-stop-daemon --start --chuid $OWNER:$OWNER --user $OWNER \
--exec $DAEMON -- $DAEMON_OPTS
----------------------------------------------------------
Nginx settings:
http {
include mime.types;
default_type application/octet-stream;
client_body_buffer_size 8k;
client_header_buffer_size 1k;
client_max_body_size 1m;
#large_client_header_buffers 4 4k/8k;
ignore_invalid_headers on;
charset utf-8;
#log_format main '$remote_addr - $remote_user [$time_local]
"$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
tcp_nopush on;
server_tokens off;
source_charset utf-8;
#limit_req_zone $binary_remote_addr zone=gulag:1m rate=60r/m;
#keepalive_timeout 0;
keepalive_timeout 65;
types_hash_max_size 2048;
gzip on;
gzip_disable "msie6"
gzip_proxed any;
gzip_comp_level 2;
gzip_types text/plain text/css application/json
application/x-javascript text/xml application/xml application/xml+rss
text/javascript;
#log_format main '$remote_addr - $remote_user [$time_local] $status
"$request" $body_bytes_sent "$http_referer" "$http_user_agent"
"$http_xforwarded_for"';
log_format main '$remote_addr $host $remote_user [$time_local]
"$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"
$ssl_cipher $request_time';
server {
listen 80;
server_name yaw003 yaw003.com;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9001;
}
}
server {
listen 443;
server_name yaw003 yaw003.com;
ssl on;
ssl_certificate /home/developer/projects/yaw/settings/star_.pem;
ssl_certificate_key /home/developer/projects/yaw/settings/star_.key;
location / {
uwsgi_pass 127.0.0.1:9001;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
}
}
}
Also note all connections go through 443
Is there something I am missing that is vitally important for high load
websites? We have over 20,000 (and growing) people trying to connect a
second however can't even handle 2000 concurrent with 4 nodes (linode) each
having 4GB ram.
--
--
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.fittraineronline.com - Fitness Personal Trainers Online
http://www.warplydesigned.com
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi