Hacker News new | ask | show | jobs
by mmt 5809 days ago
The part about log rotation strikes me as an anachronism, which, sadly, is still applicable due to naive default configurations.

Disk space is preposterously cheap, and even high-volume, Internet-scale text logs are small and low-bandwidth[1].

The problem isn't that disks fill up, but, rather, that logs are ever written somewhere that, if full, affects anything but the logging. The solution of a separate filesystem for logs has been around perhaps longer than the OP himself but only makes sense for a few, standalone servers.

Otherwise, the solution of remote syslog has been around for almost as long. If your logs are critical, you could even use two (for twice the price). Even the days of questionable reliability and small message size[2] limits are pretty long gone with syslog-ng.

This kind of thing, otherwise tedious minutae, is second nature to sysadmins. Hire one.

[1] It's the disk bandwidth or throughput which is still expensive

[2] That's on the order of 500 characters, old text pager lengths, not the newfangled 140 character sms/twitter cheapness. Hey, you kids get off my lawn!

2 comments

It's not unfortunatly... I ran into this problem the other day. The log on a long running Postgres instance brought down an entire tape archive for half the day. I had to shut down and reconfigure the instance. Of course, part of the problem was that the it was on the root partition, but this doesn't change the fact that it was a 48 GB log file with most of its information dated.
Log rotation isn't just about disk space (although why you'd want to waste Gigs of disk space on storing old log messages locally is beyond me), it's also about helpful to segment logs for easier and quicker searching and reporting, either manually or with scripts.

Not to mention it's pretty much automatic these days. It's not like it's something you've got to go out of your way to configure.

Log rotation isn't just about disk space

I disagree, since, otherwise, there's nothing rotary. If one has effectively infinite disk space, nothing ever gets "rotated out," for example.

Certainly, log segmentation provides benefits beyond being a prerequisite to rotation, but, as you point out, it's a common default configuration. An inbuilt feature of syslog-ng is log file naming based on date, obviating any post-processing.