We have a Django app running on AWS Elastic Beanstalk (EB), behind a load balancer. The instances run the latest standard Amazon Linux environment with Python 3.6, and using the standard EB mod_wsgi
configuration (with Apache 2.4).
Somewhere in the application, we import scipy.signal
to use the scipy.signal.butter
function.
This works fine with scipy 1.3.3
, but when we update to scipy 1.4.1
(currently the latest version), the site becomes unreachable:
load balancer returns a HTTP status 504 "Gateway Timeout", with a blank page
EB logs only show
... [core:error] [pid ...] [client ...] Script timed out before returning headers: wsgi.py
Note that deployment still succeeds without issue. Also note that the issue does not arise on our local development machines (both windows and linux), when using the Django development server (another reason to use apache for local testing as well).
One fix that seems to work, at first sight, is to modify the Apache configuration by setting WSGIApplicationGroup %{GLOBAL}
, as suggested e.g. here (also see mod_wsgi documentation).
However, this may introduce side effects, as described e.g. here.
I do not see any obvious changes in the scipy 1.4 release notes to indicate why this issue suddenly arises.
Could someone explain what changed in scipy 1.4 to cause this issue, and if there is another way around it than the WSGIApplicationGroup %{GLOBAL}
fix described above?