LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 01-24-2012, 12:19 PM   #1
joseph85750
LQ Newbie
 
Registered: Dec 2010
Location: Tucson, AZ
Distribution: CentOS, Slackware, PlopLinux, Linux Mint
Posts: 8

Rep: Reputation: 0
NFS slow when filesystems get large, unless..


I've been troubleshooting some NFS latency issues, and have found some patterns I'd like to understand.

1) If I have a linux NFS server, sharing out its own internal disks, NFS gets very slow when the filesystem starts getting large. The shared filesystem consists of a few thousand directories, with a few hundred files in each directory. A 'ls' in the main shared directory can take up to 25 seconds to return the list. It will hang for the entire 25 seconds, then return the entire list. After this first listing, I can run the command again and get the results instantly.

2) If I have a linux NFS server, with an ~external~ SCSI RAID which is mounted and shared, I see very little latency even with thousands of directories/files.


On the system console, not through NFS, I never see latency for either 1 or 2 above. I only see latency when trying to view the directory contents of scenario #1 via an NFS mount.

Does this have something to do with the linux server itself-- unable to process the local disk contents fast enough? Where the external RAID has its own hardware doing all that hard work for the linux server?
Even if that were the case, both are very responsive locally. It only gets painfully slow over the NFS share.
What could be different, network-wise, causing 1 to be so much slower than 2?

Any help would be great.

Thanks!
 
Old 01-28-2012, 09:32 AM   #2
catworld
Member
 
Registered: Nov 2004
Location: Horseheads, New York
Distribution: Mandriva 2010.1 / KDE 4.5.2, Slax, Knoppix, Backtrack & etc...
Posts: 198

Rep: Reputation: 36
The difference in the I/O speed is the cause. As it's name implies, NFS is a file system. An access requires the disk read and the translation of the file system, (contents) eg ext3 to NFS. To my knowledge the NFS 'version' (for want of a better word) is not cached on the server, it must be regenerated every time a call for the FS comes in. (it may be resident in RAM for a time, but I don't believe the NFS protocol intentionally caches this info)

The clients should cache a modicum of the remote file system locally. (at least windows clients)

I don't believe there's much you can do to speed this up. I know with samba there are page size settings and such that can speed up access. I'm not as familiar with NFS, but it might be worth looking into the configs. If there's some way to either limit the depth of information NFS fetches with a disk read or to increase the size of packets it presents it might help.

Using a more network-friendly file system on the storage might help as well. If the SATA/PATA hard drives have any of the operating system on them there's also going to be competition for read access that'll slow things down. If you have more than one drive involved RAID and/or using LVM could speed it up a bit.

It sounds like you have enough data and enough users to look into a more efficient file system (physically) on the storage media.

Otherwise, sorry there's no easy fix. This is a common complaint with Linux file servers, unfortunately, with both samba and NFS.

BTW you might be a good candidate for some sort of stand-alone network attached storage system. Those things are getting pretty cheap. NAS eliminates the full blown OS required to operate a server. Another move might be to update network hardware to gigabit, though this would be an expensive proposition.
 
Old 04-20-2012, 03:52 PM   #3
joseph85750
LQ Newbie
 
Registered: Dec 2010
Location: Tucson, AZ
Distribution: CentOS, Slackware, PlopLinux, Linux Mint
Posts: 8

Original Poster
Rep: Reputation: 0
catworld:
Thanks for the reply!
How can this explain why the NFS is fast when the disks being shared are on an external RAID/chassis attached to the NFS server? Wouldn't the client still suffer from the same cache issue?
 
  


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
ext3 performance -- very large number of files, large filesystems, etc. td3201 Linux - Server 5 11-25-2008 09:28 AM
LXer: Ext3 for large filesystems and Time for ext4? LXer Syndicated Linux News 0 06-24-2006 06:21 AM
Slow or failed copy of large files to NFS david.skinner Linux - Networking 1 06-11-2006 05:22 AM
no NFS in /proc/filesystems how to add NFS? BobNz Linux - Software 4 07-08-2004 02:40 AM
NFS - not in /proc/filesystems tge Linux - Networking 6 03-28-2002 06:09 PM


All times are GMT -5. The time now is 09:30 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration