Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Tuning TCP for Linux 2.4 and 2.6

Tuning TCP for Linux 2.4 and 2.6
NB: Recent versions of Linux (version 2.6.17 and later) have full autotuning with 4 MB maximum buffer sizes. Except in some rare cases, manual tuning is unlikely to substantially improve the performance of these kernels over most network paths, and is not generally recommended
Since autotuning and large default buffer sizes were released progressively over a succession of different kernel versions, it is best to inspect and only adjust the tuning as needed. When you upgrade kernels, you may want to consider removing any local tuning.
All system parameters can be read or set by accessing special files in the /proc file system. E.g.:
1
cat /proc/sys/net/ipv4/tcp_moderate_rcvbuf
If the parameter tcp_moderate_rcvbuf is present and has value 1 then autotuning is in effect. With autotuning, the receiver buffer size (and TCP window size) is dynamically updated (autotuned) for each connection. (Sender side autotuning has been present and unconditionally enabled for many years now).
The per connection memory space defaults are set with two 3 element arrays:
1
2
/proc/sys/net/ipv4/tcp_rmem - memory reserved for TCP rcv buffers
/proc/sys/net/ipv4/tcp_wmem - memory reserved for TCP snd buffers
These are arrays of three values: minimum, initial and maximum buffer size. They are used to set the bounds on autotuning and balance memory usage while under memory stress. Note that these are controls on the actual memory usage (not just TCP window size) and include memory used by the socket data structures as well as memory wasted by short packets in large buffers. The maximum values have to be larger than the BDP of the path by some suitable overhead.
With autotuning, the middle value just determines the initial buffer size. It is best to set it to some optimal value for typical small flows. With autotuning, excessively large initial buffer waste memory and can even hurt performance.
If autotuning is not present (Linu


Ïà¹ØÎĵµ£º

תÌû ¸ºÔؾùºâ ÔÚwindowÓëlinuxÏÂÅäÖÃnginx


×î½üÓÐЩʱ¼ä£¬¿ªÊ¼½Ó´¥¸ºÔؾùºâ·½ÃæµÄ¶«Î÷£¬´ÓÓ²¼þF5ÔÙµ½Citrix Netscalar¡£²»¹ýÒòΪӲ¼þµÄÅäÖÃËäÈ»²»¸´ÔÓ£¬µ«°º¹óµÄ¼Û¸ñÒ²ÈÃÒ»°ãÓû§Íû¶øÈ´²½(Ê®¼¸Íòµ½¼¸Ê®Íò)£¬ËùÒÔÖ»ÄÜתÏònginx,squidÕâÀàÓз´Ïò´úÀí¹¦ÄܵÄÈí¼þÁË¡£ºÃÔÚÆäÉèÖö¼²»ÊǺÜÂé·³¡£
      ±¾ÎľÍ֮ǰËù×ö¹ýµÄ°²×°ºÍÅäÖò½Öè×öÒ»Ï ......

×Ô¶¯Éú³ÉlinuxϵIJúÆ·ÉÏÏßÎļþ

    Èç¹ûÄãÊÇÒ»¸öÈí¼þ¿ª·¢ÈËÔ±£¬Èç¹ûÄãÊÇÒ»¸ö¾­³£×ö²úÆ·ÉÏÏß²Ù×÷µÄ³ÌÐòÔ±£¬ÄãÒ»¶¨»á¶ÔtarÃüÁîºÜÊìϤ£¬ËüÊÇÒ»¸ö´ò°üÃüÁµ«¾ßÌåµÄ´ò°üÄÚÈÝ¿ÉÄÜÊÇÒ»¸öºÜ³¤µÄÎļþÁÐ±í£¬Èç¹û²¿·ÖÎļþÉÏÏߵϰÈ˹¤ÖÆ×÷Ò»¸öÎļþÁбíÊÇÒ»¼þºÜÀ˷Ѿ«Á¦µÄÊÂÇé¡£
 
    ÓÚÊÇÎÒдÁËÒ»¸öshell½Å±¾,ÓÃÀ´²éÕÒ ......

Linux KernelÖÐlist½â¶Á


±êÇ©£º
it
·ÖÀࣺ
linux_kernel
×÷ÕߣºSam £¨Õç·å£© sam_code@hotmail.com
Sam֮ǰ¿´2.4
kernelʱ£¬³£¿´µ½List.Ò²×Ðϸ¿´ÁËһϣ¬µ«ÏÖÔÚ³¤ÆÚûÓп´kernel,ûÓÐд³ÌÐò£¬ÒѾ­Íü¼ÇÁ˺ܶࡣ½ñÌìÓÖ¿´Ò»¿´²¢¼Ç¼ÏÂÀ´¡£
Linux
KernelÖУ¬³£³£ÐèҪʹÓÃË«ÏòÁ´±í¡£ÔÚ~/include/linux/list.hÖУ¬¾Í¶¨ÒåÁËË«ÏòÁ´±íºÍ³£ÓõÄfunc ......

ÔÚlinuxÏÂÉú³É¿ÉÖ´ÐÐÎļþºÍ¿âÎļþ


l        
ÔÚ
Linux
ϱàдÆÕͨ¿ÉÖ´ÐÐÎļþµÄÃüÁ
gcc –o
Ä¿±êÎļþÃû

Ô´ÎļþÃû£¨ÁÐ±í£©
Èç¹û¹¤³Ì°üº¬¶à¸ö
.c
ºÍ
.h
ÄÇôÔÚÔ´ÎļþÃûÁбíÖÐÖ»ÁгöËùÓеÄ
.c
Îļþ
Àý£º¹¤³ÌÎļþ¼ÐÀïÓÐ
des.c 
hash.c 
main.c 
des.h 
hash ......

LinuxÏÂApache ÅäÖÃÎļþÏê½â


### Section 1: Global Environment
//µ±·þÎñÆ÷ÏìÓ¦Ö÷»úÍ·£¨header£©ÐÅϢʱÏÔʾApacheµÄ°æ±¾ºÍ²Ù×÷ϵͳÃû³Æ
ServerTokens OS
//ÉèÖ÷þÎñÆ÷µÄ¸ùĿ¼
ServerRoot "/etc/httpd"
#ScoreBoardFile run/httpd.scoreboard
//ÉèÖÃÔËÐÐApacheʱʹÓõÄPidFileµÄ·¾¶
PidFile run/httpd.pid
//Èô300ÃëºóûÓÐÊÕµ½»òËͳöÈκÎÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ