django, mod_wsgi, MySQL High CPU - Problems
- by Red Rover
Good Evening, and thank you for reading this post.
I am having a problem with Django after migrating the dB from SQLlite to MySQL. Initially, for the first 48hours, all ran well. But now we are experiencing high cpu about every 30 minutes. This is a production ESX4i VM host, with 2 x 2.8 ghz CPUs and 12 GB ram. I have allocated 4 cpu's to this VM and 4 GB memory.
Any insight into this configuration and help with the spikes in CPU would be appreciated. IT is configured to use the prefork MPM. Outlined are the config's for the different services:
MySQL Server version: 5.1.61 Source distribution
Django 1.3
mod_wsgi
Apache/2.2.15
httpd.conf
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 400
KeepAliveTimeout 3
prefork MPM
StartServers 8
MinSpareServers 8
MaxSpareServers 16
ServerLimit 40
MaxClients 40
MaxRequestsPerChild 0
worker MPM
StartServers 16
MaxClients 1024
MinSpareThreads 64
MaxSpareThreads 256
ThreadsPerChild 64
MaxRequestsPerChild 10240
MySQL my.conf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
my.cnf
wsgi.conf
LoadModule wsgi_module modules/mod_wsgi.so
/etc/httpd/conf.d/wsgi.conf
WSGISocketPrefix /var/run/wsgi
WSGIPythonEggs /var/tmp
WSGIDaemonProcess SITE maximum-requests=10000
WSGIProcessGroup SITE