My problem is that over time the memory usage (especially the virtual memory) increases until the system freezes. There is hardly not traffic on the server and it seems to happen independendly from making any HTTP-Request.
Last time the virtual memory of the "/usr/sbin/apache2 -k start" process has used over 8GB virtual memory. It was several days from the last apache2 restart.
I have a virtual Machine with
1GB RAM and 15GB HDD where I have Ubuntu 22.04 installed with
Apache/2.4.52 over apt with
mod_wsgi, a python virtual environment where
Django 4.0.5 is installed via pip.
I do not run Django in daemon mode but in the "default" mode.
I changed nothing in apache2.conf.
My site-configuration looks like this:
WSGIPythonHome /var/www/venv
WSGIPythonPath /var/www/venv/fye_backend
<VirtualHost *:80>
ServerAdmin (my email)
WSGIScriptAlias / /var/www/venv/fye_backend/fye/wsgi.py
ErrorLog /var/www/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I serve the files like this code (in views.py):
def example(request):
key = request.GET.get("key")
some_info = some_model.objects.get(key)
return HttpResponse(some_info)
What could be the reason for this problem? If more information is needed please let me know. Thanks!
What I have tried:
Beginning totally from scratch. It has helped something, because before the System freezed allready after a day. But the problem still persists.