1

I noticed that my OpenVZ virtual machines (VEs) don't have logrotate installed, and my logs are getting a bit big :-)

Since the file systems of the VEs are exposed to the host via /vz/private/.. , is there any reason not to just have logrotate on the host rotate the logs in the VEs ?

2 Answers 2

1

Because you probably want to logrotate a number of OS logs on each VM, it's probably easier and cleaner to just install logrotate. That's definitely my recommended solution.

Regarding the 10 logrotates vs. 1 logrotate resource issue, I don't think that's something to be concerned about. That's WAY premature optimization. Do it the correct way first, and then make it faster if necessary.

Logrotate will run once per day; on my system it takes about 0.002 seconds to run. It will take a lot longer the first time, but after that your resource hit will be next to nothing.

You can even make it better by staggering the time your /etc/cron.daily scripts execute -- so not all the virtual machines execute at the same time.

(And since whatever slows your system down will be the actual moving/truncating/renaming/gziping/etc. of the logs, and that will happen with one or 10 logrotate processes -- it's another reason to go with one logrotate per VM. The overhead for logrotate itself is so minimal it's lost in the noise.)

0

Seems to be a bikeshed but...

IO is the only resource that logrotate will have a noticeable effect on.

One master logrote would produce just as much IO as the set of them running inside any number of Linux containers (VMs).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .