Since the server crashed last night, I was able to find the culprit: python's _mysql module. Not that the module itself was to blame, no, it was more my ignorance. Apparently, a mysql connection cannot be used between threads, which is something I'm pretty sure I was doing. The result is that I've made some changes that should make the mysql calls thread safe (I hope). I'm pretty new to threaded python programming, so there will probably be a few more bumps along the way, but things will eventually get better.