tuning.7 revision 87602
1.hlm 0 2.\" Copyright (c) 2001, Matthew Dillon. Terms and conditions are those of 3.\" the BSD Copyright as specified in the file "/usr/src/COPYRIGHT" in 4.\" the source tree. 5.\" 6.\" $FreeBSD: head/share/man/man7/tuning.7 87602 2001-12-10 09:26:30Z sheldonh $ 7.\" 8.Dd May 25, 2001 9.Dt TUNING 7 10.Os 11.Sh NAME 12.Nm tuning 13.Nd performance tuning under FreeBSD 14.Sh SYSTEM SETUP - DISKLABEL, NEWFS, TUNEFS, SWAP 15When using 16.Xr disklabel 8 17to lay out your filesystems on a hard disk it is important to remember 18that hard drives can transfer data much more quickly from outer tracks 19than they can from inner tracks. 20To take advantage of this you should 21try to pack your smaller filesystems and swap closer to the outer tracks, 22follow with the larger filesystems, and end with the largest filesystems. 23It is also important to size system standard filesystems such that you 24will not be forced to resize them later as you scale the machine up. 25I usually create, in order, a 128M root, 1G swap, 128M 26.Pa /var , 27128M 28.Pa /var/tmp , 293G 30.Pa /usr , 31and use any remaining space for 32.Pa /home . 33.Pp 34You should typically size your swap space to approximately 2x main memory. 35If you do not have a lot of RAM, though, you will generally want a lot 36more swap. 37It is not recommended that you configure any less than 38256M of swap on a system and you should keep in mind future memory 39expansion when sizing the swap partition. 40The kernel's VM paging algorithms are tuned to perform best when there is 41at least 2x swap versus main memory. 42Configuring too little swap can lead 43to inefficiencies in the VM page scanning code as well as create issues 44later on if you add more memory to your machine. 45Finally, on larger systems 46with multiple SCSI disks (or multiple IDE disks operating on different 47controllers), we strongly recommend that you configure swap on each drive 48(up to four drives). 49The swap partitions on the drives should be approximately the same size. 50The kernel can handle arbitrary sizes but 51internal data structures scale to 4 times the largest swap partition. 52Keeping 53the swap partitions near the same size will allow the kernel to optimally 54stripe swap space across the N disks. 55Don't worry about overdoing it a 56little, swap space is the saving grace of 57.Ux 58and even if you don't normally use much swap, it can give you more time to 59recover from a runaway program before being forced to reboot. 60.Pp 61How you size your 62.Pa /var 63partition depends heavily on what you intend to use the machine for. 64This 65partition is primarily used to hold mailboxes, the print spool, and log 66files. 67Some people even make 68.Pa /var/log 69its own partition (but except for extreme cases it isn't worth the waste 70of a partition ID). 71If your machine is intended to act as a mail 72or print server, 73or you are running a heavily visited web server, you should consider 74creating a much larger partition \(en perhaps a gig or more. 75It is very easy 76to underestimate log file storage requirements. 77.Pp 78Sizing 79.Pa /var/tmp 80depends on the kind of temporary file usage you think you will need. 81128M is 82the minimum we recommend. 83Also note that sysinstall will create a 84.Pa /tmp 85directory, but it is usually a good idea to make 86.Pa /tmp 87a softlink to 88.Pa /var/tmp 89after the fact. 90Dedicating a partition for temporary file storage is important for 91two reasons: first, it reduces the possibility of filesystem corruption 92in a crash, and second it reduces the chance of a runaway process that 93fills up 94.Oo Pa /var Oc Ns Pa /tmp 95from blowing up more critical subsystems (mail, 96logging, etc). 97Filling up 98.Oo Pa /var Oc Ns Pa /tmp 99is a very common problem to have. 100.Pp 101In the old days there were differences between 102.Pa /tmp 103and 104.Pa /var/tmp , 105but the introduction of 106.Pa /var 107(and 108.Pa /var/tmp ) 109led to massive confusion 110by program writers so today programs haphazardly use one or the 111other and thus no real distinction can be made between the two. 112So it makes sense to have just one temporary directory. 113However you handle 114.Pa /tmp , 115the one thing you do not want to do is leave it sitting 116on the root partition where it might cause root to fill up or possibly 117corrupt root in a crash/reboot situation. 118.Pp 119The 120.Pa /usr 121partition holds the bulk of the files required to support the system and 122a subdirectory within it called 123.Pa /usr/local 124holds the bulk of the files installed from the 125.Xr ports 7 126hierarchy. 127If you do not use ports all that much and do not intend to keep 128system source 129.Pq Pa /usr/src 130on the machine, you can get away with 131a 1 gigabyte 132.Pa /usr 133partition. 134However, if you install a lot of ports 135(especially window managers and linux-emulated binaries), we recommend 136at least a 2 gigabyte 137.Pa /usr 138and if you also intend to keep system source 139on the machine, we recommend a 3 gigabyte 140.Pa /usr . 141Do not underestimate the 142amount of space you will need in this partition, it can creep up and 143surprise you! 144.Pp 145The 146.Pa /home 147partition is typically used to hold user-specific data. 148I usually size it to the remainder of the disk. 149.Pp 150Why partition at all? 151Why not create one big 152.Pa / 153partition and be done with it? 154Then I don't have to worry about undersizing things! 155Well, there are several reasons this isn't a good idea. 156First, 157each partition has different operational characteristics and separating them 158allows the filesystem to tune itself to those characteristics. 159For example, 160the root and 161.Pa /usr 162partitions are read-mostly, with very little writing, while 163a lot of reading and writing could occur in 164.Pa /var 165and 166.Pa /var/tmp . 167By properly 168partitioning your system fragmentation introduced in the smaller more 169heavily write-loaded partitions will not bleed over into the mostly-read 170partitions. 171Additionally, keeping the write-loaded partitions closer to 172the edge of the disk (i.e. before the really big partitions instead of after 173in the partition table) will increase I/O performance in the partitions 174where you need it the most. 175Now it is true that you might also need I/O 176performance in the larger partitions, but they are so large that shifting 177them more towards the edge of the disk will not lead to a significant 178performance improvement whereas moving 179.Pa /var 180to the edge can have a huge impact. 181Finally, there are safety concerns. 182Having a small neat root partition that 183is essentially read-only gives it a greater chance of surviving a bad crash 184intact. 185.Pp 186Properly partitioning your system also allows you to tune 187.Xr newfs 8 , 188and 189.Xr tunefs 8 190parameters. 191Tuning 192.Xr newfs 8 193requires more experience but can lead to significant improvements in 194performance. 195There are three parameters that are relatively safe to tune: 196.Em blocksize , bytes/inode , 197and 198.Em cylinders/group . 199.Pp 200.Fx 201performs best when using 8K or 16K filesystem block sizes. 202The default filesystem block size is 8K. 203For larger partitions it is usually a good 204idea to use a 16K block size. 205This also requires you to specify a larger 206fragment size. 207We recommend always using a fragment size that is 1/8 208the block size (less testing has been done on other fragment size factors). 209The 210.Xr newfs 8 211options for this would be 212.Dq Li "newfs -f 2048 -b 16384 ..." . 213Using a larger block size can cause fragmentation of the buffer cache and 214lead to lower performance. 215.Pp 216If a large partition is intended to be used to hold fewer, larger files, such 217as a database files, you can increase the 218.Em bytes/inode 219ratio which reduces the number of inodes (maximum number of files and 220directories that can be created) for that partition. 221Decreasing the number 222of inodes in a filesystem can greatly reduce 223.Xr fsck 8 224recovery times after a crash. 225Do not use this option 226unless you are actually storing large files on the partition, because if you 227overcompensate you can wind up with a filesystem that has lots of free 228space remaining but cannot accommodate any more files. 229Using 32768, 65536, or 262144 bytes/inode is recommended. 230You can go higher but 231it will have only incremental effects on 232.Xr fsck 8 233recovery times. 234For example, 235.Dq Li "newfs -i 32768 ..." . 236.Pp 237.Xr tunefs 8 238may be used to further tune a filesystem. 239This command can be run in 240single-user mode without having to reformat the filesystem. 241However, this is possibly the most abused program in the system. 242Many people attempt to 243increase available filesystem space by setting the min-free percentage to 0. 244This can lead to severe filesystem fragmentation and we do not recommend 245that you do this. 246Really the only 247.Xr tunefs 8 248option worthwhile here is turning on 249.Em softupdates 250with 251.Dq Li "tunefs -n enable /filesystem" . 252(Note: in 253.Fx 2545.x 255softupdates can be turned on using the 256.Fl U 257option to 258.Xr newfs 8 ) . 259Softupdates drastically improves meta-data performance, mainly file 260creation and deletion. 261We recommend enabling softupdates on all of your 262filesystems. 263There are two downsides to softupdates that you should be 264aware of. 265First, softupdates guarantees filesystem consistency in the 266case of a crash but could very easily be several seconds (even a minute!) 267behind updating the physical disk. 268If you crash you may lose more work 269than otherwise. 270Secondly, softupdates delays the freeing of filesystem 271blocks. 272If you have a filesystem (such as the root filesystem) which is 273close to full, doing a major update of it, e.g.\& 274.Dq Li "make installworld" , 275can run it out of space and cause the update to fail. 276.Pp 277A number of run-time 278.Xr mount 8 279options exist that can help you tune the system. 280The most obvious and most dangerous one is 281.Cm async . 282Don't ever use it, it is far too dangerous. 283A less dangerous and more 284useful 285.Xr mount 8 286option is called 287.Cm noatime . 288.Ux 289filesystems normally update the last-accessed time of a file or 290directory whenever it is accessed. 291This operation is handled in 292.Fx 293with a delayed write and normally does not create a burden on the system. 294However, if your system is accessing a huge number of files on a continuing 295basis the buffer cache can wind up getting polluted with atime updates, 296creating a burden on the system. 297For example, if you are running a heavily 298loaded web site, or a news server with lots of readers, you might want to 299consider turning off atime updates on your larger partitions with this 300.Xr mount 8 301option. 302However, you should not gratuitously turn off atime 303updates everywhere. 304For example, the 305.Pa /var 306filesystem customarily 307holds mailboxes, and atime (in combination with mtime) is used to 308determine whether a mailbox has new mail. 309You might as well leave 310atime turned on for mostly read-only partitions such as 311.Pa / 312and 313.Pa /usr 314as well. 315This is especially useful for 316.Pa / 317since some system utilities 318use the atime field for reporting. 319.Sh STRIPING DISKS 320In larger systems you can stripe partitions from several drives together 321to create a much larger overall partition. 322Striping can also improve 323the performance of a filesystem by splitting I/O operations across two 324or more disks. 325The 326.Xr vinum 8 327and 328.Xr ccdconfig 8 329utilities may be used to create simple striped filesystems. 330Generally 331speaking, striping smaller partitions such as the root and 332.Pa /var/tmp , 333or essentially read-only partitions such as 334.Pa /usr 335is a complete waste of time. 336You should only stripe partitions that require serious I/O performance, 337typically 338.Pa /var , /home , 339or custom partitions used to hold databases and web pages. 340Choosing the proper stripe size is also 341important. 342Filesystems tend to store meta-data on power-of-2 boundaries 343and you usually want to reduce seeking rather than increase seeking. 344This 345means you want to use a large off-center stripe size such as 1152 sectors 346so sequential I/O does not seek both disks and so meta-data is distributed 347across both disks rather than concentrated on a single disk. 348If 349you really need to get sophisticated, we recommend using a real hardware 350RAID controller from the list of 351.Fx 352supported controllers. 353.Sh SYSCTL TUNING 354There are several hundred 355.Xr sysctl 8 356variables in the system, including many that appear to be candidates for 357tuning but actually aren't. 358In this document we will only cover the ones 359that have the greatest effect on the system. 360.Pp 361The 362.Va kern.ipc.shm_use_phys 363sysctl defaults to 0 (off) and may be set to 0 (off) or 1 (on). 364Setting 365this parameter to 1 will cause all System V shared memory segments to be 366mapped to unpageable physical RAM. 367This feature only has an effect if you 368are either (A) mapping small amounts of shared memory across many (hundreds) 369of processes, or (B) mapping large amounts of shared memory across any 370number of processes. 371This feature allows the kernel to remove a great deal 372of internal memory management page-tracking overhead at the cost of wiring 373the shared memory into core, making it unswappable. 374.Pp 375The 376.Va vfs.vmiodirenable 377sysctl defaults to 1 (on). 378This parameter controls how directories are cached 379by the system. 380Most directories are small and use but a single fragment 381(typically 1K) in the filesystem and even less (typically 512 bytes) in 382the buffer cache. 383However, when operating in the default mode the buffer 384cache will only cache a fixed number of directories even if you have a huge 385amount of memory. 386Turning on this sysctl allows the buffer cache to use 387the VM Page Cache to cache the directories. 388The advantage is that all of 389memory is now available for caching directories. 390The disadvantage is that 391the minimum in-core memory used to cache a directory is the physical page 392size (typically 4K) rather than 512 bytes. 393We recommend turning this option off in memory-constrained environments; 394however, when on, it will substantially improve the performance of services 395which manipulate large numbers of files. 396Such services can include web caches, large mail systems, and news systems. 397Turning on this option will generally not reduce performance even with the 398wasted memory but you should experiment to find out. 399.Pp 400There are various buffer-cache and VM page cache related sysctls. 401We do not recommend modifying those values. 402As of 403.Fx 4.3 , 404the VM system does an extremely good job tuning itself. 405.Pp 406The 407.Va net.inet.tcp.sendspace 408and 409.Va net.inet.tcp.recvspace 410sysctls are of particular interest if you are running network intensive 411applications. 412This controls the amount of send and receive buffer space 413allowed for any given TCP connection. 414The default sending buffer is 32k; the default receiving buffer 415is 64k. 416You can often 417improve bandwidth utilization by increasing the default at the cost of 418eating up more kernel memory for each connection. 419We do not recommend 420increasing the defaults if you are serving hundreds or thousands of 421simultaneous connections because it is possible to quickly run the system 422out of memory due to stalled connections building up. 423But if you need 424high bandwidth over a fewer number of connections, especially if you have 425gigabit ethernet, increasing these defaults can make a huge difference. 426You can adjust the buffer size for incoming and outgoing data separately. 427For example, if your machine is primarily doing web serving you may want 428to decrease the recvspace in order to be able to increase the 429sendspace without eating too much kernel memory. 430Note that the routing table (see 431.Xr route 8 ) 432can be used to introduce route-specific send and receive buffer size 433defaults. 434.Pp 435As an additional management tool you can use pipes in your 436firewall rules (see 437.Xr ipfw 8 ) 438to limit the bandwidth going to or from particular IP blocks or ports. 439For example, if you have a T1 you might want to limit your web traffic 440to 70% of the T1's bandwidth in order to leave the remainder available 441for mail and interactive use. 442Normally a heavily loaded web server 443will not introduce significant latencies into other services even if 444the network link is maxed out, but enforcing a limit can smooth things 445out and lead to longer term stability. 446Many people also enforce artificial 447bandwidth limitations in order to ensure that they are not charged for 448using too much bandwidth. 449.Pp 450Setting the send or receive TCP buffer to values larger then 65535 will result 451in a marginal performance improvement unless both hosts support the window 452scaling extension of the TCP protocol, which is controlled by the 453.Va net.inet.tcp.rfc1323 454sysctl. 455These extensions should be enabled and the TCP buffer size should be set 456to a value larger than 65536 in order to obtain good performance out of 457certain types of network links; specifically, gigabit WAN links and 458high-latency satellite links. 459RFC1323 support is enabled by default. 460.Pp 461The 462.Va net.inet.tcp.always_keepalive 463sysctl determines whether or not the TCP implementation should attempt 464to detect dead TCP connections by intermittently delivering "keepalives" 465on the connection. 466By default, this is enabled for all applications; by setting this 467sysctl to 0, only applications that specifically request keepalives 468will use them. 469In most environments, TCP keepalives will improve the management of 470system state by expiring dead TCP connections, particularly for 471systems serving dialup users who may not always terminate individual 472TCP connections before disconnecting from the network. 473However, in some environments, temporary network outages may be 474incorrectly identified as dead sessions, resulting in unexpectedly 475terminated TCP connections. 476In such environments, setting the sysctl to 0 may reduce the occurrence of 477TCP session disconnections. 478.Pp 479The 480.Va kern.ipc.somaxconn 481sysctl limits the size of the listen queue for accepting new TCP connections. 482The default value of 128 is typically too low for robust handling of new 483connections in a heavily loaded web server environment. 484For such environments, 485we recommend increasing this value to 1024 or higher. 486The service daemon 487may itself limit the listen queue size (e.g.\& 488.Xr sendmail 8 , 489apache) but will 490often have a directive in its configuration file to adjust the queue size up. 491Larger listen queues also do a better job of fending off denial of service 492attacks. 493.Pp 494The 495.Va kern.maxfiles 496sysctl determines how many open files the system supports. 497The default is 498typically a few thousand but you may need to bump this up to ten or twenty 499thousand if you are running databases or large descriptor-heavy daemons. 500The read-only 501.Va kern.openfiles 502sysctl may be interrogated to determine the current number of open files 503on the system. 504.Pp 505The 506.Va vm.swap_idle_enabled 507sysctl is useful in large multi-user systems where you have lots of users 508entering and leaving the system and lots of idle processes. 509Such systems 510tend to generate a great deal of continuous pressure on free memory reserves. 511Turning this feature on and adjusting the swapout hysteresis (in idle 512seconds) via 513.Va vm.swap_idle_threshold1 514and 515.Va vm.swap_idle_threshold2 516allows you to depress the priority of pages associated with idle processes 517more quickly then the normal pageout algorithm. 518This gives a helping hand 519to the pageout daemon. 520Do not turn this option on unless you need it, 521because the tradeoff you are making is to essentially pre-page memory sooner 522rather then later, eating more swap and disk bandwidth. 523In a small system 524this option will have a detrimental effect but in a large system that is 525already doing moderate paging this option allows the VM system to stage 526whole processes into and out of memory more easily. 527.Sh LOADER TUNABLES 528Some aspects of the system behavior may not be tunable at runtime because 529memory allocations they perform must occur early in the boot process. 530To change loader tunables, you must set their value in 531.Xr loader.conf 5 532and reboot the system. 533.Pp 534The 535.Va kern.maxusers 536tunable defaults to an incredibly low value. 537For most modern machines, 538you probably want to increase this value to 64, 128, or 256. 539We do not 540recommend going above 256 unless you need a huge number of file descriptors. 541Network buffers are also affected but can be controlled with a separate 542kernel option. 543Do not increase maxusers just to get more network mbufs. 544Systems older than 545.Fx 4.4 546do not have this loader tunable and require that 547the kernel 548.Xr config 8 549option 550.Cd maxusers 551be set instead. 552.Pp 553.Va kern.ipc.nmbclusters 554may be adjusted to increase the number of network mbufs the system is 555willing to allocate. 556Each cluster represents approximately 2K of memory, 557so a value of 1024 represents 2M of kernel memory reserved for network 558buffers. 559You can do a simple calculation to figure out how many you need. 560If you have a web server which maxes out at 1000 simultaneous connections, 561and each connection eats a 16K receive and 16K send buffer, you need 562approximate 32MB worth of network buffers to deal with it. 563A good rule of 564thumb is to multiply by 2, so 32MBx2 = 64MB/2K = 32768. 565So for this case 566you would want to set 567.Va kern.ipc.nmbclusters 568to 32768. 569We recommend values between 5701024 and 4096 for machines with moderates amount of memory, and between 4096 571and 32768 for machines with greater amounts of memory. 572Under no circumstances 573should you specify an arbitrarily high value for this parameter, it could 574lead to a boot-time crash. 575The 576.Fl m 577option to 578.Xr netstat 1 579may be used to observe network cluster use. 580Older versions of 581.Fx 582do not have this tunable and require that the 583kernel 584.Xr config 8 585option 586.Dv NMBCLUSTERS 587be set instead. 588.Pp 589More and more programs are using the 590.Xr sendfile 2 591system call to transmit files over the network. 592The 593.Va kern.ipc.nsfbufs 594sysctl controls the number of filesystem buffers 595.Xr sendfile 2 596is allowed to use to perform its work. 597This parameter nominally scales 598with 599.Va kern.maxusers 600so you should not need to modify this parameter except under extreme 601circumstances. 602.Sh KERNEL CONFIG TUNING 603There are a number of kernel options that you may have to fiddle with in 604a large scale system. 605In order to change these options you need to be 606able to compile a new kernel from source. 607The 608.Xr config 8 609manual page and the handbook are good starting points for learning how to 610do this. 611Generally the first thing you do when creating your own custom 612kernel is to strip out all the drivers and services you don't use. 613Removing things like 614.Dv INET6 615and drivers you don't have will reduce the size of your kernel, sometimes 616by a megabyte or more, leaving more memory available for applications. 617.Pp 618.Dv SCSI_DELAY 619and 620.Dv IDE_DELAY 621may be used to reduce system boot times. 622The defaults are fairly high and 623can be responsible for 15+ seconds of delay in the boot process. 624Reducing 625.Dv SCSI_DELAY 626to 5 seconds usually works (especially with modern drives). 627Reducing 628.Dv IDE_DELAY 629also works but you have to be a little more careful. 630.Pp 631There are a number of 632.Dv *_CPU 633options that can be commented out. 634If you only want the kernel to run 635on a Pentium class CPU, you can easily remove 636.Dv I386_CPU 637and 638.Dv I486_CPU , 639but only remove 640.Dv I586_CPU 641if you are sure your CPU is being recognized as a Pentium II or better. 642Some clones may be recognized as a Pentium or even a 486 and not be able 643to boot without those options. 644If it works, great! 645The operating system 646will be able to better-use higher-end CPU features for MMU, task switching, 647timebase, and even device operations. 648Additionally, higher-end CPUs support 6494MB MMU pages which the kernel uses to map the kernel itself into memory, 650which increases its efficiency under heavy syscall loads. 651.Sh IDE WRITE CACHING 652.Fx 4.3 653flirted with turning off IDE write caching. 654This reduced write bandwidth 655to IDE disks but was considered necessary due to serious data consistency 656issues introduced by hard drive vendors. 657Basically the problem is that 658IDE drives lie about when a write completes. 659With IDE write caching turned 660on, IDE hard drives will not only write data to disk out of order, they 661will sometimes delay some of the blocks indefinitely when under heavy disk 662loads. 663A crash or power failure can result in serious filesystem 664corruption. 665So our default was changed to be safe. 666Unfortunately, the 667result was such a huge loss in performance that we caved in and changed the 668default back to on after the release. 669You should check the default on 670your system by observing the 671.Va hw.ata.wc 672sysctl variable. 673If IDE write caching is turned off, you can turn it back 674on by setting the 675.Va hw.ata.wc 676kernel variable back to 1. 677This must be done from the boot 678.Xr loader 8 679at boot time. 680Attempting to do it after the kernel boots will have no effect. 681Please see 682.Xr ata 4 683and 684.Xr loader 8 . 685.Pp 686There is a new experimental feature for IDE hard drives called 687.Va hw.ata.tags 688(you also set this in the boot loader) which allows write caching to be safely 689turned on. 690This brings SCSI tagging features to IDE drives. 691As of this 692writing only IBM DPTA and DTLA drives support the feature. 693Warning! 694These 695drives apparently have quality control problems and I do not recommend 696purchasing them at this time. 697If you need performance, go with SCSI. 698.Sh CPU, MEMORY, DISK, NETWORK 699The type of tuning you do depends heavily on where your system begins to 700bottleneck as load increases. 701If your system runs out of CPU (idle times 702are perpetually 0%) then you need to consider upgrading the CPU or moving to 703an SMP motherboard (multiple CPU's), or perhaps you need to revisit the 704programs that are causing the load and try to optimize them. 705If your system 706is paging to swap a lot you need to consider adding more memory. 707If your 708system is saturating the disk you typically see high CPU idle times and 709total disk saturation. 710.Xr systat 1 711can be used to monitor this. 712There are many solutions to saturated disks: 713increasing memory for caching, mirroring disks, distributing operations across 714several machines, and so forth. 715If disk performance is an issue and you 716are using IDE drives, switching to SCSI can help a great deal. 717While modern 718IDE drives compare with SCSI in raw sequential bandwidth, the moment you 719start seeking around the disk SCSI drives usually win. 720.Pp 721Finally, you might run out of network suds. 722The first line of defense for 723improving network performance is to make sure you are using switches instead 724of hubs, especially these days where switches are almost as cheap. 725Hubs 726have severe problems under heavy loads due to collision backoff and one bad 727host can severely degrade the entire LAN. 728Second, optimize the network path 729as much as possible. 730For example, in 731.Xr firewall 7 732we describe a firewall protecting internal hosts with a topology where 733the externally visible hosts are not routed through it. 734Use 100BaseT rather 735than 10BaseT, or use 1000BaseT rather then 100BaseT, depending on your needs. 736Most bottlenecks occur at the WAN link (e.g.\& 737modem, T1, DSL, whatever). 738If expanding the link is not an option it may be possible to use 739.Xr dummynet 4 740feature to implement peak shaving or other forms of traffic shaping to 741prevent the overloaded service (such as web services) from affecting other 742services (such as email), or vice versa. 743In home installations this could 744be used to give interactive traffic (your browser, 745.Xr ssh 1 746logins) priority 747over services you export from your box (web services, email). 748.Sh SEE ALSO 749.Xr netstat 1 , 750.Xr systat 1 , 751.Xr ata 4 , 752.Xr dummynet 4 , 753.Xr login.conf 5 , 754.Xr firewall 7 , 755.Xr hier 7 , 756.Xr ports 7 , 757.Xr boot 8 , 758.Xr ccdconfig 8 , 759.Xr config 8 , 760.Xr disklabel 8 , 761.Xr fsck 8 , 762.Xr ifconfig 8 , 763.Xr ipfw 8 , 764.Xr loader 8 , 765.Xr mount 8 , 766.Xr newfs 8 , 767.Xr route 8 , 768.Xr sysctl 8 , 769.Xr tunefs 8 , 770.Xr vinum 8 771.Sh HISTORY 772The 773.Nm 774manual page was originally written by 775.An Matthew Dillon 776and first appeared 777in 778.Fx 4.3 , 779May 2001. 780