【问题标题】:Apache mod_wsgi Flask 404 errors with large json files带有大型 json 文件的 Apache mod_wsgi Flask 404 错误
【发布时间】: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


    【解决方案1】:

    不是一个完整的答案,但是将线程数增加到 15 似乎现在已经解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-04
      • 2013-06-27
      • 2017-11-20
      • 1970-01-01
      • 2017-09-02
      • 2016-03-15
      相关资源
      最近更新 更多