1 .\" Copyright (c) 2001, Matthew Dillon. Terms and conditions are those of
2 .\" the BSD Copyright as specified in the file "/usr/src/COPYRIGHT" in
5 .\" $FreeBSD: src/share/man/man7/tuning.7,v 1.1.2.30 2002/12/17 19:32:08 dillon Exp $
12 .Nd performance tuning under FreeBSD
13 .Sh SYSTEM SETUP - DISKLABEL, NEWFS, TUNEFS, SWAP
18 to lay out your filesystems on a hard disk it is important to remember
19 that hard drives can transfer data much more quickly from outer tracks
20 than they can from inner tracks.
21 To take advantage of this you should
22 try to pack your smaller filesystems and swap closer to the outer tracks,
23 follow with the larger filesystems, and end with the largest filesystems.
24 It is also important to size system standard filesystems such that you
25 will not be forced to resize them later as you scale the machine up.
26 I usually create, in order, a 128M root, 1G swap, 128M
32 and use any remaining space for
35 You should typically size your swap space to approximately 2x main memory.
36 If you do not have a lot of RAM, though, you will generally want a lot
38 It is not recommended that you configure any less than
39 256M of swap on a system and you should keep in mind future memory
40 expansion when sizing the swap partition.
41 The kernel's VM paging algorithms are tuned to perform best when there is
42 at least 2x swap versus main memory.
43 Configuring too little swap can lead
44 to inefficiencies in the VM page scanning code as well as create issues
45 later on if you add more memory to your machine.
46 Finally, on larger systems
47 with multiple SCSI disks (or multiple IDE disks operating on different
48 controllers), we strongly recommend that you configure swap on each drive
50 The swap partitions on the drives should be approximately the same size.
51 The kernel can handle arbitrary sizes but
52 internal data structures scale to 4 times the largest swap partition.
54 the swap partitions near the same size will allow the kernel to optimally
55 stripe swap space across the N disks.
56 Do not worry about overdoing it a
57 little, swap space is the saving grace of
59 and even if you do not normally use much swap, it can give you more time to
60 recover from a runaway program before being forced to reboot.
64 partition depends heavily on what you intend to use the machine for.
66 partition is primarily used to hold mailboxes, the print spool, and log
70 its own partition (but except for extreme cases it is not worth the waste
72 If your machine is intended to act as a mail
74 or you are running a heavily visited web server, you should consider
75 creating a much larger partition \(en perhaps a gig or more.
77 to underestimate log file storage requirements.
81 depends on the kind of temporary file usage you think you will need.
83 the minimum we recommend.
84 Also note that sysinstall will create a
87 Dedicating a partition for temporary file storage is important for
88 two reasons: first, it reduces the possibility of filesystem corruption
89 in a crash, and second it reduces the chance of a runaway process that
91 .Oo Pa /var Oc Ns Pa /tmp
92 from blowing up more critical subsystems (mail,
95 .Oo Pa /var Oc Ns Pa /tmp
96 is a very common problem to have.
98 In the old days there were differences between
102 but the introduction of
106 led to massive confusion
107 by program writers so today programs haphazardly use one or the
108 other and thus no real distinction can be made between the two.
109 So it makes sense to have just one temporary directory and
110 softlink to it from the other tmp directory locations.
113 the one thing you do not want to do is leave it sitting
114 on the root partition where it might cause root to fill up or possibly
115 corrupt root in a crash/reboot situation.
119 partition holds the bulk of the files required to support the system and
120 a subdirectory within it called
122 holds the bulk of the files installed from the
125 If you do not use ports all that much and do not intend to keep
128 on the machine, you can get away with
132 However, if you install a lot of ports
133 (especially window managers and Linux-emulated binaries), we recommend
134 at least a 2 gigabyte
136 and if you also intend to keep system source
137 on the machine, we recommend a 3 gigabyte
139 Do not underestimate the
140 amount of space you will need in this partition, it can creep up and
145 partition is typically used to hold user-specific data.
146 I usually size it to the remainder of the disk.
148 Why partition at all?
149 Why not create one big
151 partition and be done with it?
152 Then I do not have to worry about undersizing things!
153 Well, there are several reasons this is not a good idea.
155 each partition has different operational characteristics and separating them
156 allows the filesystem to tune itself to those characteristics.
160 partitions are read-mostly, with very little writing, while
161 a lot of reading and writing could occur in
166 partitioning your system fragmentation introduced in the smaller more
167 heavily write-loaded partitions will not bleed over into the mostly-read
169 Additionally, keeping the write-loaded partitions closer to
170 the edge of the disk (i.e. before the really big partitions instead of after
171 in the partition table) will increase I/O performance in the partitions
172 where you need it the most.
173 Now it is true that you might also need I/O
174 performance in the larger partitions, but they are so large that shifting
175 them more towards the edge of the disk will not lead to a significant
176 performance improvement whereas moving
178 to the edge can have a huge impact.
179 Finally, there are safety concerns.
180 Having a small neat root partition that
181 is essentially read-only gives it a greater chance of surviving a bad crash
184 Properly partitioning your system also allows you to tune
191 requires more experience but can lead to significant improvements in
193 There are three parameters that are relatively safe to tune:
194 .Em blocksize , bytes/i-node ,
196 .Em cylinders/group .
199 performs best when using 8K or 16K filesystem block sizes.
200 The default filesystem block size is 16K,
201 which provides best performance for most applications,
202 with the exception of those that perform random access on large files
203 (such as database server software).
204 Such applications tend to perform better with a smaller block size,
205 although modern disk characteristics are such that the performance
206 gain from using a smaller block size may not be worth consideration.
207 Using a block size larger than 16K
208 can cause fragmentation of the buffer cache and
209 lead to lower performance.
211 The defaults may be unsuitable
212 for a filesystem that requires a very large number of i-nodes
213 or is intended to hold a large number of very small files.
214 Such a filesystem should be created with an 8K or 4K block size.
215 This also requires you to specify a smaller
217 We recommend always using a fragment size that is 1/8
218 the block size (less testing has been done on other fragment size factors).
221 options for this would be
222 .Dq Li "newfs -f 1024 -b 8192 ..." .
224 If a large partition is intended to be used to hold fewer, larger files, such
225 as database files, you can increase the
227 ratio which reduces the number of i-nodes (maximum number of files and
228 directories that can be created) for that partition.
229 Decreasing the number
230 of i-nodes in a filesystem can greatly reduce
232 recovery times after a crash.
233 Do not use this option
234 unless you are actually storing large files on the partition, because if you
235 overcompensate you can wind up with a filesystem that has lots of free
236 space remaining but cannot accommodate any more files.
237 Using 32768, 65536, or 262144 bytes/i-node is recommended.
238 You can go higher but
239 it will have only incremental effects on
243 .Dq Li "newfs -i 32768 ..." .
246 may be used to further tune a filesystem.
247 This command can be run in
248 single-user mode without having to reformat the filesystem.
249 However, this is possibly the most abused program in the system.
250 Many people attempt to
251 increase available filesystem space by setting the min-free percentage to 0.
252 This can lead to severe filesystem fragmentation and we do not recommend
256 option worthwhile here is turning on
259 .Dq Li "tunefs -n enable /filesystem" .
262 and later, softupdates can be turned on using the
268 will typically enable softupdates automatically for non-root filesystems).
269 Softupdates drastically improves meta-data performance, mainly file
270 creation and deletion.
271 We recommend enabling softupdates on most filesystems; however, there
272 are two limitations to softupdates that you should be aware of when
273 determining whether to use it on a filesystem.
274 First, softupdates guarantees filesystem consistency in the
275 case of a crash but could very easily be several seconds (even a minute!)
276 behind on pending writes to the physical disk.
277 If you crash you may lose more work
279 Secondly, softupdates delays the freeing of filesystem
281 If you have a filesystem (such as the root filesystem) which is
282 close to full, doing a major update of it, e.g.\&
283 .Dq Li "make installworld" ,
284 can run it out of space and cause the update to fail.
285 For this reason, softupdates will not be enabled on the root filesystem
286 during a typical install. There is no loss of performance since the root
287 filesystem is rarely written to.
291 options exist that can help you tune the system.
292 The most obvious and most dangerous one is
294 Do not ever use it; it is far too dangerous.
295 A less dangerous and more
301 filesystems normally update the last-accessed time of a file or
302 directory whenever it is accessed.
303 This operation is handled in
305 with a delayed write and normally does not create a burden on the system.
306 However, if your system is accessing a huge number of files on a continuing
307 basis the buffer cache can wind up getting polluted with atime updates,
308 creating a burden on the system.
309 For example, if you are running a heavily
310 loaded web site, or a news server with lots of readers, you might want to
311 consider turning off atime updates on your larger partitions with this
314 However, you should not gratuitously turn off atime
318 filesystem customarily
319 holds mailboxes, and atime (in combination with mtime) is used to
320 determine whether a mailbox has new mail.
321 You might as well leave
322 atime turned on for mostly read-only partitions such as
327 This is especially useful for
329 since some system utilities
330 use the atime field for reporting.
332 In larger systems you can stripe partitions from several drives together
333 to create a much larger overall partition.
334 Striping can also improve
335 the performance of a filesystem by splitting I/O operations across two
341 utilities may be used to create simple striped filesystems.
343 speaking, striping smaller partitions such as the root and
345 or essentially read-only partitions such as
347 is a complete waste of time.
348 You should only stripe partitions that require serious I/O performance,
351 or custom partitions used to hold databases and web pages.
352 Choosing the proper stripe size is also
354 Filesystems tend to store meta-data on power-of-2 boundaries
355 and you usually want to reduce seeking rather than increase seeking.
357 means you want to use a large off-center stripe size such as 1152 sectors
358 so sequential I/O does not seek both disks and so meta-data is distributed
359 across both disks rather than concentrated on a single disk.
361 you really need to get sophisticated, we recommend using a real hardware
362 RAID controller from the list of
364 supported controllers.
367 variables permit system behavior to be monitored and controlled at
369 Some sysctls simply report on the behavior of the system; others allow
370 the system behavior to be modified;
371 some may be set at boot time using
373 but most will be set via
375 There are several hundred sysctls in the system, including many that appear
376 to be candidates for tuning but actually are not.
377 In this document we will only cover the ones that have the greatest effect
381 .Va kern.ipc.shm_use_phys
382 sysctl defaults to 0 (off) and may be set to 0 (off) or 1 (on).
384 this parameter to 1 will cause all System V shared memory segments to be
385 mapped to unpageable physical RAM.
386 This feature only has an effect if you
387 are either (A) mapping small amounts of shared memory across many (hundreds)
388 of processes, or (B) mapping large amounts of shared memory across any
390 This feature allows the kernel to remove a great deal
391 of internal memory management page-tracking overhead at the cost of wiring
392 the shared memory into core, making it unswappable.
395 .Va vfs.vmiodirenable
396 sysctl defaults to 1 (on).
397 This parameter controls how directories are cached
399 Most directories are small and use but a single fragment
400 (typically 1K) in the filesystem and even less (typically 512 bytes) in
402 However, when operating in the default mode the buffer
403 cache will only cache a fixed number of directories even if you have a huge
405 Turning on this sysctl allows the buffer cache to use
406 the VM Page Cache to cache the directories.
407 The advantage is that all of
408 memory is now available for caching directories.
409 The disadvantage is that
410 the minimum in-core memory used to cache a directory is the physical page
411 size (typically 4K) rather than 512 bytes.
412 We recommend turning this option off in memory-constrained environments;
413 however, when on, it will substantially improve the performance of services
414 that manipulate a large number of files.
415 Such services can include web caches, large mail systems, and news systems.
416 Turning on this option will generally not reduce performance even with the
417 wasted memory but you should experiment to find out.
421 sysctl defaults to 1 (on). This tells the filesystem to issue media
422 writes as full clusters are collected, which typically occurs when writing
423 large sequential files. The idea is to avoid saturating the buffer
424 cache with dirty buffers when it would not benefit I/O performance. However,
425 this may stall processes and under certain circumstances you may wish to turn
429 .Va vfs.hirunningspace
430 sysctl determines how much outstanding write I/O may be queued to
431 disk controllers system wide at any given instance. The default is
432 usually sufficient but on machines with lots of disks you may want to bump
433 it up to four or five megabytes. Note that setting too high a value
434 (exceeding the buffer cache's write threshold) can lead to extremely
435 bad clustering performance. Do not set this value arbitrarily high! Also,
436 higher write queueing values may add latency to reads occuring at the same
439 There are various other buffer-cache and VM page cache related sysctls.
440 We do not recommend modifying these values.
443 the VM system does an extremely good job tuning itself.
446 .Va net.inet.tcp.sendspace
448 .Va net.inet.tcp.recvspace
449 sysctls are of particular interest if you are running network intensive
451 They control the amount of send and receive buffer space
452 allowed for any given TCP connection.
453 The default sending buffer is 32K; the default receiving buffer
456 improve bandwidth utilization by increasing the default at the cost of
457 eating up more kernel memory for each connection.
459 increasing the defaults if you are serving hundreds or thousands of
460 simultaneous connections because it is possible to quickly run the system
461 out of memory due to stalled connections building up.
463 high bandwidth over a fewer number of connections, especially if you have
464 gigabit Ethernet, increasing these defaults can make a huge difference.
465 You can adjust the buffer size for incoming and outgoing data separately.
466 For example, if your machine is primarily doing web serving you may want
467 to decrease the recvspace in order to be able to increase the
468 sendspace without eating too much kernel memory.
469 Note that the routing table (see
471 can be used to introduce route-specific send and receive buffer size
474 As an additional management tool you can use pipes in your
477 to limit the bandwidth going to or from particular IP blocks or ports.
478 For example, if you have a T1 you might want to limit your web traffic
479 to 70% of the T1's bandwidth in order to leave the remainder available
480 for mail and interactive use.
481 Normally a heavily loaded web server
482 will not introduce significant latencies into other services even if
483 the network link is maxed out, but enforcing a limit can smooth things
484 out and lead to longer term stability.
485 Many people also enforce artificial
486 bandwidth limitations in order to ensure that they are not charged for
487 using too much bandwidth.
489 Setting the send or receive TCP buffer to values larger then 65535 will result
490 in a marginal performance improvement unless both hosts support the window
491 scaling extension of the TCP protocol, which is controlled by the
492 .Va net.inet.tcp.rfc1323
494 These extensions should be enabled and the TCP buffer size should be set
495 to a value larger than 65536 in order to obtain good performance from
496 certain types of network links; specifically, gigabit WAN links and
497 high-latency satellite links.
498 RFC1323 support is enabled by default.
501 .Va net.inet.tcp.always_keepalive
502 sysctl determines whether or not the TCP implementation should attempt
503 to detect dead TCP connections by intermittently delivering
506 By default, this is enabled for all applications; by setting this
507 sysctl to 0, only applications that specifically request keepalives
509 In most environments, TCP keepalives will improve the management of
510 system state by expiring dead TCP connections, particularly for
511 systems serving dialup users who may not always terminate individual
512 TCP connections before disconnecting from the network.
513 However, in some environments, temporary network outages may be
514 incorrectly identified as dead sessions, resulting in unexpectedly
515 terminated TCP connections.
516 In such environments, setting the sysctl to 0 may reduce the occurrence of
517 TCP session disconnections.
520 .Va net.inet.tcp.delayed_ack
521 TCP feature is largly misunderstood. Historically speaking this feature
522 was designed to allow the acknowledgement to transmitted data to be returned
523 along with the response. For example, when you type over a remote shell
524 the acknowledgement to the character you send can be returned along with the
525 data representing the echo of the character. With delayed acks turned off
526 the acknowledgement may be sent in its own packet before the remote service
527 has a chance to echo the data it just received. This same concept also
528 applies to any interactive protocol (e.g. SMTP, WWW, POP3) and can cut the
529 number of tiny packets flowing across the network in half. The FreeBSD
530 delayed-ack implementation also follows the TCP protocol rule that
531 at least every other packet be acknowledged even if the standard 100ms
532 timeout has not yet passed. Normally the worst a delayed ack can do is
533 slightly delay the teardown of a connection, or slightly delay the ramp-up
534 of a slow-start TCP connection. While we aren't sure we believe that
535 the several FAQs related to packages such as SAMBA and SQUID which advise
536 turning off delayed acks may be refering to the slow-start issue. In FreeBSD
537 it would be more beneficial to increase the slow-start flightsize via
539 .Va net.inet.tcp.slowstart_flightsize
540 sysctl rather then disable delayed acks.
543 .Va net.inet.tcp.inflight_enable
544 sysctl turns on bandwidth delay product limiting for all TCP connections.
545 The system will attempt to calculate the bandwidth delay product for each
546 connection and limit the amount of data queued to the network to just the
547 amount required to maintain optimum throughput. This feature is useful
548 if you are serving data over modems, GigE, or high speed WAN links (or
549 any other link with a high bandwidth*delay product), especially if you are
550 also using window scaling or have configured a large send window. If
551 you enable this option you should also be sure to set
552 .Va net.inet.tcp.inflight_debug
553 to 0 (disable debugging), and for production use setting
554 .Va net.inet.tcp.inflight_min
555 to at least 6144 may be beneficial. Note, however, that setting high
556 minimums may effectively disable bandwidth limiting depending on the link.
557 The limiting feature reduces the amount of data built up in intermediate
558 router and switch packet queues as well as reduces the amount of data built
559 up in the local host's interface queue. With fewer packets queued up,
560 interactive connections, especially over slow modems, will also be able
561 to operate with lower round trip times. However, note that this feature
562 only effects data transmission (uploading / server-side). It does not
563 effect data reception (downloading).
566 .Va net.inet.tcp.inflight_stab
568 This parameter defaults to 20, representing 2 maximal packets added
569 to the bandwidth delay product window calculation. The additional
570 window is required to stabilize the algorithm and improve responsiveness
571 to changing conditions, but it can also result in higher ping times
572 over slow links (though still much lower then you would get without
573 the inflight algorithm). In such cases you may
574 wish to try reducing this parameter to 15, 10, or 5, and you may also
576 .Va net.inet.tcp.inflight_min
577 (for example, to 3500) to get the desired effect. Reducing these parameters
578 should be done as a last resort only.
581 .Va net.inet.ip.portrange.*
582 sysctls control the port number ranges automatically bound to TCP and UDP
583 sockets. There are three ranges: A low range, a default range, and a
584 high range, selectable via an IP_PORTRANGE setsockopt() call. Most
585 network programs use the default range which is controlled by
586 .Va net.inet.ip.portrange.first
588 .Va net.inet.ip.portrange.last ,
589 which defaults to 1024 and 5000 respectively. Bound port ranges are
590 used for outgoing connections and it is possible to run the system out
591 of ports under certain circumstances. This most commonly occurs when you are
592 running a heavily loaded web proxy. The port range is not an issue
593 when running serves which handle mainly incoming connections such as a
594 normal web server, or has a limited number of outgoing connections such
595 as a mail relay. For situations where you may run yourself out of
596 ports we recommend increasing
597 .Va net.inet.ip.portrange.last
598 modestly. A value of 10000 or 20000 or 30000 may be reasonable. You should
599 also consider firewall effects when changing the port range. Some firewalls
600 may block large ranges of ports (usually low-numbered ports) and expect systems
601 to use higher ranges of ports for outgoing connections. For this reason
602 we do not recommend that
603 .Va net.inet.ip.portrange.first
607 .Va kern.ipc.somaxconn
608 sysctl limits the size of the listen queue for accepting new TCP connections.
609 The default value of 128 is typically too low for robust handling of new
610 connections in a heavily loaded web server environment.
611 For such environments,
612 we recommend increasing this value to 1024 or higher.
614 may itself limit the listen queue size (e.g.\&
617 often have a directive in its configuration file to adjust the queue size up.
618 Larger listen queues also do a better job of fending off denial of service
623 sysctl determines how many open files the system supports.
625 typically a few thousand but you may need to bump this up to ten or twenty
626 thousand if you are running databases or large descriptor-heavy daemons.
629 sysctl may be interrogated to determine the current number of open files
633 .Va vm.swap_idle_enabled
634 sysctl is useful in large multi-user systems where you have lots of users
635 entering and leaving the system and lots of idle processes.
637 tend to generate a great deal of continuous pressure on free memory reserves.
638 Turning this feature on and adjusting the swapout hysteresis (in idle
640 .Va vm.swap_idle_threshold1
642 .Va vm.swap_idle_threshold2
643 allows you to depress the priority of pages associated with idle processes
644 more quickly then the normal pageout algorithm.
645 This gives a helping hand
646 to the pageout daemon.
647 Do not turn this option on unless you need it,
648 because the tradeoff you are making is to essentially pre-page memory sooner
649 rather then later, eating more swap and disk bandwidth.
651 this option will have a detrimental effect but in a large system that is
652 already doing moderate paging this option allows the VM system to stage
653 whole processes into and out of memory more easily.
655 Some aspects of the system behavior may not be tunable at runtime because
656 memory allocations they perform must occur early in the boot process.
657 To change loader tunables, you must set their values in
659 and reboot the system.
662 controls the scaling of a number of static system tables, including defaults
663 for the maximum number of open files, sizing of network memory resources, etc.
667 is automatically sized at boot based on the amount of memory available in
668 the system, and may be determined at run-time by inspecting the value of the
672 Some sites will require larger or smaller values of
674 and may set it as a loader tunable; values of 64, 128, and 256 are not
676 We do not recommend going above 256 unless you need a huge number
677 of file descriptors; many of the tunable values set to their defaults by
679 may be individually overridden at boot-time or run-time as described
680 elsewhere in this document.
683 must set this value via the kernel
689 .Va kern.ipc.nmbclusters
690 may be adjusted to increase the number of network mbufs the system is
692 Each cluster represents approximately 2K of memory,
693 so a value of 1024 represents 2M of kernel memory reserved for network
695 You can do a simple calculation to figure out how many you need.
696 If you have a web server which maxes out at 1000 simultaneous connections,
697 and each connection eats a 16K receive and 16K send buffer, you need
698 approximately 32MB worth of network buffers to deal with it.
700 thumb is to multiply by 2, so 32MBx2 = 64MB/2K = 32768.
702 you would want to set
703 .Va kern.ipc.nmbclusters
705 We recommend values between
706 1024 and 4096 for machines with moderates amount of memory, and between 4096
707 and 32768 for machines with greater amounts of memory.
708 Under no circumstances
709 should you specify an arbitrarily high value for this parameter, it could
710 lead to a boot-time crash.
715 may be used to observe network cluster use.
718 do not have this tunable and require that the
725 More and more programs are using the
727 system call to transmit files over the network.
730 sysctl controls the number of filesystem buffers
732 is allowed to use to perform its work.
733 This parameter nominally scales
736 so you should not need to modify this parameter except under extreme
738 .Sh KERNEL CONFIG TUNING
739 There are a number of kernel options that you may have to fiddle with in
740 a large-scale system.
741 In order to change these options you need to be
742 able to compile a new kernel from source.
745 manual page and the handbook are good starting points for learning how to
747 Generally the first thing you do when creating your own custom
748 kernel is to strip out all the drivers and services you do not use.
751 and drivers you do not have will reduce the size of your kernel, sometimes
752 by a megabyte or more, leaving more memory available for applications.
757 may be used to reduce system boot times.
758 The defaults are fairly high and
759 can be responsible for 15+ seconds of delay in the boot process.
762 to 5 seconds usually works (especially with modern drives).
765 also works but you have to be a little more careful.
767 There are a number of
769 options that can be commented out.
770 If you only want the kernel to run
771 on a Pentium class CPU, you can easily remove
777 if you are sure your CPU is being recognized as a Pentium II or better.
778 Some clones may be recognized as a Pentium or even a 486 and not be able
779 to boot without those options.
782 will be able to better-use higher-end CPU features for MMU, task switching,
783 timebase, and even device operations.
784 Additionally, higher-end CPUs support
785 4MB MMU pages, which the kernel uses to map the kernel itself into memory,
786 increasing its efficiency under heavy syscall loads.
787 .Sh IDE WRITE CACHING
789 flirted with turning off IDE write caching.
790 This reduced write bandwidth
791 to IDE disks but was considered necessary due to serious data consistency
792 issues introduced by hard drive vendors.
793 Basically the problem is that
794 IDE drives lie about when a write completes.
795 With IDE write caching turned
796 on, IDE hard drives will not only write data to disk out of order, they
797 will sometimes delay some of the blocks indefinitely under heavy disk
799 A crash or power failure can result in serious filesystem
801 So our default was changed to be safe.
803 result was such a huge loss in performance that we caved in and changed the
804 default back to on after the release.
805 You should check the default on
806 your system by observing the
809 If IDE write caching is turned off, you can turn it back
813 More information on tuning the ATA driver system may be found in the
817 There is a new experimental feature for IDE hard drives called
819 (you also set this in the boot loader) which allows write caching to be safely
821 This brings SCSI tagging features to IDE drives.
823 writing only IBM DPTA and DTLA drives support the feature.
826 drives apparently have quality control problems and I do not recommend
827 purchasing them at this time.
828 If you need performance, go with SCSI.
829 .Sh CPU, MEMORY, DISK, NETWORK
830 The type of tuning you do depends heavily on where your system begins to
831 bottleneck as load increases.
832 If your system runs out of CPU (idle times
833 are perpetually 0%) then you need to consider upgrading the CPU or moving to
834 an SMP motherboard (multiple CPU's), or perhaps you need to revisit the
835 programs that are causing the load and try to optimize them.
837 is paging to swap a lot you need to consider adding more memory.
839 system is saturating the disk you typically see high CPU idle times and
840 total disk saturation.
842 can be used to monitor this.
843 There are many solutions to saturated disks:
844 increasing memory for caching, mirroring disks, distributing operations across
845 several machines, and so forth.
846 If disk performance is an issue and you
847 are using IDE drives, switching to SCSI can help a great deal.
849 IDE drives compare with SCSI in raw sequential bandwidth, the moment you
850 start seeking around the disk SCSI drives usually win.
852 Finally, you might run out of network suds.
853 The first line of defense for
854 improving network performance is to make sure you are using switches instead
855 of hubs, especially these days where switches are almost as cheap.
857 have severe problems under heavy loads due to collision backoff and one bad
858 host can severely degrade the entire LAN.
859 Second, optimize the network path
863 we describe a firewall protecting internal hosts with a topology where
864 the externally visible hosts are not routed through it.
866 than 10BaseT, or use 1000BaseT rather then 100BaseT, depending on your needs.
867 Most bottlenecks occur at the WAN link (e.g.\&
868 modem, T1, DSL, whatever).
869 If expanding the link is not an option it may be possible to use the
871 feature to implement peak shaving or other forms of traffic shaping to
872 prevent the overloaded service (such as web services) from affecting other
873 services (such as email), or vice versa.
874 In home installations this could
875 be used to give interactive traffic (your browser,
878 over services you export from your box (web services, email).
908 manual page was originally written by