I have a problem with mod_wsgi (3.4-14) / Apache 2.4.12 / cx_oracle 5.2 / Oracle 12 / Django 1.8.2, freezing under heavy load. The configuration has been used over the past few months in dev / testing.
Now when deployed to a production environment, Apache hangs in a couple of minutes at a higher load (it works fine with a small or moderate load).
I have a cluster of 3 Django / Apache / mod_wsgi servers, and when this happens, each server stops responding (one after the other) for 5-15 minutes.
Here is my configuration
I am using Python 3.3 and Apache 2.4.12 and mod_wsgi-3.4-14 from Red Hat (6.7) Software Collection
Apache virtual host ... WSGIDaemonProcess app.prod processes = 2 threads = 25 display- name =% {GROUP} user = MY_USER python-path = MY_PATH WSGIProcessGroup app.prod WSGIScriptAlias โโ// opt / hosts / app / app / wsgi .py
Apache version
Server version: Apache/2.4.12 (Red Hat)
Server built: Aug 11 2015 08:12:59
Server Module Magic Number: 20120211:41
Server loaded: APR 1.5.1, APR-UTIL 1.5.4
Compiled using: APR 1.5.1, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: worker
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/opt/rh/httpd24/root/etc/httpd"
-D SUEXEC_BIN="/opt/rh/httpd24/root/usr/sbin/suexec"
-D DEFAULT_PIDLOG="/opt/rh/httpd24/root/var/run/httpd/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
python33-mod_wsgi-3.4-14.el6.x86_64
Django db configuration
'default': {
'ENGINE': 'django.db.backends.oracle',
'NAME': 'DB_NAME',
'USER': 'webuser',
'PASSWORD': 'webpassword',
'HOST': '',
'PORT': '',
'CONN_MAX_AGE': None,
'OPTIONS': {
'threaded': True,
},
},
If I reduce the number of mod_wsgi, the problem will disappear, but performance is not acceptable.
WSGIDaemonProcess app.prod processes=4 threads=1 display-name=%{GROUP} user=MY_USER python-path=MY_PATH
Can someone say what could be the reason or how can I debug it, please?
More on the mod_wsgi Newsletter