Results 1 to 5 of 5
Hi guys,
I am trying something. I wrote a simple shell program to test something where continuous while loop writes on a file over the nfs. The time taken to ...
- 07-07-2009 #1Just Joined!
- Join Date
- Oct 2008
- Posts
- 11
file writing over nfs very slow
Hi guys,
I am trying something. I wrote a simple shell program to test something where continuous while loop writes on a file over the nfs. The time taken to write "hello" 3000 times take about 10 sec which is not right. Ideally it should take fraction of seconds. If I write on the local disk, it happens instantaneously. "dd" command works fine over the network. Not sure if it is doing the same thing as filw writing with a shell script.
Can someone suggest me where to look at if it is NFS issue?
Thanks,
Abhi.
- 07-09-2009 #2Just Joined!
- Join Date
- Oct 2008
- Posts
- 11
Is there anyone who has any idea about this prob?
- 07-09-2009 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
By default NFS will flush to disc on every remote write. This is time-consuming for small writes such as you are doing in your script. The dd command writes big chunks of data, so it is flushing less fequently on the server end of the connection. The NFS server can be configured to do write-behind caching, but that is not enabled by default. This is done as a reliability feature and was necessary back in the days of not-so-reliable network connections. Over a LAN, enabling write-behind on an NFS server can make a lot of sense from the performance perspective, especially in situations where client processes are doing a lot of small writes.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-09-2009 #4Just Joined!
- Join Date
- Oct 2008
- Posts
- 11
Hi Rubberman,
Thanks for your reply. Can you tell me what do you mean by write-behind caching? Is this something to do with async parameter? If not, which parameter I need to tweak?
- 07-09-2009 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
I think that the async parameter might be correct, though it has been awhile since I did much with NFS, like about 4-5 years...
Time for you to read some documentation I think. Make sure you understand what you are doing before you muck up a working system.
FWIW, before I became an engineer I was a master mechanic. New mechanics would often ask me why I always kept the reference manuals open and on the bench when I would be rebuilding a transmission or engine. My answer was that there are just too many niddling details to keep in ones mind, no matter how much experience you have. This is especially true with computer and networking systems today. Invest in good documentation, keep it handy (and up-to-date), and don't be reticent to refer to it frequently. I have an entire wall of my office that contains over 100 linear feet of documentation and reference works, most of which gets used on some sort of regular basis. Want to program an Adept robot or vision system, I have the docs. Need to clarify some aspect of the ANSI C++ or SQL standard? Got those. Have to understand the details of the XA/XOpen distributed transaction processing standard for 2-phase commits? Got that also. You get the drift.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote