|
Lines 223-229
Link Here
|
| 223 |
.Dq Li "newfs -f 1024 -b 8192 ..." . |
223 |
.Dq Li "newfs -f 1024 -b 8192 ..." . |
| 224 |
.Pp |
224 |
.Pp |
| 225 |
If a large partition is intended to be used to hold fewer, larger files, such |
225 |
If a large partition is intended to be used to hold fewer, larger files, such |
| 226 |
as a database files, you can increase the |
226 |
as database files, you can increase the |
| 227 |
.Em bytes/inode |
227 |
.Em bytes/inode |
| 228 |
ratio which reduces the number of inodes (maximum number of files and |
228 |
ratio which reduces the number of inodes (maximum number of files and |
| 229 |
directories that can be created) for that partition. |
229 |
directories that can be created) for that partition. |
|
Lines 273-279
Link Here
|
| 273 |
aware of. |
273 |
aware of. |
| 274 |
First, softupdates guarantees filesystem consistency in the |
274 |
First, softupdates guarantees filesystem consistency in the |
| 275 |
case of a crash but could very easily be several seconds (even a minute!) |
275 |
case of a crash but could very easily be several seconds (even a minute!) |
| 276 |
behind updating the physical disk. |
276 |
behind on pending writes to the physical disk. |
| 277 |
If you crash you may lose more work |
277 |
If you crash you may lose more work |
| 278 |
than otherwise. |
278 |
than otherwise. |
| 279 |
Secondly, softupdates delays the freeing of filesystem |
279 |
Secondly, softupdates delays the freeing of filesystem |
|
Lines 288-294
Link Here
|
| 288 |
options exist that can help you tune the system. |
288 |
options exist that can help you tune the system. |
| 289 |
The most obvious and most dangerous one is |
289 |
The most obvious and most dangerous one is |
| 290 |
.Cm async . |
290 |
.Cm async . |
| 291 |
Don't ever use it, it is far too dangerous. |
291 |
Don't ever use it; it is far too dangerous. |
| 292 |
A less dangerous and more |
292 |
A less dangerous and more |
| 293 |
useful |
293 |
useful |
| 294 |
.Xr mount 8 |
294 |
.Xr mount 8 |
|
Lines 425-431
Link Here
|
| 425 |
.Va net.inet.tcp.recvspace |
425 |
.Va net.inet.tcp.recvspace |
| 426 |
sysctls are of particular interest if you are running network intensive |
426 |
sysctls are of particular interest if you are running network intensive |
| 427 |
applications. |
427 |
applications. |
| 428 |
This controls the amount of send and receive buffer space |
428 |
They control the amount of send and receive buffer space |
| 429 |
allowed for any given TCP connection. |
429 |
allowed for any given TCP connection. |
| 430 |
The default sending buffer is 32K; the default receiving buffer |
430 |
The default sending buffer is 32K; the default receiving buffer |
| 431 |
is 64K. |
431 |
is 64K. |
|
Lines 442-448
Link Here
|
| 442 |
You can adjust the buffer size for incoming and outgoing data separately. |
442 |
You can adjust the buffer size for incoming and outgoing data separately. |
| 443 |
For example, if your machine is primarily doing web serving you may want |
443 |
For example, if your machine is primarily doing web serving you may want |
| 444 |
to decrease the recvspace in order to be able to increase the |
444 |
to decrease the recvspace in order to be able to increase the |
| 445 |
sendspace without eating too much kernel memory. |
445 |
sendspace without using too much kernel memory. |
| 446 |
Note that the routing table (see |
446 |
Note that the routing table (see |
| 447 |
.Xr route 8 ) |
447 |
.Xr route 8 ) |
| 448 |
can be used to introduce route-specific send and receive buffer size |
448 |
can be used to introduce route-specific send and receive buffer size |
|
Lines 469-475
Link Here
|
| 469 |
.Va net.inet.tcp.rfc1323 |
469 |
.Va net.inet.tcp.rfc1323 |
| 470 |
sysctl. |
470 |
sysctl. |
| 471 |
These extensions should be enabled and the TCP buffer size should be set |
471 |
These extensions should be enabled and the TCP buffer size should be set |
| 472 |
to a value larger than 65536 in order to obtain good performance out of |
472 |
to a value larger than 65536 in order to obtain good performance from |
| 473 |
certain types of network links; specifically, gigabit WAN links and |
473 |
certain types of network links; specifically, gigabit WAN links and |
| 474 |
high-latency satellite links. |
474 |
high-latency satellite links. |
| 475 |
RFC1323 support is enabled by default. |
475 |
RFC1323 support is enabled by default. |
|
Lines 577-583
Link Here
|
| 577 |
You can do a simple calculation to figure out how many you need. |
577 |
You can do a simple calculation to figure out how many you need. |
| 578 |
If you have a web server which maxes out at 1000 simultaneous connections, |
578 |
If you have a web server which maxes out at 1000 simultaneous connections, |
| 579 |
and each connection eats a 16K receive and 16K send buffer, you need |
579 |
and each connection eats a 16K receive and 16K send buffer, you need |
| 580 |
approximate 32MB worth of network buffers to deal with it. |
580 |
approximately 32MB worth of network buffers to deal with it. |
| 581 |
A good rule of |
581 |
A good rule of |
| 582 |
thumb is to multiply by 2, so 32MBx2 = 64MB/2K = 32768. |
582 |
thumb is to multiply by 2, so 32MBx2 = 64MB/2K = 32768. |
| 583 |
So for this case |
583 |
So for this case |
|
Lines 619-625
Link Here
|
| 619 |
circumstances. |
619 |
circumstances. |
| 620 |
.Sh KERNEL CONFIG TUNING |
620 |
.Sh KERNEL CONFIG TUNING |
| 621 |
There are a number of kernel options that you may have to fiddle with in |
621 |
There are a number of kernel options that you may have to fiddle with in |
| 622 |
a large scale system. |
622 |
a large-scale system. |
| 623 |
In order to change these options you need to be |
623 |
In order to change these options you need to be |
| 624 |
able to compile a new kernel from source. |
624 |
able to compile a new kernel from source. |
| 625 |
The |
625 |
The |
|
Lines 661-671
Link Here
|
| 661 |
to boot without those options. |
661 |
to boot without those options. |
| 662 |
If it works, great! |
662 |
If it works, great! |
| 663 |
The operating system |
663 |
The operating system |
| 664 |
will be able to better-use higher-end CPU features for MMU, task switching, |
664 |
will be able to better use higher-end CPU features for MMU, task switching, |
| 665 |
timebase, and even device operations. |
665 |
timebase, and even device operations. |
| 666 |
Additionally, higher-end CPUs support |
666 |
Additionally, higher-end CPUs support |
| 667 |
4MB MMU pages which the kernel uses to map the kernel itself into memory, |
667 |
4MB MMU pages, which the kernel uses to map the kernel itself into memory, |
| 668 |
which increases its efficiency under heavy syscall loads. |
668 |
increasing its efficiency under heavy syscall loads. |
| 669 |
.Sh IDE WRITE CACHING |
669 |
.Sh IDE WRITE CACHING |
| 670 |
.Fx 4.3 |
670 |
.Fx 4.3 |
| 671 |
flirted with turning off IDE write caching. |
671 |
flirted with turning off IDE write caching. |
|
Lines 676-683
Link Here
|
| 676 |
IDE drives lie about when a write completes. |
676 |
IDE drives lie about when a write completes. |
| 677 |
With IDE write caching turned |
677 |
With IDE write caching turned |
| 678 |
on, IDE hard drives will not only write data to disk out of order, they |
678 |
on, IDE hard drives will not only write data to disk out of order, they |
| 679 |
will sometimes delay some of the blocks indefinitely when under heavy disk |
679 |
will sometimes delay some of the blocks indefinitely under heavy disk |
| 680 |
loads. |
680 |
load. |
| 681 |
A crash or power failure can result in serious filesystem |
681 |
A crash or power failure can result in serious filesystem |
| 682 |
corruption. |
682 |
corruption. |
| 683 |
So our default was changed to be safe. |
683 |
So our default was changed to be safe. |
|
Lines 692-699
Link Here
|
| 692 |
on by setting the |
692 |
on by setting the |
| 693 |
.Va hw.ata.wc |
693 |
.Va hw.ata.wc |
| 694 |
loader tunable to 1. |
694 |
loader tunable to 1. |
| 695 |
More information on tuning the ATA driver system may be found in |
695 |
More information on tuning the ATA driver system may be found in the |
| 696 |
.Xr ata 4. |
696 |
.Xr ata 4 |
|
|
697 |
man page. |
| 697 |
.Pp |
698 |
.Pp |
| 698 |
There is a new experimental feature for IDE hard drives called |
699 |
There is a new experimental feature for IDE hard drives called |
| 699 |
.Va hw.ata.tags |
700 |
.Va hw.ata.tags |
|
Lines 747-753
Link Here
|
| 747 |
than 10BaseT, or use 1000BaseT rather then 100BaseT, depending on your needs. |
748 |
than 10BaseT, or use 1000BaseT rather then 100BaseT, depending on your needs. |
| 748 |
Most bottlenecks occur at the WAN link (e.g.\& |
749 |
Most bottlenecks occur at the WAN link (e.g.\& |
| 749 |
modem, T1, DSL, whatever). |
750 |
modem, T1, DSL, whatever). |
| 750 |
If expanding the link is not an option it may be possible to use |
751 |
If expanding the link is not an option it may be possible to use the |
| 751 |
.Xr dummynet 4 |
752 |
.Xr dummynet 4 |
| 752 |
feature to implement peak shaving or other forms of traffic shaping to |
753 |
feature to implement peak shaving or other forms of traffic shaping to |
| 753 |
prevent the overloaded service (such as web services) from affecting other |
754 |
prevent the overloaded service (such as web services) from affecting other |