home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / clients / 256 next >
Encoding:
Text File  |  1993-01-04  |  15.7 KB  |  409 lines

  1. Newsgroups: comp.client-server
  2. Path: sparky!uunet!wupost!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!gatech!udel!rochester!rocksanne!news
  3. From: weltman@adoc.xerox.com (Rob Weltman)
  4. Subject: NFS slowness
  5. Message-ID: <1993Jan4.175456.20845@spectrum.xerox.com>
  6. Keywords: NFS
  7. Sender: news@spectrum.xerox.com
  8. Reply-To: weltman@adoc.xerox.com
  9. Organization: Xerox AODS, Palo Alto, CA
  10. Date: Mon, 4 Jan 1993 17:54:56 GMT
  11. Lines: 396
  12.  
  13.   I received a number of informative responses to my question
  14. about why large NFS writes are so slow, and a few suggestions on
  15. how to improve performance, and where to look for more info on
  16. tuning NFS. The following are all the responses (hope that's OK
  17. to post; everybody responded directly to me, so people on the
  18. net can't really know what's been communicated).
  19.  
  20. Rob
  21.  
  22.  
  23. ---------------------------------------------
  24. | Rob Weltman                               |
  25. | Xerox                                     |
  26. | 3400 Hillview Ave, building 5             |
  27. | Palo Alto, CA  94303                      |
  28. |                                           |
  29. | weltman@adoc.xerox.com                    |
  30. | phone (415)-813-7477   fax (415)-813-6792 |
  31. ---------------------------------------------
  32.  
  33.  
  34.  
  35. Responses to question "Why is NFS so slow for large file writes"
  36. ----------------------------------------------------------------
  37.  
  38. From auspex.com!guy Wed Dec 30 17:47:59 1992
  39. From:    guy@auspex.com (Guy Harris)
  40. To:    weltman@adoc.xerox.com
  41. Subject: Re: NFS and RPC
  42. Content-Length: 720
  43. X-Lines: 15
  44. Status: RO
  45.  
  46. >What was surprising was that it was so slow to just do a
  47. >large write
  48.  
  49. You may have said the magic word - "write".
  50.  
  51. Did the SPARCstation 2 have a Prestoserve board on it?  If not, then
  52. every write request that the client sent over the wire to the server
  53. would block the process doing the write (which is *not* necessarily the
  54. process doing the writes to the file; writes may be handed off to a
  55. "biod" process) until the data being written made it out to disk.
  56.  
  57. The Prestoserve board, plus its supporting software, "pretends" that a
  58. write to disk completes when the data being written to disk has been
  59. copied into the Prestoserve board's battery-backed-up static RAM.  Data
  60. written there gets written out to disk later.
  61.  
  62. ----------------------------------------------------------------
  63.  
  64. From auspex.com!guy Wed Dec 30 18:05:01 1992
  65. From:    guy@auspex.com (Guy Harris)
  66. To:    weltman@adoc.xerox.com
  67. Subject: Re: NFS and RPC
  68. Content-Length: 749
  69. X-Lines: 18
  70. Status: RO
  71.  
  72. >   Thanks for your comment on the NFS server process blocking
  73. > during a write.
  74.  
  75. Well, yes, the server process does block, although there are probably 7
  76. or so more server processes ready to serve other request.
  77.  
  78. My main point, though, was that some process on the NFS *client* would
  79. block.
  80.  
  81. >   If the client did a large binary write() - say 2 MB - would
  82. > that count as one transaction that would block until completion,
  83. > or does the OS or NFS break it up into a number of smaller
  84. > buffers, and block/resume for each one?
  85.  
  86. NFS writes are generally limited to about 8K, so a 2MB write would be
  87. broken into 256 individual NFS write operations, and some process on the
  88. client would block and resume for each one (not necessarily the same
  89. process).
  90.  
  91. ----------------------------------------------------------------
  92.  
  93. From rus.uni-stuttgart.de!Kurt.Jaeger Thu Dec 31 07:48:55 1992
  94. From:    Kurt.Jaeger@rus.uni-stuttgart.de (Kurt Jaeger aka PI)
  95. To:    weltman@adoc.xerox.com
  96. Subject: Re: NFS and RPC
  97. Newsgroups: comp.client-server
  98. Status: RO
  99. Content-Length: 525
  100. X-Lines: 15
  101.  
  102. In article <1992Dec30.155939.13344@spectrum.xerox.com> you write:
  103. >  - have a small server process on the remote machine open a file there
  104. >  - transfer the file to the remote process with RPC or socket
  105. >  - have the remote process write to the file
  106.  
  107. This is what AFS does.
  108.  
  109.         So short, PI
  110.  
  111. -- 
  112. PI at the User Help Desk Comp.Center U of Stuttgart, FRG      28 Years to go ! 
  113. SMTP: pi@rus.uni-stuttgart.de    Phone: +49 711 685-4828
  114. X.400: pi@rus.uni-stuttgart.dbp.de
  115. Bitnet: zrzr0111@ds0rus54.bitnet       (aka Kurt Jaeger)
  116.  
  117.  
  118. ----------------------------------------------------------------
  119.  
  120. From logos.ucs.indiana.edu!hughes Thu Dec 31 08:37:58 1992
  121. From:    larry hughes <hughes@logos.ucs.indiana.edu>
  122. To:    weltman@adoc.xerox.com
  123. Subject: Re: NFS and RPC
  124. Status: RO
  125. Content-Length: 1037
  126. X-Lines: 20
  127.  
  128. NFS is really "Not a File System".  :-)
  129.  
  130. Seriously, it's somewhat of a hack.  You _can_ get much better
  131. throughput, however, with a "black box" NFS system.  Running
  132. NFS on a general purpose Unix box is functional but not optimal.
  133.  
  134. Check out Auspex.  They make high-end NFS dedicated servers that
  135. are maybe an order of magnitude faster than a Sparc running NFS.
  136. They utilize multiprocessor technology, and capture the NFS packets
  137. at a very low layer (right above data link) so they can be farmed
  138. out to the I/O processors.  By contrast, a typical Unix-based
  139. NFS server processes the NFS requests way up at the application
  140. layer (nfsd is just a user process after all).
  141.  
  142.  //==================================================================\\
  143. ||      Larry J. Hughes, Jr.       |        hughes@indiana.edu        || 
  144. ||       Indiana University        | "The person who knows everything ||
  145. ||  University Computing Services  |        has a lot to learn."      ||
  146.  \\===================================================================//
  147.   
  148.  
  149. ----------------------------------------------------------------
  150.  
  151. From uu5.psi.com!shearson!shearson.com!fgreco Thu Dec 31 09:12:12 1992
  152. From:    fgreco@shearson.com (Frank Greco)
  153. To:    weltman@adoc.xerox.com
  154. Subject: Re: NFS and RPC
  155. Newsgroups: comp.client-server
  156. Status: RO
  157. Content-Length: 1611
  158. X-Lines: 44
  159.  
  160. In article <1992Dec30.155939.13344@spectrum.xerox.com> you write:
  161. >
  162. >Why is NFS so slow?
  163. >-------------------
  164.  
  165.     The question should really read "Why are NFS-writes so slow?".
  166.  
  167.     NFS-reads aren't really that bad.
  168.  
  169.     The "problem" with NFS-writes is that they are synchronous;
  170.     the write must be completed on the server before write() can
  171.     return to your workstation.
  172.  
  173.     There are several well-known ways of speeding this up.
  174.  
  175.     * Make sure NFS is tuned properly for your network/server.
  176.     See Hal Stern's book for great tips.
  177.  
  178.     * Get a Legato Prestoserver board which "fakes out" NFS
  179.     into thinking the write() was completed and buffers the
  180.     writes for later completion.  Fairly cheap.
  181.  
  182.     * Get an NFS-machine like an Auspex NFS server.  Fairly
  183.     expensive and really cannot be used as a CPU-server.
  184.  
  185.     * Use other mechanisms of network files (rcp/your own
  186.     fileserver), but note that one benefit of NFS is that it uses
  187.     XDR, which you should duplicate.  Others include ONC+ (Solaris
  188.     2.1) and AFS (which caches files locally).
  189.  
  190.     * There's another product called eNFS that apparently increases
  191.     NFS performance, but I really don't know that much about it.
  192.  
  193.     Hope this helps,
  194.  
  195.     Frank G.
  196. -- 
  197. +-On Assignment at: Lehman Brothers-+-Office: Mercury Technologies, Inc.-+
  198. | World Financial Center, 11th Floor| PO Box 529                         |
  199. | New York City, NY 10285 Desk: 1515| Fanwood, NJ 07023                  |
  200. | email: fgreco@shearson.com        | email: fgreco@mercury.com          |
  201. + voice: (212)-640-9159-------------+ voice: (908)-754-7820--------------+
  202.  
  203. My comments reflect my own opinions, not my clients'.
  204.  
  205.  
  206. ----------------------------------------------------------------
  207.  
  208. From iscp.bellcore.com!jona Sun Jan  3 10:54:36 1993
  209. To:    weltman@adoc.xerox.com (Rob Weltman)
  210. Subject: NFS
  211. From:    "Jon Alperin" <jona@iscp.bellcore.com>
  212. Content-Length: 307
  213. X-Lines: 11
  214. Status: RO
  215.  
  216.  
  217. Rob,
  218.  
  219.  it sounds like you have implemented caching, whereby the file is
  220. transferred to a local machine. The only problem you will have is
  221. maintaing the lock on the remote file so that some other user
  222. doesn't  modify it underneath you. This is what the Andrew File
  223. System (AFS) did.
  224.  
  225.  jon alperin
  226. Bellcore.
  227.  
  228.  
  229. ----------------------------------------------------------------
  230.  
  231. From uunet.uu.net!imatron!raven1!jmm Thu Dec 31 08:10:55 1992
  232. From:    imatron!raven1!jmm@uunet.uu.net (Jon Meyers)
  233. To:    guy@auspex.com
  234. Subject: NFS and RPC discussion.
  235. Cc:    weltman@parc.xerox.com, jmm@uunet.uu.net
  236. Status: RO
  237. Content-Length: 1556
  238. X-Lines: 33
  239.  
  240. I've noted the E-mail conversation you've been having with Rob Weltman at Xerox
  241. Parc regarding NFS and RPC (Rob's been cc'ing me).  I'm actually the (not so)
  242. mysterious friend of Rob's who did the benchmarks he initially mentioned.
  243.  
  244. First off, I'd like to say thanks for the cogent comments you've been making.
  245. I've found it very interesting to see people at various companies wrangling
  246. with the NFS transfer issue.  Universally, writing to a remote-mounted file
  247. has caused them performance headaches.  The discussion you and Rob have been
  248. having has pretty much supported my thought that there's something in NFS 
  249. (and SunOS?) that really should be improved.
  250.  
  251. Out of curiousity, where did you come upon your information on how NFS is working
  252. internally?  A reference on the topic would be very useful.  Thanks in advance.
  253.  
  254. Another question - which company provides Prestoserve boards?  Sounds like the
  255. board is designed to fit neatly into one niche, but I'd like to go get more
  256. information.
  257.  
  258. As Rob mentioned, my solution to the NFS issue was to provide servers on the
  259. Sparcs I wanted to write to, and to let the clients send data to them using
  260. RPC's utilizing TCP/IP.  Of course, the servers do more than just write - we
  261. had the need here to have them do several file and other operations.  Anyway,
  262. the performance looks good so far - within the expectations of ethernet.
  263.  
  264. So, thanks again for the information you've provided!  Thanks in advance also
  265. for any more thoughts you might have.
  266.  
  267.  
  268. Happy New Year,
  269.  
  270. Jonathan Meyers
  271. Imatron, Inc.
  272. jmm@imatron.com
  273.  
  274.  
  275. ----------------------------------------------------------------
  276.  
  277. From auspex.com!guy Thu Dec 31 11:08:24 1992
  278. From:    guy@auspex.com (Guy Harris)
  279. To:    jmm@imatron.com
  280. Subject: Re:  NFS and RPC discussion.
  281. Cc:    weltman@parc.xerox.com
  282. Status: RO
  283. Content-Length: 5983
  284. X-Lines: 116
  285.  
  286. > First off, I'd like to say thanks for the cogent comments you've been making.
  287. > I've found it very interesting to see people at various companies wrangling
  288. > with the NFS transfer issue.  Universally, writing to a remote-mounted file
  289. > has caused them performance headaches.  The discussion you and Rob have been
  290. > having has pretty much supported my thought that there's something in NFS 
  291. > (and SunOS?) that really should be improved.
  292.  
  293. It's mainly in NFS, and not SunOS-specific.
  294.  
  295. The idea is that the protocol is (mostly...) "stateless", and if a
  296. server crashes and reboots, the client shouldn't lose any data or
  297. otherwise have any problems other than delays.
  298.  
  299. If a machine writes data to a file, when the write is flagged as "done",
  300. the software on the machine generally assumes that it is not obliged to
  301. keep the data around in the buffer from which it wrote the data, because
  302. it can fetch it from the file again.  (It may keep it around *anyway*
  303. for performance reasons, but if it needs that buffer for other purposes,
  304. it can just recycle it.)
  305.  
  306. This means that if the file is being accessed over NFS from a file
  307. server, the file server shouldn't reply - and thus tell the machine
  308. doing the writing to the file that the write is "done" - unless, if the
  309. server were to crash after the reply is sent out, and then reboot, the
  310. client could then ask the server for the data again, and get the data it
  311. wrote.
  312.  
  313. If the server *also* buffers data written to the file, so that the file
  314. system doesn't necessarily wait until the data is written to some form
  315. of storage that survives a server crash before saying the write is
  316. "done", then, in order for the NFS write to be "safe", the server must
  317. ensure that the file system *does* wait until the data is written to
  318. some form of storage that survives a server crash before saying the
  319. write is "done" (or must, at least, wait until the data is written to
  320. some form of storage that survives a server crash before replying to the
  321. client's write request).
  322.  
  323. Normally, at least on most UNIX systems, "some form of storage that
  324. survives a server crash" means "the disk", because the UNIX buffer cache
  325. or page pool is *not* necessarily preserved if the system crashes and
  326. reboots (although a crash *might* cause the OS to try to sync data out
  327. to disk, that isn't guaranteed to work).
  328.  
  329. The Prestoserve board acts as "some form of storage that survives a
  330. server crash", but can be written to faster than can a disk; it's static
  331. RAM with a battery backup (so that even if the crash is caused by a
  332. power failure, the data will still survive the crash).
  333.  
  334. Some vendors, including SGI, HP, and Auspex, have an *option* for their
  335. NFS server code that allows the system administrator to specify that
  336. writes to a particular file system by the NFS server should *not* wait
  337. until the data makes it to "some form of storage that survives a server
  338. crash" before being marked as "done".  This allows you to get higher
  339. write performance, but take the risk that a write by an NFS client might
  340. not survive a crash.
  341.  
  342. We (Auspex) do not make that the default; we use it here only for
  343. diskless clients' swap space.  SGI *does* make it the default, claiming
  344. that crashes are rare enough that you're not actually going to lose any
  345. data.  Sun and SGI folk spend a fair bit of time yelling at one another
  346. about this....
  347.  
  348. We (Auspex) also provide our own implementation of the Prestoserve idea.
  349.  
  350. > Out of curiousity, where did you come upon your information on how NFS
  351. > is working internally?
  352.  
  353. Which part?
  354.  
  355. The bit about writes being, or not being, acknowledged by the server
  356. until they make it to "some form of storage that survives a server
  357. crash" is discussed in, for example, RFC 1094, the RFC that describes
  358. the NFS protocol:
  359.  
  360.    All of the procedures in the NFS protocol are assumed to be
  361.    synchronous.  When a procedure returns to the client, the client can
  362.    assume that the operation has completed and any data associated with
  363.    the request is now on stable storage.  For example, a client WRITE
  364.    request may cause the server to update data blocks, filesystem
  365.    information blocks (such as indirect blocks), and file attribute
  366.    information (size and modify times).  When the WRITE returns to the
  367.    client, it can assume that the write is safe, even in case of a
  368.    server crash, and it can discard the data written.  This is a very
  369.    important part of the statelessness of the server.  If the server
  370.    waited to flush data from remote requests, the client would have to
  371.    save those requests so that it could resend them in case of a server
  372.    crash.
  373.  
  374. I found out about the way the client code in SunOS implements file
  375. system operations from having worked for 3 years in the OS group at Sun,
  376. and from having worked for 4 years in the software group here (we're too
  377. small to have an OS group yet...).
  378.  
  379. > Another question - which company provides Prestoserve boards?
  380.  
  381. A company called Legato, in Palo Alto.  They were originally founded as
  382. a software company; they came up with the idea of the Prestoserve board
  383. and started selling the idea (they never made the boards, as far as I
  384. know; I think they originally got somebody to make it, and then sold the
  385. idea to Sun and DEC and possibly other people) to fund themselves.
  386.  
  387. They also sell various software products, such as Networker Backup,
  388. which is an RPC-based backup product; I think they're now providing it
  389. for Netware, as well as for various UNIX systems and DOS.
  390.  
  391. > Sounds like the
  392. > board is designed to fit neatly into one niche, but I'd like to go get more
  393. > information.
  394.  
  395. "Niche" in the hardware sense, or the marketplace sense?  They offer
  396. both VMEbus and SBus versions for Suns; I don't know if their DEC
  397. version is a Turbochannel board or not.  I think you can get them
  398. directly from Sun and DEC; I don't know if Legato still sells them
  399. directly (as indicated, they're really a software company, and got in
  400. the hardware business to keep themselves fed while they built their
  401. software).
  402.  
  403.  
  404.  
  405.  
  406. ---
  407.  
  408.  
  409.