Would need to see the mod_wsgi configuration you are using to configure the WSGI application, including how WSGIDaemonProcess is configured and whether you are using WSGIApplicationGroup. Also, what errors are in the Apache error log when the 503 errors occur.
> On 2 Sep 2022, at 4:57 am, Juan Khawly <[email protected]> wrote: > > Hello, > > I've been running into this problem for a while. > > CONTEXT > > I have an application developed in python (3.10), django 4.0.3, using > mod_wsgi and apache. The application is in a DEV environment and hosted in > AWS EC2. Currently, it does not receive traffic at all. > > Installation of Mod WSGI > apt-get install -y apache2-dev > > Setup out of the VENV > mod_wsgi-express install-module > > editing: /etc/apache2/mods-available/wsgi.load > > LoadModule wsgi_module > "/usr/lib/apache2/modules/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so" > WSGIPythonHome "/data/home/user/environment/venv" > > Module Enabled > a2enmod wsgi > > PROBLEM > > The application works perfect most of the time. Couple of times a week, > without traffic the apache server goes down into 503. Usually it is preceded > by a random request but it does not always happen that way. I am assuming > that is Slow DDOS but I want to make sure it is not miss configuration of the > WSGI. > > access.log example > <access.PNG> > > error.log example > I masked the internal routes > > This is one of the errors: > [Thu Sep 01 04:22:21.520772 2022] [wsgi:error] [pid 3267:tid 140518453380864] > [client 118.126.82.157:37722] Timeout when reading response headers from > daemon process 'XXXXX': /XXX/XXXX/XXXXX/XXXXX/XXXXXX/wsgi.py > > Another type of error: > [Thu Sep 01 04:22:21.520772 2022] [wsgi:error] [pid 3267:tid 140518453380864] > [client 118.126.82.157:37722] Timeout when reading response headers from > daemon process 'XXXXXXX': /XXX/XXXX/XXXXX/XXXXXX/XXXXXXX/wsgi.py > > SOLUTION > > If I restart the server, all works again until next failure. > > I've enabled the following modules, in case it is SlowDDOS > modreqtimeout > libapache2-mod-qos > libapache2-mod-security2. > > Any recommendation? > > Thanks, > Juan Khawly > > > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/modwsgi/3cc5285a-9943-4143-9b7f-5fa24e681c70n%40googlegroups.com > > <https://groups.google.com/d/msgid/modwsgi/3cc5285a-9943-4143-9b7f-5fa24e681c70n%40googlegroups.com?utm_medium=email&utm_source=footer>. > <access.PNG> -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/69A7D660-DCCC-4779-8F51-78CCB0376895%40gmail.com.
