I run a fairly large WordPress-driven site (around 700k uniques/month) and for the past few months, we have been experiencing a very strange error once a week. (Almost once every seven days, like clockwork.) I think it's PHP/MySQL crash-related, however my knowledge of these is limited and I'm hoping someone here will be able to help.
Here's what happens when this problem occurs:
- Posts display as usual on the homepage, however every post's category changes to "uncategorized", as does their permalink (we use the /category/post-title URL structure)
- Our authors can edit and create posts as usual, however when they try to upload photos they get an error that WordPress is "missing a temporary folder"
- When trying to view comments, the number of pending comments appears in the Admin sidebar, however when you click on it to moderate comments, it says there are "0 Comments".
- Our sidebar widgets are unable to pull "Recent Posts" and "Featured Posts" to display on the homepage. These widgets go blank.
- A look at our mysqld.log file shows the following error happening multiple times when this occurs: /usr/libexec/mysqld: Sort aborted.
- Sometimes when this happens, this error also displays in the mysqld.log file: Incorrect key file for table '/tmp/#sql_c9d_113.MYI'; try to repair it
[ERROR] /usr/libexec/mysqld: Incorrect key file for table '/tmp/#sql_c9d_101.MYI'; try to repair it
These problems persist until I restart the server, which fixes this, then everything will be fine for another week until all of these things happen again. The cycle repeats - a server restart fixes it for about seven days, then it's back again.
I've done some research and I think it might have to do with memory on our server, however I'm at a loss for how to fix this. Any suggestions? Possible fixes? Any logs I should take a look at? Any help would be seriously appreciated.