LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-13-2007, 05:34 AM   #1
jagb
LQ Newbie
 
Registered: Aug 2007
Posts: 1

Rep: Reputation: 0
NFS slow when reading newly created files


Hi,

Thanks in advance for any help.

UPDATE: I've experimented a little, and can now better summarize the problem:
I have a NFS server. Any file that has been created on the NFS server since the (hard disk) data partition on the NFS server was last mounted will be read very slowly by any client connecting to the NFS server.

My full post, explaining how I cam to this conclusion, is as follows:

I recently set up a NFS server (gentoo; 2.6.20; AMD64 3000) at home. Between the server and my desktop (gentoo; 2.6.22; AMD64 X2 3800) I have a dedicated gigabit ethernet connection. For the most part, it works well -- I can read and write to the NFS server at ~30MB/sec. However, I have discovered a strange issue, which is that if I try to read from a file that has been recently created on the server, the transfer rate drops to ~3MB/sec.

It doesn't seem to matter whether the file is created on the server through through an NFS write, or some other means (i.e. i can create a new file on the server by copying a file from my desktop to the server via NFS, but I also tried ssh-ing into my NFS server, and created a file by duplicating another pre-existing file). In either case, when I try to read the new file, I get very slow read times. It doesn't matter if I unmount the NFS share and then re-mount it; it's still slow.

I thought that maybe the new files were slower because perhaps they were more fragmented than the already existing files; I ruled this out by rebooting the NFS server. Once I reboot the server, I will actually be able to get fast transfer times on the "new" files.

I thought that maybe there was an issue that the new files weren't yet physically written to the disk, and that was the problem. This too seems suspect, because if I use sftp to retrieve one of the "new" files from the NFS box, I get transfer rates of about 30 MB/sec.

In summary, here is a sequence of commands and their results that I tried that emphasizes the problem:

from desktop, ssh into server, then on the server:
cp old_big_file new_big_file
(size of file ~200MB)
then wait a minute or two to let the file be physically written to disk
then, from desktop, sftp into server, get old_big_file
result: ~30 MB/sec
repeat, but for new_big_file
result: ~30 MB/sec --good!
then on desktop:
dd if=/nfs_directory/old_big_file of=/dev/null bs=16k
result: ~30 MB/sec
dd if=/nfs_directory/new_big_file of=/dev/null bs=16k
result: ~3 MB/sec !!!!
umount /nfs_directory
mount /nfs_directory
repeat dd commands -- same results
umount /nfs_directory
mount /nfs_directory
this time, use cp instead of dd -- same results
umount /nfs_directory
<reboot server>
mount /nfs_directory
repeat dd commands
result: fast transfer rates!

One last thing: I also tried the entire command sequence shown above, except replacing <reboot server> with <ssh into server and restart NFS daemon>. That did not solve the problem.

I am new to NFS, and am very confused. Any help at all would be most appreciated. Thank you very much!

UPDATE:
I have tried replacing <reboot server> in the above list of commands with two other actions, to see if they have an effect. The first was <Let the computer sit overnight> -- this did not help. The second was:
ssh into the server
stop nfs (on the server)
unmount the data partition (on the server)
restart nfs (on the server)
This actually worked!

Last edited by jagb; 08-13-2007 at 12:43 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP, newly created files permission georgiozoze Linux - Newbie 2 09-16-2006 08:47 PM
saving newly created files using ftp on a network linuxhippy Slackware 5 05-06-2005 03:54 AM
permissions for newly created files dialbat Linux - General 2 10-04-2004 02:58 PM
Deleting the newly created files keeping the existing icorsi Linux - Newbie 2 10-07-2001 11:16 AM
Deleting newly created files keeping the existing ones icorsi Linux - General 0 10-07-2001 12:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration