1 .\" Copyright (C) 2001 Matthew Dillon. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\" notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\" notice, this list of conditions and the following disclaimer in the
10 .\" documentation and/or other materials provided with the distribution.
12 .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15 .\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
16 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .Nd performance tuning under FreeBSD
32 .Sh SYSTEM SETUP - DISKLABEL, NEWFS, TUNEFS, SWAP
37 to lay out your file systems on a hard disk it is important to remember
38 that hard drives can transfer data much more quickly from outer tracks
39 than they can from inner tracks.
40 To take advantage of this you should
41 try to pack your smaller file systems and swap closer to the outer tracks,
42 follow with the larger file systems, and end with the largest file systems.
43 It is also important to size system standard file systems such that you
44 will not be forced to resize them later as you scale the machine up.
45 I usually create, in order, a 128M root, 1G swap, 128M
51 and use any remaining space for
54 You should typically size your swap space to approximately 2x main memory.
55 If you do not have a lot of RAM, though, you will generally want a lot
57 It is not recommended that you configure any less than
58 256M of swap on a system and you should keep in mind future memory
59 expansion when sizing the swap partition.
60 The kernel's VM paging algorithms are tuned to perform best when there is
61 at least 2x swap versus main memory.
62 Configuring too little swap can lead
63 to inefficiencies in the VM page scanning code as well as create issues
64 later on if you add more memory to your machine.
65 Finally, on larger systems
66 with multiple SCSI disks (or multiple IDE disks operating on different
67 controllers), we strongly recommend that you configure swap on each drive.
68 The swap partitions on the drives should be approximately the same size.
69 The kernel can handle arbitrary sizes but
70 internal data structures scale to 4 times the largest swap partition.
72 the swap partitions near the same size will allow the kernel to optimally
73 stripe swap space across the N disks.
74 Do not worry about overdoing it a
75 little, swap space is the saving grace of
77 and even if you do not normally use much swap, it can give you more time to
78 recover from a runaway program before being forced to reboot.
82 partition depends heavily on what you intend to use the machine for.
84 partition is primarily used to hold mailboxes, the print spool, and log
88 its own partition (but except for extreme cases it is not worth the waste
90 If your machine is intended to act as a mail
92 or you are running a heavily visited web server, you should consider
93 creating a much larger partition \(en perhaps a gig or more.
95 to underestimate log file storage requirements.
99 depends on the kind of temporary file usage you think you will need.
101 the minimum we recommend.
102 Also note that sysinstall will create a
105 Dedicating a partition for temporary file storage is important for
106 two reasons: first, it reduces the possibility of file system corruption
107 in a crash, and second it reduces the chance of a runaway process that
109 .Oo Pa /var Oc Ns Pa /tmp
110 from blowing up more critical subsystems (mail,
113 .Oo Pa /var Oc Ns Pa /tmp
114 is a very common problem to have.
116 In the old days there were differences between
120 but the introduction of
124 led to massive confusion
125 by program writers so today programs haphazardly use one or the
126 other and thus no real distinction can be made between the two.
127 So it makes sense to have just one temporary directory and
128 softlink to it from the other
133 the one thing you do not want to do is leave it sitting
134 on the root partition where it might cause root to fill up or possibly
135 corrupt root in a crash/reboot situation.
139 partition holds the bulk of the files required to support the system and
140 a subdirectory within it called
142 holds the bulk of the files installed from the
145 If you do not use ports all that much and do not intend to keep
148 on the machine, you can get away with
152 However, if you install a lot of ports
153 (especially window managers and Linux-emulated binaries), we recommend
154 at least a 2 gigabyte
156 and if you also intend to keep system source
157 on the machine, we recommend a 3 gigabyte
159 Do not underestimate the
160 amount of space you will need in this partition, it can creep up and
165 partition is typically used to hold user-specific data.
166 I usually size it to the remainder of the disk.
168 Why partition at all?
169 Why not create one big
171 partition and be done with it?
172 Then I do not have to worry about undersizing things!
173 Well, there are several reasons this is not a good idea.
175 each partition has different operational characteristics and separating them
176 allows the file system to tune itself to those characteristics.
180 partitions are read-mostly, with very little writing, while
181 a lot of reading and writing could occur in
186 partitioning your system fragmentation introduced in the smaller more
187 heavily write-loaded partitions will not bleed over into the mostly-read
189 Additionally, keeping the write-loaded partitions closer to
190 the edge of the disk (i.e., before the really big partitions instead of after
191 in the partition table) will increase I/O performance in the partitions
192 where you need it the most.
193 Now it is true that you might also need I/O
194 performance in the larger partitions, but they are so large that shifting
195 them more towards the edge of the disk will not lead to a significant
196 performance improvement whereas moving
198 to the edge can have a huge impact.
199 Finally, there are safety concerns.
200 Having a small neat root partition that
201 is essentially read-only gives it a greater chance of surviving a bad crash
204 Properly partitioning your system also allows you to tune
211 requires more experience but can lead to significant improvements in
213 There are three parameters that are relatively safe to tune:
214 .Em blocksize , bytes/i-node ,
216 .Em cylinders/group .
219 performs best when using 8K or 16K file system block sizes.
220 The default file system block size is 16K,
221 which provides best performance for most applications,
222 with the exception of those that perform random access on large files
223 (such as database server software).
224 Such applications tend to perform better with a smaller block size,
225 although modern disk characteristics are such that the performance
226 gain from using a smaller block size may not be worth consideration.
227 Using a block size larger than 16K
228 can cause fragmentation of the buffer cache and
229 lead to lower performance.
231 The defaults may be unsuitable
232 for a file system that requires a very large number of i-nodes
233 or is intended to hold a large number of very small files.
234 Such a file system should be created with an 8K or 4K block size.
235 This also requires you to specify a smaller
237 We recommend always using a fragment size that is 1/8
238 the block size (less testing has been done on other fragment size factors).
241 options for this would be
242 .Dq Li "newfs -f 1024 -b 8192 ..." .
244 If a large partition is intended to be used to hold fewer, larger files, such
245 as database files, you can increase the
247 ratio which reduces the number of i-nodes (maximum number of files and
248 directories that can be created) for that partition.
249 Decreasing the number
250 of i-nodes in a file system can greatly reduce
252 recovery times after a crash.
253 Do not use this option
254 unless you are actually storing large files on the partition, because if you
255 overcompensate you can wind up with a file system that has lots of free
256 space remaining but cannot accommodate any more files.
257 Using 32768, 65536, or 262144 bytes/i-node is recommended.
258 You can go higher but
259 it will have only incremental effects on
263 .Dq Li "newfs -i 32768 ..." .
266 may be used to further tune a file system.
267 This command can be run in
268 single-user mode without having to reformat the file system.
269 However, this is possibly the most abused program in the system.
270 Many people attempt to
271 increase available file system space by setting the min-free percentage to 0.
272 This can lead to severe file system fragmentation and we do not recommend
276 option worthwhile here is turning on
279 .Dq Li "tunefs -n enable /filesystem" .
282 and later, softupdates can be turned on using the
288 will typically enable softupdates automatically for non-root file systems).
289 Softupdates drastically improves meta-data performance, mainly file
290 creation and deletion.
291 We recommend enabling softupdates on most file systems; however, there
292 are two limitations to softupdates that you should be aware of when
293 determining whether to use it on a file system.
294 First, softupdates guarantees file system consistency in the
295 case of a crash but could very easily be several seconds (even a minute!\&)
296 behind on pending write to the physical disk.
297 If you crash you may lose more work
299 Secondly, softupdates delays the freeing of file system
301 If you have a file system (such as the root file system) which is
302 close to full, doing a major update of it, e.g.\&
303 .Dq Li "make installworld" ,
304 can run it out of space and cause the update to fail.
305 For this reason, softupdates will not be enabled on the root file system
306 during a typical install.
307 There is no loss of performance since the root
308 file system is rarely written to.
312 options exist that can help you tune the system.
313 The most obvious and most dangerous one is
315 Do not ever use it; it is far too dangerous.
316 A less dangerous and more
322 file systems normally update the last-accessed time of a file or
323 directory whenever it is accessed.
324 This operation is handled in
326 with a delayed write and normally does not create a burden on the system.
327 However, if your system is accessing a huge number of files on a continuing
328 basis the buffer cache can wind up getting polluted with atime updates,
329 creating a burden on the system.
330 For example, if you are running a heavily
331 loaded web site, or a news server with lots of readers, you might want to
332 consider turning off atime updates on your larger partitions with this
335 However, you should not gratuitously turn off atime
339 file system customarily
340 holds mailboxes, and atime (in combination with mtime) is used to
341 determine whether a mailbox has new mail.
342 You might as well leave
343 atime turned on for mostly read-only partitions such as
348 This is especially useful for
350 since some system utilities
351 use the atime field for reporting.
353 In larger systems you can stripe partitions from several drives together
354 to create a much larger overall partition.
355 Striping can also improve
356 the performance of a file system by splitting I/O operations across two
362 utilities may be used to create simple striped file systems.
364 speaking, striping smaller partitions such as the root and
366 or essentially read-only partitions such as
368 is a complete waste of time.
369 You should only stripe partitions that require serious I/O performance,
372 or custom partitions used to hold databases and web pages.
373 Choosing the proper stripe size is also
375 File systems tend to store meta-data on power-of-2 boundaries
376 and you usually want to reduce seeking rather than increase seeking.
378 means you want to use a large off-center stripe size such as 1152 sectors
379 so sequential I/O does not seek both disks and so meta-data is distributed
380 across both disks rather than concentrated on a single disk.
382 you really need to get sophisticated, we recommend using a real hardware
383 RAID controller from the list of
385 supported controllers.
388 variables permit system behavior to be monitored and controlled at
390 Some sysctls simply report on the behavior of the system; others allow
391 the system behavior to be modified;
392 some may be set at boot time using
394 but most will be set via
396 There are several hundred sysctls in the system, including many that appear
397 to be candidates for tuning but actually are not.
398 In this document we will only cover the ones that have the greatest effect
402 .Va kern.ipc.shm_use_phys
403 sysctl defaults to 0 (off) and may be set to 0 (off) or 1 (on).
405 this parameter to 1 will cause all System V shared memory segments to be
406 mapped to unpageable physical RAM.
407 This feature only has an effect if you
408 are either (A) mapping small amounts of shared memory across many (hundreds)
409 of processes, or (B) mapping large amounts of shared memory across any
411 This feature allows the kernel to remove a great deal
412 of internal memory management page-tracking overhead at the cost of wiring
413 the shared memory into core, making it unswappable.
416 .Va vfs.vmiodirenable
417 sysctl defaults to 1 (on).
418 This parameter controls how directories are cached
420 Most directories are small and use but a single fragment
421 (typically 1K) in the file system and even less (typically 512 bytes) in
423 However, when operating in the default mode the buffer
424 cache will only cache a fixed number of directories even if you have a huge
426 Turning on this sysctl allows the buffer cache to use
427 the VM Page Cache to cache the directories.
428 The advantage is that all of
429 memory is now available for caching directories.
430 The disadvantage is that
431 the minimum in-core memory used to cache a directory is the physical page
432 size (typically 4K) rather than 512 bytes.
433 We recommend turning this option off in memory-constrained environments;
434 however, when on, it will substantially improve the performance of services
435 that manipulate a large number of files.
436 Such services can include web caches, large mail systems, and news systems.
437 Turning on this option will generally not reduce performance even with the
438 wasted memory but you should experiment to find out.
442 sysctl defaults to 1 (on).
443 This tells the file system to issue media
444 writes as full clusters are collected, which typically occurs when writing
445 large sequential files.
446 The idea is to avoid saturating the buffer
447 cache with dirty buffers when it would not benefit I/O performance.
449 this may stall processes and under certain circumstances you may wish to turn
453 .Va vfs.hirunningspace
454 sysctl determines how much outstanding write I/O may be queued to
455 disk controllers system-wide at any given instance.
457 usually sufficient but on machines with lots of disks you may want to bump
458 it up to four or five megabytes.
459 Note that setting too high a value
460 (exceeding the buffer cache's write threshold) can lead to extremely
461 bad clustering performance.
462 Do not set this value arbitrarily high!
464 higher write queueing values may add latency to reads occurring at the same
467 There are various other buffer-cache and VM page cache related sysctls.
468 We do not recommend modifying these values.
471 the VM system does an extremely good job tuning itself.
474 .Va net.inet.tcp.sendspace
476 .Va net.inet.tcp.recvspace
477 sysctls are of particular interest if you are running network intensive
479 They control the amount of send and receive buffer space
480 allowed for any given TCP connection.
481 The default sending buffer is 32K; the default receiving buffer
484 improve bandwidth utilization by increasing the default at the cost of
485 eating up more kernel memory for each connection.
487 increasing the defaults if you are serving hundreds or thousands of
488 simultaneous connections because it is possible to quickly run the system
489 out of memory due to stalled connections building up.
491 high bandwidth over a fewer number of connections, especially if you have
492 gigabit Ethernet, increasing these defaults can make a huge difference.
493 You can adjust the buffer size for incoming and outgoing data separately.
494 For example, if your machine is primarily doing web serving you may want
495 to decrease the recvspace in order to be able to increase the
496 sendspace without eating too much kernel memory.
497 Note that the routing table (see
499 can be used to introduce route-specific send and receive buffer size
502 As an additional management tool you can use pipes in your
505 to limit the bandwidth going to or from particular IP blocks or ports.
506 For example, if you have a T1 you might want to limit your web traffic
507 to 70% of the T1's bandwidth in order to leave the remainder available
508 for mail and interactive use.
509 Normally a heavily loaded web server
510 will not introduce significant latencies into other services even if
511 the network link is maxed out, but enforcing a limit can smooth things
512 out and lead to longer term stability.
513 Many people also enforce artificial
514 bandwidth limitations in order to ensure that they are not charged for
515 using too much bandwidth.
517 Setting the send or receive TCP buffer to values larger than 65535 will result
518 in a marginal performance improvement unless both hosts support the window
519 scaling extension of the TCP protocol, which is controlled by the
520 .Va net.inet.tcp.rfc1323
522 These extensions should be enabled and the TCP buffer size should be set
523 to a value larger than 65536 in order to obtain good performance from
524 certain types of network links; specifically, gigabit WAN links and
525 high-latency satellite links.
526 RFC1323 support is enabled by default.
529 .Va net.inet.tcp.always_keepalive
530 sysctl determines whether or not the TCP implementation should attempt
531 to detect dead TCP connections by intermittently delivering
534 By default, this is enabled for all applications; by setting this
535 sysctl to 0, only applications that specifically request keepalives
537 In most environments, TCP keepalives will improve the management of
538 system state by expiring dead TCP connections, particularly for
539 systems serving dialup users who may not always terminate individual
540 TCP connections before disconnecting from the network.
541 However, in some environments, temporary network outages may be
542 incorrectly identified as dead sessions, resulting in unexpectedly
543 terminated TCP connections.
544 In such environments, setting the sysctl to 0 may reduce the occurrence of
545 TCP session disconnections.
548 .Va net.inet.tcp.delayed_ack
549 TCP feature is largely misunderstood.
550 Historically speaking, this feature
551 was designed to allow the acknowledgement to transmitted data to be returned
552 along with the response.
553 For example, when you type over a remote shell,
554 the acknowledgement to the character you send can be returned along with the
555 data representing the echo of the character.
556 With delayed acks turned off,
557 the acknowledgement may be sent in its own packet, before the remote service
558 has a chance to echo the data it just received.
559 This same concept also
560 applies to any interactive protocol (e.g.\& SMTP, WWW, POP3), and can cut the
561 number of tiny packets flowing across the network in half.
564 delayed ACK implementation also follows the TCP protocol rule that
565 at least every other packet be acknowledged even if the standard 100ms
566 timeout has not yet passed.
567 Normally the worst a delayed ACK can do is
568 slightly delay the teardown of a connection, or slightly delay the ramp-up
569 of a slow-start TCP connection.
570 While we are not sure we believe that
571 the several FAQs related to packages such as SAMBA and SQUID which advise
572 turning off delayed acks may be referring to the slow-start issue.
575 it would be more beneficial to increase the slow-start flightsize via
577 .Va net.inet.tcp.slowstart_flightsize
578 sysctl rather than disable delayed acks.
581 .Va net.inet.tcp.inflight.enable
582 sysctl turns on bandwidth delay product limiting for all TCP connections.
583 The system will attempt to calculate the bandwidth delay product for each
584 connection and limit the amount of data queued to the network to just the
585 amount required to maintain optimum throughput.
586 This feature is useful
587 if you are serving data over modems, GigE, or high speed WAN links (or
588 any other link with a high bandwidth*delay product), especially if you are
589 also using window scaling or have configured a large send window.
590 If you enable this option, you should also be sure to set
591 .Va net.inet.tcp.inflight.debug
592 to 0 (disable debugging), and for production use setting
593 .Va net.inet.tcp.inflight.min
594 to at least 6144 may be beneficial.
595 Note however, that setting high
596 minimums may effectively disable bandwidth limiting depending on the link.
597 The limiting feature reduces the amount of data built up in intermediate
598 router and switch packet queues as well as reduces the amount of data built
599 up in the local host's interface queue.
600 With fewer packets queued up,
601 interactive connections, especially over slow modems, will also be able
602 to operate with lower round trip times.
603 However, note that this feature
604 only affects data transmission (uploading / server-side).
606 affect data reception (downloading).
609 .Va net.inet.tcp.inflight.stab
611 This parameter defaults to 20, representing 2 maximal packets added
612 to the bandwidth delay product window calculation.
614 window is required to stabilize the algorithm and improve responsiveness
615 to changing conditions, but it can also result in higher ping times
616 over slow links (though still much lower than you would get without
617 the inflight algorithm).
618 In such cases you may
619 wish to try reducing this parameter to 15, 10, or 5, and you may also
621 .Va net.inet.tcp.inflight.min
622 (for example, to 3500) to get the desired effect.
623 Reducing these parameters
624 should be done as a last resort only.
627 .Va net.inet.ip.portrange.*
628 sysctls control the port number ranges automatically bound to TCP and UDP
630 There are three ranges: a low range, a default range, and a
631 high range, selectable via the
636 network programs use the default range which is controlled by
637 .Va net.inet.ip.portrange.first
639 .Va net.inet.ip.portrange.last ,
640 which default to 49152 and 65535, respectively.
641 Bound port ranges are
642 used for outgoing connections, and it is possible to run the system out
643 of ports under certain circumstances.
644 This most commonly occurs when you are
645 running a heavily loaded web proxy.
646 The port range is not an issue
647 when running a server which handles mainly incoming connections, such as a
648 normal web server, or has a limited number of outgoing connections, such
650 For situations where you may run out of ports,
651 we recommend decreasing
652 .Va net.inet.ip.portrange.first
654 A range of 10000 to 30000 ports may be reasonable.
655 You should also consider firewall effects when changing the port range.
657 may block large ranges of ports (usually low-numbered ports) and expect systems
658 to use higher ranges of ports for outgoing connections.
660 .Va net.inet.ip.portrange.last
661 is set at the maximum allowable port number.
664 .Va kern.ipc.somaxconn
665 sysctl limits the size of the listen queue for accepting new TCP connections.
666 The default value of 128 is typically too low for robust handling of new
667 connections in a heavily loaded web server environment.
668 For such environments,
669 we recommend increasing this value to 1024 or higher.
671 may itself limit the listen queue size (e.g.\&
674 often have a directive in its configuration file to adjust the queue size up.
675 Larger listen queues also do a better job of fending off denial of service
680 sysctl determines how many open files the system supports.
682 typically a few thousand but you may need to bump this up to ten or twenty
683 thousand if you are running databases or large descriptor-heavy daemons.
686 sysctl may be interrogated to determine the current number of open files
690 .Va vm.swap_idle_enabled
691 sysctl is useful in large multi-user systems where you have lots of users
692 entering and leaving the system and lots of idle processes.
694 tend to generate a great deal of continuous pressure on free memory reserves.
695 Turning this feature on and adjusting the swapout hysteresis (in idle
697 .Va vm.swap_idle_threshold1
699 .Va vm.swap_idle_threshold2
700 allows you to depress the priority of pages associated with idle processes
701 more quickly then the normal pageout algorithm.
702 This gives a helping hand
703 to the pageout daemon.
704 Do not turn this option on unless you need it,
705 because the tradeoff you are making is to essentially pre-page memory sooner
706 rather than later, eating more swap and disk bandwidth.
708 this option will have a detrimental effect but in a large system that is
709 already doing moderate paging this option allows the VM system to stage
710 whole processes into and out of memory more easily.
712 Some aspects of the system behavior may not be tunable at runtime because
713 memory allocations they perform must occur early in the boot process.
714 To change loader tunables, you must set their values in
716 and reboot the system.
719 controls the scaling of a number of static system tables, including defaults
720 for the maximum number of open files, sizing of network memory resources, etc.
724 is automatically sized at boot based on the amount of memory available in
725 the system, and may be determined at run-time by inspecting the value of the
729 Some sites will require larger or smaller values of
731 and may set it as a loader tunable; values of 64, 128, and 256 are not
733 We do not recommend going above 256 unless you need a huge number
734 of file descriptors; many of the tunable values set to their defaults by
736 may be individually overridden at boot-time or run-time as described
737 elsewhere in this document.
740 must set this value via the kernel
750 tunables set the default soft limits for process data and stack size
752 Processes may increase these up to the hard limits by calling
759 tunables set the hard limits for process data, stack, and text size
760 respectively; processes may not exceed these limits.
763 tunable controls how much the stack segment will grow when a process
764 needs to allocate more stack.
766 .Va kern.ipc.nmbclusters
767 may be adjusted to increase the number of network mbufs the system is
769 Each cluster represents approximately 2K of memory,
770 so a value of 1024 represents 2M of kernel memory reserved for network
772 You can do a simple calculation to figure out how many you need.
773 If you have a web server which maxes out at 1000 simultaneous connections,
774 and each connection eats a 16K receive and 16K send buffer, you need
775 approximately 32MB worth of network buffers to deal with it.
777 thumb is to multiply by 2, so 32MBx2 = 64MB/2K = 32768.
779 you would want to set
780 .Va kern.ipc.nmbclusters
782 We recommend values between
783 1024 and 4096 for machines with moderates amount of memory, and between 4096
784 and 32768 for machines with greater amounts of memory.
785 Under no circumstances
786 should you specify an arbitrarily high value for this parameter, it could
787 lead to a boot-time crash.
792 may be used to observe network cluster use.
795 do not have this tunable and require that the
802 More and more programs are using the
804 system call to transmit files over the network.
807 sysctl controls the number of file system buffers
809 is allowed to use to perform its work.
810 This parameter nominally scales
813 so you should not need to modify this parameter except under extreme
819 manual page for details.
820 .Sh KERNEL CONFIG TUNING
821 There are a number of kernel options that you may have to fiddle with in
822 a large-scale system.
823 In order to change these options you need to be
824 able to compile a new kernel from source.
827 manual page and the handbook are good starting points for learning how to
829 Generally the first thing you do when creating your own custom
830 kernel is to strip out all the drivers and services you do not use.
833 and drivers you do not have will reduce the size of your kernel, sometimes
834 by a megabyte or more, leaving more memory available for applications.
837 may be used to reduce system boot times.
838 The defaults are fairly high and
839 can be responsible for 5+ seconds of delay in the boot process.
842 to something below 5 seconds could work (especially with modern drives).
844 There are a number of
846 options that can be commented out.
847 If you only want the kernel to run
848 on a Pentium class CPU, you can easily remove
852 if you are sure your CPU is being recognized as a Pentium II or better.
853 Some clones may be recognized as a Pentium or even a 486 and not be able
854 to boot without those options.
857 will be able to better use higher-end CPU features for MMU, task switching,
858 timebase, and even device operations.
859 Additionally, higher-end CPUs support
860 4MB MMU pages, which the kernel uses to map the kernel itself into memory,
861 increasing its efficiency under heavy syscall loads.
862 .Sh IDE WRITE CACHING
864 flirted with turning off IDE write caching.
865 This reduced write bandwidth
866 to IDE disks but was considered necessary due to serious data consistency
867 issues introduced by hard drive vendors.
868 Basically the problem is that
869 IDE drives lie about when a write completes.
870 With IDE write caching turned
871 on, IDE hard drives will not only write data to disk out of order, they
872 will sometimes delay some of the blocks indefinitely under heavy disk
874 A crash or power failure can result in serious file system
876 So our default was changed to be safe.
878 result was such a huge loss in performance that we caved in and changed the
879 default back to on after the release.
880 You should check the default on
881 your system by observing the
884 If IDE write caching is turned off, you can turn it back
888 More information on tuning the ATA driver system may be found in the
891 If you need performance, go with SCSI.
892 .Sh CPU, MEMORY, DISK, NETWORK
893 The type of tuning you do depends heavily on where your system begins to
894 bottleneck as load increases.
895 If your system runs out of CPU (idle times
896 are perpetually 0%) then you need to consider upgrading the CPU or moving to
897 an SMP motherboard (multiple CPU's), or perhaps you need to revisit the
898 programs that are causing the load and try to optimize them.
900 is paging to swap a lot you need to consider adding more memory.
902 system is saturating the disk you typically see high CPU idle times and
903 total disk saturation.
905 can be used to monitor this.
906 There are many solutions to saturated disks:
907 increasing memory for caching, mirroring disks, distributing operations across
908 several machines, and so forth.
909 If disk performance is an issue and you
910 are using IDE drives, switching to SCSI can help a great deal.
912 IDE drives compare with SCSI in raw sequential bandwidth, the moment you
913 start seeking around the disk SCSI drives usually win.
915 Finally, you might run out of network suds.
916 The first line of defense for
917 improving network performance is to make sure you are using switches instead
918 of hubs, especially these days where switches are almost as cheap.
920 have severe problems under heavy loads due to collision back-off and one bad
921 host can severely degrade the entire LAN.
922 Second, optimize the network path
926 we describe a firewall protecting internal hosts with a topology where
927 the externally visible hosts are not routed through it.
929 than 10BaseT, or use 1000BaseT rather than 100BaseT, depending on your needs.
930 Most bottlenecks occur at the WAN link (e.g.\&
931 modem, T1, DSL, whatever).
932 If expanding the link is not an option it may be possible to use the
934 feature to implement peak shaving or other forms of traffic shaping to
935 prevent the overloaded service (such as web services) from affecting other
936 services (such as email), or vice versa.
937 In home installations this could
938 be used to give interactive traffic (your browser,
941 over services you export from your box (web services, email).
972 manual page was originally written by