Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm looking for a way to limit the file size of some of our log files. For instance, /var/log/messages might grow to over a few hundred megs on some of our boxes used for testing. What I'd like to do would be to limit the size of the /var/log/messages file to something like 50MB, and when additional data comes in, older data in the file is deleted.
you wouldn't delete the data, you'd rotate the logs. you should have logrotate already runnign and if you have too much going into messages, you can change the rotation logic to rotate on file size instead of age easily enough.
Ahh..that makes sense. Didn't know you could change logrotate to use filesize instead of just at a predetermined size.
So, let me explain a little bit further...just to see if you guys have any better ideas.
We have a large number of servers that iSCSI boot to a NetApp filer (~250). So, all of these client's "local disks" are actually located on the filer. If all the log rotations kick off at the same time each night, it can cause the filer to become very busy with disk I/O for all 250 servers. I'm looking to eliminate this by either staggering the log rotation times for each of the servers, or possibly rotating based on the size.
If all the log rotations kick off at the same time each night, it can cause the filer to become very busy with disk I/O for all 250 servers. I'm looking to eliminate this by either staggering the log rotation times for each of the servers, or possibly rotating based on the size.
Either do this by size or alter the time logrotate runs, but if you have a SAN that is affected by rotating logs that don't exceed 50 megs in size each and only 250 of these machines, you seriously have something wrong with your SAN and it's I/O. I've dealt with SAN's with 20 to 30 servers attached to it while production continued to load data into our Databases using this SAN without problems and reaching/maintaining 100meg or so an hour for each database.
NetApp filers should have no problem handling log file rotations with 250 servers, if they do, I'd be calling NetApp to find out what the problem is.
Either do this by size or alter the time logrotate runs, but if you have a SAN that is affected by rotating logs that don't exceed 50 megs in size each and only 250 of these machines, you seriously have something wrong with your SAN and it's I/O. I've dealt with SAN's with 20 to 30 servers attached to it while production continued to load data into our Databases using this SAN without problems and reaching/maintaining 100meg or so an hour for each database.
NetApp filers should have no problem handling log file rotations with 250 servers, if they do, I'd be calling NetApp to find out what the problem is.
Those were actually just some arbitrary sizes I pulled out of a hat . Our log files are actually *very* large (>1GB/day) due to the testing being done on these boxes. (Lots of output)
there is also the issue of where the logs go in the first place. again not sure exactly what the issues are but can you not work on the syslog itself and filter things more effectively if so much stuff is going into messages?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.