| I l@ve RuBoard |
|
15.7 Network PerformanceThis section concludes our look at performance monitoring and tuning on Unix systems. It contains a brief introduction to network performance, a very large topic whose full treatment is beyond the scope of this book. Consult the work by Musameci and Loukides for further information. 15.7.1 Basic Network Performance MonitoringThe netstat -s command is a good place to start when examining networkperformance. It displays network statistics. You can limit the display to a single network protocol via the -p option, as in this example from an HP-UX system: $ netstat -s -p tcp Output shortened. tcp: 178182 packets sent 111822 data packets (35681757 bytes) 30 data packets (3836 bytes) retransmitted 66363 ack-only packets (4332 delayed) 337753 packets received 89709 acks (for 35680557 bytes) 349 duplicate acks 0 acks for unsent data 284726 packets (287618947 bytes) received in-sequence 0 completely duplicate packets (0 bytes) 3 packets with some dup, data (832 bytes duped) 11 out of order packets (544 bytes) 5 packets received after close 11 out of order packets (544 bytes) The output gives statistics since the last boot.[32]
Network operations are proceeding nicely on this system. The highlighted lines are among those that would indicate transmission problems if the values in them rose to appreciable percentages of the total network traffic. More detailed network performance data can be determined via the various network monitoring tools we considered in Section 8.6. 15.7.2 General TCP/IP Network Performance PrinciplesGood network performance depends on a combination of several components working properly and efficiently. Performance problems can arise in many places and take many forms. These are among the most common:
All of these problem types are best addressed via by correcting or replacing hardware and/or reallocating resources rather than configuration-level tuning. 15.7.2.1 Two TCP parametersTCP operations are controlled by a very large number of parameters. Most of them should not be modified by nonexperts. In this subsection, we'll consider two that are most likely to produce significant improvements with little risk.
Table 15-7 lists the relevant parameters for each of our Unix versions, along with the commands that may be used to modify them. The remaining sections will consider performance issues associated with two important network subsystems: DNS and NFS. 15.7.3 DNS PerformanceDNSperformance is another item that is easiest to affect at the planning stage. The key issues with DNS are:
At the moment, the latter is best accomplished by specifying different name server orderings within the /etc/resolv.conf files on groups of client systems. It is also helpful to provide at least one DNS server on each side of slow links. Careful placement of forwarders can also be beneficial. At larger sites, a two-tiered forwarding hierarchy may help to channel external queries through specific hosts and reduce the load on other internal servers. Finally, use separate servers for handling internal and external DNS queries. Not only will there be performance benefits for internal users, it is also the best security practice. DNS itself can also provide a very crude sort of load balancing via the use of multiple A records in a zone file, as in this example: docsrv IN A 192.168.10.1
IN A 192.168.10.2
IN A 192.168.10.3
These records define three servers with the hostname docsrv. Successive queries for this name will receive each IP address in turn.[35]
This technique is most effective when the operations that are requested from the servers are all essentially equivalent, and so a simple round robin distribution of them is appropriate. It will be less successful when requests can vary greatly in size or resource requirements. In such cases, manual assigning servers to the various clients will work better. You can do so my editing the nameserver entries in /etc/resolv.conf. 15.7.4 NFS PerformanceThe Network File System is a very important Unix network service, so we'll complete our discussion of performance by considering some of its performance issues. Monitoring NFS-specific network traffic and performance is done via the nfsstat command. For example, the following command lists NFS client statistics: $ nfsstat -rc
Client rpc:
tcp: calls badxids badverfs timeouts newcreds
0 0 0 0 0
...
udp: calls badxids badverfs timeouts newcreds retrans
302241 7 0 3 0 0
badcalls timers waits
7 22 0
This system performs NFS operations using the UDP protocol (the traditional method), so the TCP values are all 0. The most important items to consider in this report are the following:
If either of these values is appreciable, there is probably an NFS bottleneck somewhere. If badxids is within a factor of, say, 6-7 of timeouts, the responsiveness the remote NFS server is the source of the client's performance problems. On the other hand, if there are many more timeouts than badxids, then general network congestion is to blame. The nfsstat command's -s option is used to obtain NFS server statistics: $ nfsstat -s
Server nfs:
calls badcalls badprog badproc badvers badargs
59077 0 0 0 0 0
unprivport weakauth
0 0
Server nfs V2: (54231 out of 59077 calls)
null getattr setattr root lookup readlink read
0 0% 30 0% 12 0% 0 0% 68 0% 0 0% 30223 55%
wrcache write create remove rename link symlink
0 0% 23776 43% 4 0% 4 0% 0 0% 0 0% 0 0%
mkdir rmdir readdir statfs
1 0% 0 0% 42 0% 71 0%
Server nfs V3: (4846 out of 59077 calls)
null getattr setattr lookup access readlink read
0 0% 366 7% 0 0% 3096 63% 711 14% 0 0% 0 0%
write create mkdir symlink mknod remove rmdir
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
rename link readdir readdir+ fsstat fsinfo pathconf
0 0% 0 0% 47 0% 345 7% 166 3% 12 0% 103 2%
commit
0 0%
The first section of the report gives overall NFS server statistics. The remainder of the report serves to break down NFS operations by type. This server supports both NFS Versions 2 and 3, so we see values in both of the final two sections of the report. 15.7.4.1 NFS Version 3 performance improvementsMany Unix systems are now providingNFS Version 3 instead of or in addition to Version 2. NFS Version 3 has many benefits in several areas; reliability, security, performance are among them. The following are the most important improvements provided by NFS Version 3:
15.7.4.2 NFS performance principlesThe following points are important to keep in mind with respect to NFS server performance, especially in the planning stages:
|
| I l@ve RuBoard |
|