首页 > 解决方案 > 从守护进程收到的运行过的或过大的响应标头

问题描述

我在我们的后端 apache2 上运行 python3 EC2 ma5.4xlarge 实例(64 Gb 内存,16 vCpu)和 Ubuntu 16.04.7 我的数据库在 AWS RDS(r5.4xlarge)上我们的后端服务器服务于多个站点(大约 10 个客户) apache2.conf 设置 **Timeout 900

KeepAlive On
MaxKeepAliveRequests 700
KeepAliveTimeout 2
HostnameLookups Off
AccessFileName .htaccess**
<FilesMatch "^\.ht">
        Require all denied
</FilesMatch>

mod_wsgi 设置 - 每个站点加载到他的文件配置(有 10 个站点)site1.conf:

WSGIDaemonProcess site1  python-path=/mnt/ttt/py/production/pythonn home=/mnt/ttt/py/production/python processes=12 threads=5 display-name=%{GROUP}
WSGIScriptAlias /site1 /mnt/ttt/py/production/python/portal/wsgi_main.py
WSGIApplicationGroup %{GLOBAL}
<Location /site1>
WSGIProcessGroup site1
</Location>

鉴于我的配置,您能否告诉我最大进程/线程/请求数是否合适?我们在过渡到 WSGI 时遇到性能问题,可能是什么原因?

此外,我们从 wsgi 日志中得到以下错误

- [pid 7023:tid 139816746346240] [client 127.0.0.1:37026] Timeout when reading response headers from daemon process 'site1': /mnt/ttt/py/production/python/portal/wsgi_main.py

- [Mon Jun 21 06:25:01.449450 2021] [wsgi:error] [pid 2010:tid 139816737953536] (2)No such file or directory: [client 127.0.0.1:63706] mod_wsgi (pid=2010): Unable to connect to WSGI daemon process 'site2' on '/var/run/apache2/wsgi.26625.0.9.sock' as user with uid=1100.

- [Mon Jun 21 06:25:05.074549 2021] [wsgi:error] [pid 6925:tid 139816746346240] [client 127.0.0.1:62090] Truncated or oversized response headers received from daemon process 'site1':/mnt/ttt/py/production/python/portal/wsgi_main.py

标签: apachemod-wsgiwsgi

解决方案


推荐阅读