apache - 从守护进程收到的运行过的或过大的响应标头
问题描述
我在我们的后端 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
解决方案
推荐阅读
- java - 信任库/密钥库需要密码是否有任何令人信服的理由?
- amazon-web-services - Istio:调用 admission webhook 地址失败
- spring - 从其他 Spring Boot 应用程序为石英调度程序安排作业
- python-2.7 - How not to show the message "DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020."?
- matlab - 如何根据 Matlab kmean() 函数的输出计算与簇质心的距离
- json - 如何使用 Scala 语言将 Spark RDD 转换为 JSON
- javascript - 条件系列失败 - Chart.js
- javascript - 托管应用程序时,Angular 深层链接刷新失败
- java - 如何在循环中放置一个寻找文件的 Try-catch 语句?
- sql - 如何将查询与运算符动态 SQL 一起使用