title: ningx, uwsgi, python permanent mysql error after some time from starting application
body: <p>I'm using nginx as frontend server and uwsgi for python applications. About one time a day one of my applications starts falling. In log I can see different mysql errors. For example:</p>
  
  <pre><code>sqlalchemy.exc.OperationalError: (OperationalError) (2006, 'MySQL server has gone away')
  </code></pre>
  
  <p>or</p>
  
  <pre><code>sqlalchemy.exc.OperationalError: (OperationalError) (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)") None None
  </code></pre>
  
  <p>Also there were something about <code>can't locate row column for column ...</code>. And maybe more interesting:</p>
  
  <pre><code>--- no python application found, check your startup logs for errors ---
  </code></pre>
  
  <p>What help's - I'm killing my uwsgi process and run it again. Interesting thing is other apps (they also use mysql) are ok and continue to work.</p>
  
  <p>If I just kill forks nothing happens. I must kill master process.</p>
  
  <p>My uwsgi config is:</p>
  
  <pre><code>module = stulyev
  callable = app
  pp = /home/krasulya/apps/stulyev.net
  logto = /var/log/stulyev.net.log
  touch-reload = /tmp/stulyev.net.sock
  socket = /tmp/stulyev.net.sock
  uid = krasulya
  gid = www-data
  daemonize = /var/log/stulyev.net.daemon.log
  reload-on-exception = true
  harakiri = 30
  max-requests = 10000
  harakiri-verbose = 1
  buffer-size = 65535
  </code></pre>
  
  <p>What can I do? Thanks.</p>