【发布时间】:2015-12-09 21:28:26
【问题描述】:
我在 apache 上使用 mod_wsgi 设置了一个烧瓶应用程序。在其中一个页面上,我有一组图表,每个图表都从静态路由 @app.route('/data/<experiment_id>/<sensors>.json 提取数据(每个文件约 2Mb),我使用 json mimetype:return Response(fn(**kwargs), mimetype="application/json")。当我使用本地主机上的开发服务器运行它时,它工作正常,但在部署服务器上我得到零星的 404 错误。通常它将加载 10 个文件中的 7 个或 8 个。如果我直接导航到文件位置(例如http://my_server/data/test/noise.json),(单个)文件总是正确加载。
我的 apache mod_wsgi 配置如下:
WSGISocketPrefix run/wsgi
WSGIRestrictStdout Off
WSGIScriptReloading On
<VirtualHost *:80>
ServerAlias my_server
ErrorLog logs/error_log
CustomLog logs/access_log common
DocumentRoot /var/www/html
WSGIDaemonProcess data_viewer user=my_user group=my_group processes=3 threads=10 home=/var/www/html/data_viewer
WSGIScriptAlias /data_viewer /var/www/wsgi-scripts/data_viewer.wsgi
<Location /data_viewer>
WSGIProcessGroup data_viewer
WSGIApplicationGroup %{GLOBAL}
</Location>
<Directory /var/www/wsgi-scripts>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
这可能是超时问题、进程/线程问题还是其他问题?
【问题讨论】:
标签: python json apache flask mod-wsgi