Ma Sa wrote: > I have an issue with nfs and listing a large amount of files that I am > wondering if I can solve with ruby. I know that ruby has better > performance in some instances than a bash shell script so I am wondering > if anyone has experience or some examples of how this might work... > > I have a directory with a large amount of files that is mounted over > nfs. The network is gigabit and so are the nic's. The servers are very > high end so the hardware / network performance is not the bottleneck. > However, sometimes it can take a very long time to list out the files > contained within a directory. > > I will do an ls and it might take 5 minutes to retrieve a response. Do you use any external name service (LDAP/NIS/...)? If so your problem could be uid number to user name resolution taking too much time on so many files. You can check this by running 'ls -n', if it's much faster you'll have to either: - speed up name resolution (use a cache like nscd - which should be installed or readily available on any Linux distribution - for example). - don't resolve names when you don't need them. Lionel