使用Python-Flask应用程序,服务器无法处理并发请求(如果15-20个用户一次使用并发请求,则会中断)。
系统配置: 操作系统:Ubuntu 处理器:2核 内存:4GB 云提供商:AWS
nginx配置
worker_processes 1; events {
worker_connections 1024; }
http { access_log /var/log/nginx/access.log; proxy_connect_timeout 2000; proxy_read_timeout 2000; fastcgi_read_timeout 2000; error_log /var/log/nginx/error.log info;
include mime.types;
gzip on;
server {
listen 80;
server_name xx.xx.xxx.xx.xx;
location / {
include uwsgi_params;
uwsgi_pass unix:///home/ubuntu/proj/proj.sock;
#keepalive_timeout 155s;
}
} }
uwsgi.ini文件
[uwsgi]
module = wsgi
master = true
processes = 5
socket = proj.sock
chmod-socket = 665
vacuum = true
worker-reload-mercy = 240
enable-threads = true
async = 10
ugreen
listen =1000