Re: More on 2.1.65 slowdown (disk thrashing)

Garst R. Reese (reese@isn.net)
Sat, 22 Nov 1997 01:30:10 -0400


Andi Kleen writes
> alan@lxorguk.ukuu.org.uk (Alan Cox) writes:

> > > > fsync ( fileno (fp) );
> > >
> > > IIRC the fsync() function in ext2 was changed into a plain sync(). The
> > > reason for this is that fsync() was extremely slow on large files, much
> > > slower than a full sync would be.
> > >
> > > Perhaps the decision to sync or fsync could be made on the basis of the
> > > file size?
> >
> > When I played with that for 2.0 the break point seems to between about 1 and
> > 3Mbytes depending on RAM, disks etc. fsync is normally done on small files
> > so it would be good to handle it nicely

> syslogd is the most prominent user of fsync() and log files tend to grow
> big..
How about a cron job e.g.:
cp syslog -b -V t syslogs
cat /dev/null > syslog
for each log file that tends to get big fast.

-- 
Garst