Here’s one from the “If I write about it, maybe I’ll remember it next time” department.
This has happened to me at least twice now. It’s a sure sign that you’ve got too many websites when you can’t remember them all, never mind visit them daily.
I checked out a site today that I haven’t been to in a few weeks, only to be greeted by server errors. That’s the worst feeling in the world, especially on a Friday night. Even more so on a site you haven’t looked at in many days.
I hit the typical places, error logs, optimized the databases, etc. etc. Nothing, and then…
Dawn Breaks on Marblehead
I’m sure that most people don’t know that there’s a 2GB file limit in 32-bit versions of Linux. This includes most servers running Linux. And even if you do know this, it’s probably the last thing you’ll think of when things go wrong.
If you’ve got a website that creates growing files, typically log files, that do not periodically get cleaned, you’ve got a timebomb on your hands. It may take a few months, or a few years, but eventually a file that the server is trying to write to may reach 2GB in size.
When it happens, it’s probably the least helpful message you can get from a web server — a “500 Server Error“.
The error logs generally aren’t much help either and contain errors like:
Premature end of script headers
If you do find yourself with this mysterious problem all of a sudden, especially with no other changes being made, look for a super-large log file being the culprit, specifically one that is this size:
$ ls -l
.
.
.
2147483647 Jun 6 17:16 error_log
Sniffing out Timebombs
If you have shell access to your server, you can use the ‘find’ command to locate any potentially large and dangerous files, in this case, files that are at least 100MB.
$ find . -size +`expr 100 \* 1024 \* 2` -exec ls -l {} \;
That command will search recursively from the current directory. So you may want to try it from different locations. To search log files from the server’s root, you may need to be the root user.
And if you’re doing the math thinking that doesn’t add up to 100MB, that’s because the find command’s size parameter works in 512 bytes. So that’s 100 * 1024 * 2 * 512, which is 100MB.
Even if the files you find aren’t created by your webserver, it might be a good idea to find some of these and delete them if possible as they’re eating up your disk space.
