Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Like others have mentioned, the problem appears to be your system running low on RAM and MySQL is blowing up due to that. Below is how to go about narrowing down where your system's memory is being used and how to recover from the database going down.</p> <p>Take a look at <a href="http://collectd.org/index.shtml" rel="nofollow">collectd</a> and its plugins. Some of the applicable ones may be the <a href="http://collectd.org/wiki/index.php/Plugin%3aProcesses" rel="nofollow">processes plugin</a> and the <a href="http://collectd.org/wiki/index.php/Plugin%3aMemory" rel="nofollow">memory plugin</a>. With those you can see your systems' memory usage and what processes are taking up most of it.</p> <p>Depending on how you are running Django, you can configure the worker processes to only process a certain number of requests and then terminate. That way if there is some sort of memory leak in your application it will not persist past that number of requests. For example, if you use <a href="http://gunicorn.org/" rel="nofollow">Gunicorn</a>, you can use the <a href="http://gunicorn.org/configure.html#max-requests" rel="nofollow">--max-requests</a> option. Setting it to 500 will drop the worker after it has processed 500 requests.</p> <p>The above combined with stats collection will show you some interesting memory usage trends.</p> <p>As for the database going down, you can setup process supervision so that if MySQL does die, it will be relaunched automatically. MySQL in latest version of Ubuntu uses Upstart to do just that. If the process dies, Upstart will bring it back up immediately. If you're using another distro that doesn't have this built-in, take a look at <a href="http://supervisord.org/" rel="nofollow">Supervisor</a>. While this doesn't fix the problem it will at least mitigate its effects. This should not be seen as the fix but rather a way to keep your application running in case something does go wrong.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload