scsi vs ide performance on fsync's

Jeremy Hansen
2001-03-02T17:43:08Z

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2599 bytes --]

We're doing some mysql benchmarking. For some reason it seems that ide
drives are currently beating a scsi raid array and it seems to be related
to fsync's. Bonnie stats show the scsi array to blow away ide as
expected, but mysql tests still have the idea beating on plain insert
speeds. Can anyone explain how this is possible, or perhaps explain how
our testing may be flawed?

Here's the bonnie stats:

IDE Drive:

Version 1.00g ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
jeremy 300M 9026 94 17524 12 8173 9 7269 83 23678 7 102.9 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 469 98 1476 98 16855 89 459 98 7132 99 688 25

SCSI Array:

Version 1.00g ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
orville 300M 8433 100 134143 99 127982 99 8016 100 374457 99 1583.4 6
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 503 13 +++++ +++ 538 13 490 13 +++++ +++ 428 11

So...obviously from bonnie stats, the scsi array blows away the ide...but
using the attached c program, here's what we get for fsync stats using the
little c program I've attached:

IDE Drive:

jeremy:~# time ./xlog file.out fsync

real 0m1.850s
user 0m0.000s
sys 0m0.220s

SCSI Array:

[root@orville mysql_data]# time /root/xlog file.out fsync

real 0m23.586s
user 0m0.010s
sys 0m0.110s

I would appreciate any help understand what I'm seeing here and any
suggestions on how to improve the performance.

The SCSI adapter on the raid array is an Adaptec 39160, the raid
controller is a CMD-7040. Kernel 2.4.0 using XFS for the filesystem on
the raid array, kernel 2.2.18 on ext2 on the IDE drive. The filesystem is
not the problem, as I get almost the exact same results running this on
ext2 on the raid array.

Thanks
-jeremy

--
this is my sig.

[-- Attachment #2: Type: TEXT/PLAIN, Size: 792 bytes --]

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

struct Entry
{
int count;
char string[50];
};

int main(int argc, char **argv)
{
int fd;
struct Entry *trans;
int x;

if((fd = creat(argv[1], 0666)) == -1)
{
printf("Could not open file %s\n", argv[1]);
return 1;
}

for(x=0; x < 2000; ++x)
{
trans = malloc(sizeof(struct Entry));
trans->count = x;
strcpy(trans->string, "Blah Blah Blah Blah Blah Blah Blah");

if(strcmp(argv[2],"fsync")== 0)
{
write(fd, (char *)trans, sizeof(struct Entry));

if(fdatasync(fd) != 0)
{
perror("Error");
}

}
else
{
write(fd, (char *)trans, sizeof(struct Entry));
}

free(trans);

}
close(fd);

}