Mailinglist Archive: opensuse (1606 mails)

< Previous Next >
Re: [opensuse] Terrible performance on default ext3 writing with O_SYNC
  • From: Lew Wolfgang <wolfgang@xxxxxxxxxxxxxxx>
  • Date: Sat, 06 Sep 2008 18:34:37 -0700
  • Message-id: <48C32FAD.7090309@xxxxxxxxxxxxxxx>
Taranov Ilya wrote:
We experience severe performance lacking while writing to file, opened
with O_SYNC option.
We understand that some performance degradation is normal in this mode,
but on my system it is 200 (hundred !) times slower.

For example on Debian linux, it is just 10-20 times slower on the same
filesystem with the same mount options.

OpenSUSE (10.3) Configuration:
uname -a
Linux vault-13 2.6.22.5-31-default #1 SMP 2007/09/21 22:29:00 UTC i686
i686 i386 GNU/Linux

I experienced something similar with 11.0. I've been using
a Seagate Freeagent 500-GB USB-2 drive for backups. With 10.3
formated with reiserfs I used rdiff-backup without problem.

After a fresh install of 11.0 I formatted the drive with ext3
because of the freezing issues I was having with reiserfs.
My first rdiff-backup took a LONG time, however. Indeed, after
30-hours it had backed up only 10-GB. With another 300-GB to
go I killed the process and on a hunch reformatted the drive
with reiserfs. The rdiff-backup now completed in a few hours!

I have no idea if rdiff-backup (Python based) uses O_SYNC, but
ext3 seems to have a x100 (at least) performance penalty in
this limited case.

uname -a
Linux train 2.6.25.11-0.1-default #1 SMP 2008-07-13 20:48:28 +0200 x86_64
x86_64 x86_64 GNU/Linux
on a Core 2 Quad box

Regards,
Lew

cat /etc/fstab | grep /home
/dev/sda11 /home ext3
acl,user_xattr 1 2

Debian (etch) configuration
uname -a
Linux water 2.6.21-2-686 #1 SMP Wed Jul 11 03:53:02 UTC 2007 i686 GNU/Linux

cat /etc/fstab | grep /home
/dev/sda1 /home ext3 defaults,errors=remount-ro
0 1


I wrote a small program, that I have compiled with OSYNC defined and not
defined:

#define _GNU_SOURCE

#include <linux/unistd.h>
#include <linux/fs.h>
#include <fcntl.h>

char buf[1024*1024*10];

int main() {
int fd;
int i;

fd = open("aaa", O_RDWR
#ifdef MYOSYNC
| O_SYNC
#endif
| O_CREAT | O_EXCL, 0666);

for (i = 0; i < 160; i++) write(fd, (char*)buf, 64*1024);

close(fd);
}

Results:
OpenSUSE 10.3 buffered about 0.05 seconds
OpenSUSE 10.3 with O_SYNC about 9 seconds (about 200 time slower)

Debian etch buffered about 0.04 seconds
Debian etch with O_SYNC about 0.4 seconds (about 10 times slower)





--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
References