home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / bsd / 4592 < prev    next >
Encoding:
Internet Message Format  |  1992-08-23  |  8.5 KB

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!sgi!rigden.wpd.sgi.com!rpw3
  2. From: rpw3@rigden.wpd.sgi.com (Rob Warnock)
  3. Newsgroups: comp.unix.bsd
  4. Subject: Re: ne1000 slow performance
  5. Message-ID: <oudcs3g@sgi.sgi.com>
  6. Date: 23 Aug 92 14:46:16 GMT
  7. Sender: rpw3@rigden.wpd.sgi.com
  8. Organization: Silicon Graphics, Inc.  Mountain View, CA
  9. Lines: 177
  10.  
  11. spedpr@thor.cf.ac.uk (Paul Richards) writes:
  12. +---------------
  13. | Is there benchmarking software for ethernet cards/drivers. 
  14. | I'd be interested what sort of performance I'm getting and ftp stats
  15. | vary from file to file so are meaningless for this purpose. What are
  16. | people using for this?
  17. +---------------
  18.  
  19. I use a combination of things, depending on what I'm trying to measure or
  20. tune, but the basic tools are "ping" and "ttcp".
  21.  
  22. BE CAREFUL! MANY OF THESE TESTS CAN IMPOSE SIGNIFICANT LOADS ON YOUR NETWORK!
  23. Do these tests at off hours or on private nets, to keep your co-workers
  24. from getting upset with you. (And to keep their normal work from skewing
  25. your results. ;-} )
  26.  
  27. For measuring latency, good old "ping" (a.k.a. ICMP ECHO) works well,
  28. especially "ping -f". For example, from my 386bsd system (486/33) to
  29. my SGI workstation, one might see:
  30.  
  31.     bsdj 64# time ping -fq -c10000 rigden
  32.     PING rigden.wpd.sgi.com (192.26.75.58): 56 data bytes
  33.  
  34.     --- rigden.wpd.sgi.com ping statistics ---
  35.     10012 packets transmitted, 10000 packets received, 0% packet loss
  36.     round-trip min/avg/max = 0/35/60 ms
  37.     0.8u 36.8s 0:37.90 99.3% 0+0k 0+0io 0pf+0w
  38.     bsdj 65#
  39.  
  40. I used "time", since the 386bsd version of "ping" does not report pkt/sec,
  41. and given the time I can manually calculate that we sent 10012/37.9 = 264
  42. pkt/sec. Since this is more than "ping"'s default 100 pkt/sec, most of these
  43. were probably sent due to the previous response coming back, so the average
  44. latency was about 3.8ms. [Read the source for "ping" is this is not clear.
  45. Don't put too much trust in the latency numbers you see from "ping" on the
  46. PC machines, the clock's not fine-grained enough.]
  47.  
  48. In the other direction, from SGI to "bsdj", we get:
  49.  
  50.     rpw3@rigden <157> ping -fq -c10000 bsdj
  51.     PING bsdj.wpd.sgi.com (192.26.75.188): 56 data bytes
  52.  
  53.     ----bsdj.wpd.sgi.com PING Statistics----
  54.     10000 packets transmitted, 10000 packets received, 0% packet loss
  55.     round-trip (ms)  min/avg/max = 1/1/28    548.97 packets/sec
  56.     0.6u 5.0s 0:18 30%
  57.     rpw3@rigden <158> 
  58.  
  59. The increase in pkts/sec and decrease in latency is not surprising: The SGI
  60. box is about twice as fast (36 MHz R3000) and has much more highly tuned
  61. networking code. Also, the target of a ping does *much* less work, and all of
  62. it at interrupt level. So what we're largely seeing here is the user-to-kernel
  63. system call overhead for a sendmsg(), a recvmsg(), and several context switches
  64. (sleep/wakeups): about 3.78ms for the 386bsd system, and about 1.8ms for the
  65. SGI. [The actual Ethernet transmission time totals only 0.15ms round-trip.]
  66.  
  67. For raw throughput, I use (as many people do) the program "ttcp". It's readily
  68. available (from sgi.com:~ftp/sgi/src/ttcp/* if you don't have it locally),
  69. and is well understood. You start up a "ttcp -r -s" on one system and then
  70. fire off a "ttcp -t -s {target}" on the other. E.g.:
  71.  
  72. PC:    bsdj 66# ttcp -r -s
  73.     ttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5001  tcp
  74.     ttcp-r: socket
  75.     ttcp-r: accept from 192.26.75.58
  76.     ttcp-r: 16777216 bytes in 38.38 real seconds = 426.89 KB/sec +++
  77.     ttcp-r: 4100 I/O calls, msec/call = 9.59, calls/sec = 106.83
  78.     ttcp-r: 0.0user 6.9sys 0:38real 18% 0i+0d 0maxrss 0+0pf 4085+94csw
  79.     0.0u 7.0s 0:44.52 15.9% 0+0k 0+0io 0pf+0w
  80.     bsdj 67#                  
  81.  
  82. SGI:    rpw3@rigden <159> ttcp -t -s bsdj
  83.     ttcp-t: buflen=8192, nbuf=2048, align=16384/0, port=5001 tcp  -> bsdj
  84.     ttcp-t: socket
  85.     ttcp-t: connect
  86.     ttcp-t: 16777216 bytes in 38.22 real seconds = 428.69 KB/sec +++
  87.     ttcp-t: 2048 I/O calls, msec/call = 19.11, calls/sec = 53.59
  88.     ttcp-t: 0.0user 0.5sys 0:38real 1%
  89.     rpw3@rigden <160> 
  90.  
  91. Because of the buffering inherent in the net code, it is important when
  92. reporting "ttcp" performance to use *only* the numbers reported by the
  93. *receiving* side, and even then, make sure your "ttcp" run is long enough
  94. (by using the "-n" option, if necessary) to swamp start-up transients.
  95. The above example (over 30 secs) doesn't show it, but on very short runs
  96. the transmitting side can finish noticably before the receiver, and report
  97. artificially high rates.
  98.  
  99. It's also important to run "ttcp" in both directions, as the work done by
  100. transmitting and receiving is assymetrical. For example, above we saw that a
  101. 486/33 (BSDJ) can receive from an SGI 4D/35 (Irix) at some 425 KB/s, but as
  102. we see below the reverse is not true. From 486 to SGI we get only 360 KB/s:
  103.  
  104. SGI:    rpw3@rigden <160> ttcp -r -s
  105.     ttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5001  tcp
  106.     ttcp-r: socket
  107.     ttcp-r: accept from 192.26.75.188
  108.     ttcp-r: 16777216 bytes in 45.60 real seconds = 359.31 KB/sec +++
  109.     ttcp-r: 16339 I/O calls, msec/call = 2.86, calls/sec = 358.32
  110.     ttcp-r: 0.0user 3.4sys 0:45real 7%
  111.     0.0u 3.4s 0:52 6%
  112.     rpw3@rigden <161> 
  113.  
  114. PC:    bsdj 67# ttcp -t -s rigden
  115.     ttcp-t: buflen=8192, nbuf=2048, align=16384/0, port=5001 tcp  -> rigden
  116.     ttcp-t: socket
  117.     ttcp-t: connect
  118.     ttcp-t: 16777216 bytes in 45.62 real seconds = 359.14 KB/sec +++
  119.     ttcp-t: 2048 I/O calls, msec/call = 22.81, calls/sec = 44.89
  120.     ttcp-t: 0.0user 42.0sys 0:45real 92% 0i+0d 0maxrss 0+0pf 1105+432csw
  121.     0.0u 42.1s 0:45.78 92.2% 0+0k 0+0io 0pf+0w
  122.     bsdj 68# 
  123.  
  124. Such assymetries are not at all unusual. Usually there is more CPU time spent
  125. on the sending side, so sending from the faster machine to the slower will
  126. get better performance. This is borne out by the observation from the above
  127. numbers that when receiving at 425 KB/s the BSDJ machine consumed 18% of its
  128. CPU, but while sending at 360 KBK/s it used 92%.
  129.  
  130. The SGI machine used almost no CPU in either case, but it's capable of nearly
  131. 10 MB/s of "ttcp" over FDDI, and can easily saturate an Ethernet. By the way,
  132. I hope to speed up BSDJ's networking some, too. I suspect much of the problem
  133. is in the WD board, and want to try an AMD LANCE "DMA bus master" card. Any
  134. modern workstation of 10 MIPS or more *should* be able to saturate an Ethernet
  135. (~1.1 MB/s of "ttcp").
  136.  
  137. Finally, if you don't have "ttcp", a crude kind of "throughput" measurement
  138. can also be done with "ping", by using the "-s" option. For example:
  139.  
  140.     basj 68# time ping -fq -c1000 -s2048 rigden
  141.     PING rigden.wpd.sgi.com (192.26.75.58): 2048 data bytes
  142.  
  143.     --- rigden.wpd.sgi.com ping statistics ---
  144.     1001 packets transmitted, 1000 packets received, 0% packet loss
  145.     round-trip min/avg/max = 20/35/50 ms
  146.     0.5u 17.2s 0:17.96 98.9% 0+0k 0+0io 0pf+0w
  147.     basj #69 
  148.  
  149. This shows that we transmitted *and* received 1000 2048-byte datagrams (which,
  150. because of Ethernet's 1500-byte maximum, were fragmented into two parts and
  151. reassembled at the other end, then frag'd/reassembled on the way back) in
  152. 18 seconds, for a total of about 144 KB/s of "request/response"-type traffic.
  153.  
  154. It should not be surprising that this is lower than the "ttcp" numbers above,
  155. since this test is closer to a "stop & wait" protocol than TCP's windowed
  156. streaming.  On the other hand, since the average time per packets (18ms) was
  157. more than "ping -f"'s maximum 10ms interval, at least two requests were "in
  158. flight" at once, so it wasn't pure "stop & wait". It is such considerations
  159. that make it hard to get meaningful results with the "ping -f -s<BIG>" test.
  160. But sometimes you have to use what's available, and sometimes "ping" is when
  161. "ttcp" isn't.
  162.  
  163.  
  164. Again, CAUTION! Network stress tests do just that: cause stress. Both on the
  165. nominal systems-under-test and (sometimes) on others. Don't be surprised if
  166. you uncover strange bugs. For example, I have seen some hosts that would crash
  167. if sent very large ICMP ECHO packets (i.e., "ping -s<BIG>"). And in running
  168. the above tests to write this message, I crash 386bsd once with the "kmem_map"
  169. panic, even though my kernel has both of the patches in. (I was running a test
  170. from an rlogin'd job, and I forgot to put the "q" on a "ping -fq". Without the
  171. "-q", "ping" outputs characters to stderr for each packet sent/received, and
  172. I suspect the added network traffic led to the "kmem_map" panic somehow.)
  173.  
  174.  
  175. -Rob
  176.  
  177. p.s. Despite temptation from various bad influences, do *not* believe anyone
  178. who tries to sell you results from "ttcp -u" (UDP instead of TCP). Quite often,
  179. the UDP numbers only show how fast the network driver can throw away data
  180. when the buffers fill up. I have heard of vendors who tried to quote "ttcp -u"
  181. numbers which exceeded the bandwidth of the network medium!
  182.  
  183. -----
  184. Rob Warnock, MS-9U/510        rpw3@sgi.com
  185. Silicon Graphics, Inc.        (415)390-1673
  186. 2011 N. Shoreline Blvd.
  187. Mountain View, CA  94043
  188.