All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Clayton <andrew@digital-domain.net>
Cc: John Stoffel <john@stoffel.org>,
	Justin Piszcz <jpiszcz@lucidpixels.com>,
	David Rees <drees76@gmail.com>, Andrew Clayton <andrew@pccl.info>,
	linux-raid@vger.kernel.org
Subject: Re: RAID 5 performance issue.
Date: Sun, 7 Oct 2007 18:22:08 +0100	[thread overview]
Message-ID: <20071007182208.2278e742@alpha.digital-domain.net> (raw)
In-Reply-To: <18182.42211.405326.261727@stoffel.org>

On Fri, 5 Oct 2007 16:56:03 -0400, John Stoffel wrote:

> Can you start a 'vmstat 1' in one window, then start whatever you do
> to get crappy performance.  That would be interesting to see.

In trying to find something simple that can show the problem I'm
seeing. I think I may have found the culprit.

Just testing on my machine at home, I made this simple program.

/* fslattest.c */

#define _GNU_SOURCE

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>


int main(int argc, char *argv[])
{
        char file[255];

        if (argc < 2) {
                printf("Usage: fslattest file\n");
                exit(1);
        }

        strncpy(file, argv[1], 254);
        printf("Opening %s\n", file);

        while (1) {
                int testfd = open(file, 
                        O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600);
                close(testfd);
                unlink(file);
                sleep(1);
        }

        exit(0);
}


If I run this program under strace in my home directory (XFS file system
on a (new) disk (no raid involved) all to its own.like

$ strace -T -e open ./fslattest test

It doesn't looks too bad.

open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.005043>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.000212>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.016844>

If I then start up a dd in the same place.

$ dd if=/dev/zero of=bigfile bs=1M count=500

Then I see the problem I'm seeing at work.

open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <2.000348>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <1.594441>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <2.224636>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <1.074615>

Doing the same on my other disk which is Ext3 and contains the root fs,
it doesn't ever stutter

open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.015423>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.000092>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.000093>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.000088>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.000103>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.000096>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.000094>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.000114>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.000091>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.000274>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0600) = 3 <0.000107>


Somewhere in there was the dd, but you can't tell.

I've found if I mount the XFS filesystem with nobarrier, the
latency is reduced to about 0.5 seconds with occasional spikes > 1
second.

When doing this on the raid array.

open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3 <0.009164>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3 <0.000071>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3 <0.002667>

dd kicks in

open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3 <11.580238>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3 <3.222294>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3 <0.888863>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3 <4.297978>

dd finishes 

open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3 <0.000199>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3 <0.013413>
open("test", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3 <0.025134>


I guess I should take this to the XFS folks.

> John


Cheers,

Andrew

  reply	other threads:[~2007-10-07 17:22 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-03  9:53 RAID 5 performance issue Andrew Clayton
2007-10-03 16:43 ` Justin Piszcz
2007-10-03 16:48   ` Justin Piszcz
2007-10-03 20:10     ` Andrew Clayton
2007-10-03 20:16       ` Justin Piszcz
2007-10-06 12:30       ` Justin Piszcz
2007-10-06 16:05         ` Justin Piszcz
2007-10-03 20:19   ` Andrew Clayton
2007-10-03 20:35     ` Justin Piszcz
2007-10-03 20:46       ` Andrew Clayton
2007-10-03 20:36     ` David Rees
2007-10-03 20:48       ` Andrew Clayton
2007-10-04 14:08       ` Andrew Clayton
2007-10-04 14:09         ` Justin Piszcz
2007-10-04 14:10           ` Justin Piszcz
2007-10-04 14:44             ` Andrew Clayton
2007-10-04 16:20               ` Justin Piszcz
2007-10-04 18:26                 ` Andrew Clayton
2007-10-05 10:25                   ` Justin Piszcz
2007-10-05 10:57                     ` Andrew Clayton
2007-10-05 11:08                       ` Justin Piszcz
2007-10-05 12:53                         ` Andrew Clayton
2007-10-05 13:18                           ` Justin Piszcz
2007-10-05 13:30                           ` Andrew Clayton
2007-10-05 14:07                             ` Justin Piszcz
2007-10-05 14:32                               ` Andrew Clayton
2007-10-05 16:10                               ` Andrew Clayton
2007-10-05 16:16                                 ` Justin Piszcz
2007-10-05 19:33                                   ` Andrew Clayton
2007-10-05 18:58                                 ` Richard Scobie
2007-10-05 19:02                                   ` Justin Piszcz
2007-10-05 19:02               ` John Stoffel
2007-10-05 19:42                 ` Andrew Clayton
2007-10-05 20:56                   ` John Stoffel
2007-10-07 17:22                     ` Andrew Clayton [this message]
2007-10-11 17:06                       ` Bill Davidsen
2007-10-11 18:07                         ` Andrew Clayton
2007-10-11 23:43                           ` Justin Piszcz
2007-10-04 14:36           ` Andrew Clayton
2007-10-04 14:39             ` Justin Piszcz
2007-10-04 15:03               ` Andrew Clayton
2007-10-04 16:19                 ` Justin Piszcz
2007-10-04 19:01                   ` Andrew Clayton
2007-10-04 16:46                 ` Steve Cousins
2007-10-04 17:06                   ` Steve Cousins
2007-10-04 19:06                   ` Andrew Clayton
2007-10-05 10:20                     ` Justin Piszcz
2007-10-04 14:39             ` Justin Piszcz
2007-10-03 17:53 ` Goswin von Brederlow
2007-10-03 20:20   ` Andrew Clayton
2007-10-03 20:48     ` Richard Scobie
2007-10-05 20:25 ` Brendan Conoboy
2007-10-06  0:38   ` Dean S. Messing
2007-10-06  8:18     ` Justin Piszcz
2007-10-08  1:40       ` Dean S. Messing
2007-10-08  8:44         ` Justin Piszcz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071007182208.2278e742@alpha.digital-domain.net \
    --to=andrew@digital-domain.net \
    --cc=andrew@pccl.info \
    --cc=drees76@gmail.com \
    --cc=john@stoffel.org \
    --cc=jpiszcz@lucidpixels.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.