Disc io rate - Running Django/Mysql/Apache/Postfix
On this server I am running four projects in django / mysql / apache without a huge traffic.
There were many errors in the logs (urls old that no longer exist), then thinking that the problem would be written in the logs on disks I commented the lines for the access log of apache, but the problem persists.
Has anyone experienced this and can help me?
2 Replies
Inspect your code: your apps might be hitting the disk on every request. look out for stuff like that and fix it.
Caching: Django has helpers that assist in caching. You can alter your code to do caching, or if you're using contributed apps look into seeing if you can turn on caching for them (you'll of course need to get memcache running for that)
Template cached loader: Search for "django.template.loaders.cached.Loader" in the following page:
MAKE SURE YOU READ THE NOTE ABOUT THREAD SAFETY. MAKE SURE YOU UNDERSTOOD THAT NOTE AND THE PAGE IT LINKED TOO
Also, are you sure there's no pattern to when the server stops responding? You might have a mysql backup job that's locking all your tables, or it could be a dozen other things.
if this have a pattern I have not discovered. I'll take a look at projects that are running and I will add to the cache at least with more hits to see if it solves my problem. Thanks.