Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

slow NFS = slow scripts (any way to make things faster?)

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> SFU / Interix - Getting Started >> slow NFS = slow scripts (any way to make things faster?) Page: [1]
Login
Message << Older Topic   Newer Topic >>
slow NFS = slow scripts (any way to make things faster?) - May 23, '06, 4:54:10 PM   
woehlkmp

 

Posts: 102
Status: offline
I am trying to run some scripts off of a very slow NFS connection, and simple things like the example below take 10(!) seconds to run; more complex things take longer (minutes, for something that takes less than a second to run locally). Is this an inherent problem with bash, or does someone know of a way (that they can explain simply) to tune the NFS client to perform better than this?

:

if [ $VERBOSE ] ; then
  set -x
fi

case `uname` in
        CYGWIN*|Interix*)
                # fancy flags not supported
                echo windows
                exit 0
                ;;
esac
Post #: 1
RE: slow NFS = slow scripts (any way to make things fas... - May 23, '06, 5:22:06 PM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
The example look like standard sh script. So you can try running it
with sh or ksh to see what happens.

I would expect at the begining that things might be slow if a stat() is done.
But that should be a "fixed cost" -- not getting bigger as the script gets bigger.

Ah, here may be the problem: what is your PATH set to? Does your PATH have the NFS
directory before /bin and /usr/local/bin ?
If so then both that will be the cause.
Two soln's: 1) Get the NFS path later in PATH (or not there at all).
2) Specify _all_ non-buildins with full paths ("/bin/uname" not just "uname").

When there is a non-buildin to run bash (and ksh too, but not csh)
search through all of the directories in PATH until an executable with the name is found.
There is no cacheing (csh caches though), so it must do it everytime.

(in reply to woehlkmp)
Post #: 2
RE: slow NFS = slow scripts (any way to make things fas... - May 23, '06, 6:12:11 PM   
woehlkmp

 

Posts: 102
Status: offline
Hi, Rodney,

Unfortunately, I need NFS paths to be very high in the order because the NFS path needs to override things that might be in /bin, etc. However, I don't see why this should take 10 seconds; there is only one command ('uname') in that script that should even trigger a path lookup!

$ time which uname
/usr/bin/uname

real    0m0.031s
user    0m0.015s
sys     0m0.000s

...And in fact...
$ echo $PATH
/usr/gnu/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:<nfs path>:<nfs path>:<nfs path>:[snip]
...so that isn't the problem anyway?

I was hoping there might be a way to make the NFS client do some form of caching...

(in reply to Rodney)
Post #: 3
RE: slow NFS = slow scripts (any way to make things fas... - May 23, '06, 7:44:41 PM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
From your PATH it doesn't look like PATH is a problem.
I'm not sure about NFS client cacheing.

(in reply to woehlkmp)
Post #: 4
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> SFU / Interix - Getting Started >> slow NFS = slow scripts (any way to make things faster?) Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.047