Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NFS slow write speed with sync option
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Xandão
n00b
n00b


Joined: 20 Apr 2005
Posts: 16
Location: São Carlos - SP

PostPosted: Wed Oct 25, 2006 8:09 pm    Post subject: NFS slow write speed with sync option Reply with quote

Hi All

I have a NFS server that exports its /home partition.
When I mount this partition using sync option in client I have a normal read speed but a VERY SLOW write speed like I show below:

Code:

read:
floyd asaraujo # time dd if=testfile of=/dev/null bs=16k count=4096
4096+0 records in
4096+0 records out
67108864 bytes (67 MB) copied, 5,65682 seconds, 11,9 MB/s

real    0m5.665s (FIVE SECONDS... NORMAL)
user    0m0.002s
sys     0m0.115s

write:
floyd asaraujo # time dd if=/dev/zero of=testfile bs=16k count=4096
4096+0 records in
4096+0 records out
67108864 bytes (67 MB) copied, 365,004 seconds, 184 kB/s

real    6m6.412s (SIX MINUTES!!!)
user    0m0.023s
sys     0m1.292s


The fstab entry for this mount is:

Code:
myserver.mynetwork:/home             /home/asaraujo/teste_nfs     nfs     sync,hard,intr,rw,nolock,rsize=32768,wsize=32768,timeo=7,retrans=3    0 0



When I mount the same with async option I have good read and write rates like this:

Code:

read:
floyd asaraujo # time dd if=testfile of=/dev/null bs=16k count=4096
4096+0 records in
4096+0 records out
67108864 bytes (67 MB) copied, 5,6147 seconds, 12,0 MB/s

real    0m5.621s
user    0m0.004s
sys     0m0.109s

write:
floyd asaraujo # time dd if=/dev/zero of=testfile bs=16k count=4096
4096+0 records in
4096+0 records out
67108864 bytes (67 MB) copied, 5,92363 seconds, 11,3 MB/s

real    0m7.339s
user    0m0.001s
sys     0m0.191s


In this case, the fstab entry is:

Code:
myserver.mynetwork:/home             /home/asaraujo/teste_nfs     nfs     async,hard,intr,rw,nolock,rsize=32768,wsize=32768,timeo=7,retrans=3    0 0


The only change is sync by async.

Is this a normal behavior of NFS??? When I use sync I have extreme confidence but a great loss of speed???? Or probably is something wrong????

If I use async instead of sync it can be considered that my system is much less confident than when I use sync or am I being paranoic???

Thanks!!!
_________________
[]s
Xandão
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Thu Oct 26, 2006 7:34 am    Post subject: Reply with quote

Though perhaps not quite to the extent described, I would expect such behavior.

Setting the sync option on a filesystem is supposed to keep the data present in the filesystem synchronized with the data cached by the kernel regarding that filesystem. Considering that NFS is, obviously, using a network connection (even if it is accessed over a loopback device) using the sync option when mounting an NFS share would be expected to introduce significant latency in all write operations as buffering is largely (at the filesystem level) removed from the filesystem.

Note that mounting local storage with the sync option active also causes increased write latency though it is typically less obvious.
Back to top
View user's profile Send private message
Xandão
n00b
n00b


Joined: 20 Apr 2005
Posts: 16
Location: São Carlos - SP

PostPosted: Thu Oct 26, 2006 11:27 am    Post subject: Reply with quote

Thanks desultory

I´d expect an increase of latency with sync option, but not with that magnitude (6 seconds to 6 minutes to write the same amount of data). This could be considered "normal"??? If yes, the use of sync option makes impracticable its use in most of current network applications, in my opinion.
If I use async option, I can consider my system unsafe or, like I said initially, am I being paranoic?
Thanks!
_________________
[]s
Xandão
Back to top
View user's profile Send private message
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 942
Location: Queensland

PostPosted: Thu Jun 07, 2007 3:27 am    Post subject: Belated reply, HTH Reply with quote

Adding
Code:
rsize=1024,wsize=1024
to the /etc/fstab mount options solved it for me. I think that the problem is if your packets exceed the MTU of your network device.
_________________
Michael Mounteney
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum