|Main Archive Page > Month Archives > syslog-ng-users archives|
flush_timeout() and flush_lines() work together. Syslog-ng will write
to disk if flush_lines() lines are in the buffer, *or* if
flush_timeout() happens, whichever happens first.
So to get your desired behavior you should set flush_timeout() to 60
seconds or something, that way the 2-3 lines in the buffer will stay
there long enough for the kernel to spin down the disks.
Paul Krizak 7171 Southwest Pkwy MS B200.3A
MTS Systems Engineer Austin, TX 78735
Advanced Micro Devices Desk: (512) 602-8775
Linux/Unix Systems Engineering Cell: (512) 791-0686
Global IT Infrastructure Fax: (512) 602-0468
On 07/11/2011 10:19 AM, Lars Stokholm wrote:
> It's not silly and in fact I've set flush_lines (10); in
> syslog-ng.conf. I know it's not a lot, but 10 lines is far more than
> crond outputs per minute, which is why I don't understand syslog-ng
> writes every minute when crond is running and almost not at all when
> crond is not running. Am I making any sense? :)
> On Mon, Jul 11, 2011 at 7:10 PM, Paul Krizak<firstname.lastname@example.org> wrote:
>> This may be a silly question, but have you tried setting flush_timeout()
>> to some large value so that messages are queued? Or is this not the
>> behavior you seek? It seems fairly obvious to me that if you have
>> anything writing to syslog at any time, and those messages end up in a
>> file, that the kernel is going to spin up the disks and write out the
>> dirty pages.
>> The only way I can imagine to avoid this would be to queue the messages
>> within syslog-ng (which won't cause any disk-backed pages in memory to
>> become dirty) and only write them out at wide enough intervals that the
>> kernel sees enough inactivity to spin down the disks.
>> Paul Krizak 7171 Southwest Pkwy MS B200.3A
>> MTS Systems Engineer Austin, TX 78735
>> Advanced Micro Devices Desk: (512) 602-8775
>> Linux/Unix Systems Engineering Cell: (512) 791-0686
>> Global IT Infrastructure Fax: (512) 602-0468
>> On 07/11/2011 09:58 AM, Lars Stokholm wrote:
>>> On my laptop I run Arch Linux with syslog-ng and cronie (cron) among
>>> other programs of course.
>>> I'm trying to get my harddrive to spin down automatically once in a
>>> while (using hdparm).
>>> Me and a lot of other people both in the Arch and Ubuntu community are
>>> having our attempts to do this ruined, by what first seemed to be the
>>> EXT4 journalling block device (jbd2).
>>> After long discussions and finally a bug report (see at the bottom of
>>> this mail), I think I've boiled my troubles down to be mostly about
>>> syslog-ng (and possibly cronie - but I don't think so).
>>> No matter what I try I can't seem to get syslog-ng to stop "waking up my
>>> disks" (at least that's what kernel tracing tells me). Killing the crond
>>> process almost totally stops these syslog-ng writes to the disk.
>>> Unfortunately I've been unable to configure my way out of it using
>>> syslog-ng.conf. So my harddrive won't stay spinned down - not even for a
>>> This is what tracing the journalling gives me (see the kernel bug report
>>> below for an explanaition):
>>> As you can probably see, syslog-ng writes every minute at least. I guess
>>> that's because my user crontab has a command that gets run every minute.
>>> What I don't get is why syslog-ng writes to the disk, even though I'm
>>> telling it not to log crond's output.
>>> Here is my syslog-ng.conf - as you can see I tried to output the crond
>>> messages to /dev/null. I guess it works, because there are no mentions
>>> of crond anywhere in /var/log anymore.
>>> Here are the discussions and the bug report I mentioned:
>>> I don't know if syslog-ng is causing trouble for only me, but it seems
>> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
>> Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
>> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng