public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Re: why nfs server delay 10ms in nfsd_write()?
@ 2005-05-20 10:44 steve
  2005-05-20 13:05 ` Peter Staubach
  0 siblings, 1 reply; 11+ messages in thread
From: steve @ 2005-05-20 10:44 UTC (permalink / raw)
  To: Peter Staubach, Lee Revell
  Cc: linux-kernel@vger.kernel.org, zhangtiger@huawei.com

Hi Peter,
My envionment looks like that:

NFS Server:Suse9 Enterprise 
NFS Client:Redhat AS3.0(kernel 2.4.21) 

I made a ramdisk and export it with nfs
Server and Client are connected with 1000Mbps

mount the ramdisk on the client with parameters: -t nfs -o rw,noac

then test with iometer and the parameters are: 
Outstanding IO is 32, transfer request size is 512, sequential write
the result is about 300KB/s, iops is about 600

with dd test i find the delay most cost at the server.

i agree with Avi that "if the NFS client has no (or low) concurrency, then write gathering would
reduce preformance"


Regards! 				
Steve
2005-05-20

======= 2005-05-19 10:10:00 =======

>Lee Revell wrote:
>
>>On Thu, 2005-05-19 at 08:53 -0400, Peter Staubach wrote:
>>  
>>
>>>There are certainly many others way to get gathering, without adding an
>>>artificial delay.  There are already delay slots built into the code 
>>>which could
>>>be used to trigger the gathering, so with a little bit different 
>>>architecture, the
>>>performance increases could be achieved.
>>>
>>>Some implementations actually do write gathering with NFSv3, even.  Is
>>>this interesting enough to play with?  I suspect that just doing the 
>>>work for
>>>NFSv2 is not...
>>>    
>>>
>>
>>Also, how do you explain the big performance hit that steve observed?
>>Write gathering is supposed to help performance, but it's a big loss on
>>his test...
>>
>
>Well, a little bit more information about what he is doing would be 
>helpful.  I'd
>like to better understand the environment and what the traffic from the 
>client
>looks like.
>
>Write gathering is not a panacea for all of the ills caused by the NFSv2 
>WRITE
>stable storage requirements.  In fact, if done wrong, it can cause 
>performance
>regressions, such as those being noticed by Steve.
>
>--
>
>I implemented the write gathering used in Solaris and experimented with
>several (many?) different approachs.  Adding a delay in order to allow
>subsequent WRITE requests to arrive seems like a good thing, but can
>end up just adding latency to the entire process if not done right.
>
>A suggestion might be to use the delay caused by the nfsd_sync() call
>and synchronize other WRITE requests around that.  The delay caused by
>doing real i/o to the storage subsystem should allow write gathering to
>take place, assuming that the client is generating concurrent WRITE
>requests.
>
>       ps






^ permalink raw reply	[flat|nested] 11+ messages in thread
* why nfs server delay 10ms in nfsd_write()?
@ 2005-05-19  2:46 steve
  2005-05-19  3:08 ` Trond Myklebust
  2005-05-19  3:13 ` Lee Revell
  0 siblings, 2 replies; 11+ messages in thread
From: steve @ 2005-05-19  2:46 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org; +Cc: zhangtiger@huawei.com, lingxiang@huawei.com

Hi all,
when i build nfs server with linux 2.6.9, i found nfs write performance is very low, and with 
tcpdump, i found the time to process write is very long, please refer as follows:

14:59:22.844977 IP  192.168.0.1.3376789825 >  linux.site.nfs: 660 write [|nfs]
14:59:22.855134 IP  linux.site.nfs >  192.168.0.1.3376789825: reply ok 136 write POST: [|nfs]

the write operation cost nearly 10ms, so i look up the source code and find the following code 
in nfsd_write():

{
..
if (atomic_read(&inode-> i_writecount) >  1
    || (last_ino == inode-> i_ino && last_dev == inode-> i_sb-> s_dev)) {
dprintk("nfsd: write defer %d\n", current-> pid);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((HZ+99)/100);
dprintk("nfsd: write resume %d\n", current-> pid);
}
..
}

so it will sleep for 10ms if the condition matches.

i have 2 questions:
1.i don't know why do we have to sleep for 10 ms, why not do sync immediately?
2.what will happen if we don't sleep for 10ms?
when i delete these codes, i get a good result, and the write performace improved from 300KB/s to 18MB/s

Regards!  
Steve
2005-05-19



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-05-20 13:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-20 10:44 Re: why nfs server delay 10ms in nfsd_write()? steve
2005-05-20 13:05 ` Peter Staubach
  -- strict thread matches above, loose matches on Subject: below --
2005-05-19  2:46 steve
2005-05-19  3:08 ` Trond Myklebust
2005-05-19  3:13 ` Lee Revell
2005-05-19 12:53   ` Peter Staubach
2005-05-19 13:26     ` Trond Myklebust
2005-05-19 13:41       ` Peter Staubach
2005-05-19 13:59     ` Lee Revell
2005-05-19 14:10       ` Peter Staubach
2005-05-19 14:13       ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox