Shourya Sarcar typed:

> Hello !       
>       There isn't much point in running sync every minute. update
> (/sbin/update / bdflush) is usually runnn at default intervals of 30
> seconds and internally calling sync () 

Hi Shourya,

Well - the proof of the pudding is in the eating - My system at home 
which isn't backed up by a UPS used to put me into the maintenance 
shell (for manually running fsck) at least 2 to 3 times a week (The 
power outages in Bangalore are frequent & unpredictable) earlier. Since 
I put in the "sync every minute" cron job, the only complaint the 
forced fsck during restart is an occasional "inode xxxx has zero dtime - 
deleted" message. So no more manual fscks for the past 3 months or so !!

In any case, I think there's a difference between syncs that the bdflush / 
update daemons call and the one that the sync program calls. I'm not 
too familiar with kernel internals, but it looks like the bdflush 
daemon is called (or woken up) at frequent intervals to ensure that 
dirty buffers are written to disk in a reasonably efficient manner - 
It uses parameters such as the no. of buffers that are dirty, the age 
of dirty buffers etc to decide it needs to commit the buffers to disk. 
The comments in the linux/fs/buffer.c code seems to indicate that 
tuning some of these parameters can cause writes to be delayed for much 
longer durations etc. 

The sync() system call however calls a function which performs an 
unconditional flushing of *all* dirty buffers to disk - I agree it's a 
rather brute force technique, but it does makes the filesystem a little 
more tolerant to abrupt power outages. 

By the way there was another thing I tried out to resolve this issue. 
There's a supposed to be a "sync" parameter that can be specified in 
the mount options of a file system which can cause all writes to the 
disk synchronous. However I had to abandon the option due to some 
reason. (Either the system got too slow or the option didn't work at 
all - I don't seem to remember the exact cause)..

Regards,

Kala




--------------------------------------------------------------------------
LI is all for free speech, but this list was created for a purpose --
to help popularise Linux in India. If your messages are counterproductive
to that purpose, your privileges to submit messages can and will be revoked.

Reply via email to