nginx和django高并发优化

2016-01-12  本文已影响3129人  三千万星辰

为了调节性能做了如下优化:

增加nginx的worker process数量

uwsgi

[uwsgi]

chdir = /root/seo/seom/
socket = 127.0.0.1:8528
vacuum=True
module=SeoM.wsgi
daemonize = /var/log/seo-uwsgi.log

processes = 10 
threads = 10 
max-requests=10000
listen = 512 ---> linux kernel limit, try to increase it
buffer-size = 32768

vi /etc/sysctl.conf 编辑文件,加入以下内容:
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30 然后执行
sysctl -p

上一篇 下一篇

猜你喜欢

热点阅读