Linux UDPÑÏÖضª°üÎÊÌâµÄ½â¾ö
²âÊÔϵͳÔÚLinuxÉϵÄÐÔÄÜ·¢ÏÖ¶ª°üÂʼ«ÎªÑÏÖØ£¬·¢210000ÌõÊý¾Ý£¬¶ª°ü´ï110000Ö®¾Þ£¬¶ª°üÂʳ¬¹ý50%¡£Í¬µÈÇéÐÎÏÂWindowsÉϲâÊÔ£¬½ö¶ª¼¸ÌõÊý¾Ý¡£ÐÎÊÆÑϾþ£¬±ØÐë½â¾ö¡£¿¼ÂÇ¿ÉÄÜÊÇÒòΪÐÒéÕ»BufferÌ«µÍËùÖ£¬ÓÚÊÇÏÈ¿´¿´Ä¬ÈÏÇé¿ö£º
sysctl -a |grep net.core
·¢ÏÖ
net.core.rmem_max = 131071
net.core.rmem_default = 112640
Ð޸İɣ¬±ä´óÒ»µã£¬±ä³É10M£¬È»ºóreboot£¨Ó¦¸ÃÖØÆôij¸ö·þÎñ¼´¿É£©
È»ºó²éÍø¿¨ÊÕ°üÇé¿ö£º
netstat -su
½á¹ûÈçÏ£º
Udp:
97690 packets received
112310 packets to unknown port received.
0 packet receive errors
20 packets sent
·¢ÏÖÊý¾ÝÔÚÍø¿¨¾Í¶ªÁË£¬ÅжϿÉÄÜÊÇ·À»ðǽÒýÆðµÄ£¬ÓÚÊÇÖ´ÐÐÃüÁ
iptables -L
½á¹ûÈçÏ£º
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Ö¤Ã÷iptablesÆô¶¯£¬ÓÚÊÇÍ£Ö¹·À»ðǽ£º
service iptables stop
Õâ¸öÃüÁʱÉúЧ£¬¿ªÆô·À»ðǽµÄÃüÁ
service iptables start
Èç¹ûÒª³¹µ×¹Ø±Õ·À»ðǽ£¬ÔòÐèÒªÖØÆôºóÉúЧ
¿ªÆô£º chkconfig iptables on
¹Ø±Õ£º chkconfig iptables off
ÔÚ¿ªÆôÁË·À»ðǽʱ£¬×öÈçÏÂÉèÖ㬿ªÆôÏà¹Ø¶Ë¿Ú£¬
ÐÞ¸Ä/etc/sysconfig/iptables Îļþ£¬Ìí¼ÓÒÔÏÂÄÚÈÝ£º
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
ÖØвâÊÔ£¬Ã»¶ªÒ»ÌõÊý¾Ý¡£
linux Äں˲ÎÊýµ÷Õû˵Ã÷
ËùÓеÄTCP/IPµ÷ÓŲÎÊý¶¼Î»ÓÚ/proc/sys/net/Ŀ¼¡£ÀýÈç, ÏÂÃæÊÇ×îÖØÒªµÄһЩµ÷ÓŲÎÊý, ºóÃæÊÇËüÃǵĺ¬Òå:
1. /proc/sys/net/core/rmem_max — ×î´óµÄTCPÊý¾Ý½ÓÊÕ»º³å¡£
2. /proc/sys/net/core/wmem_max — ×î´óµÄTCPÊý¾Ý·¢ËÍ»º³å¡£
3. /proc/sys/net/ipv4/tcp_timestamps — ʱ¼ä´ÁÔÚ(Çë²Î¿¼RFC 1323)TCPµÄ°üÍ·Ôö¼Ó12¸ö×Ö½Ú¡£
4. /proc/sys/net/ipv4/tcp_sack — ÓÐÑ¡ÔñµÄÓ¦´ð¡£
5. /proc/sys/net/ip
Ïà¹ØÎĵµ£º
//»ñÈ¡±¾»úIPµØÖ·º¯Êý
QString GetLocalIp()
{
int sock_get_ip;
char ipaddr[50];
struct sockaddr_in *sin;
struct ifreq ifr_ip;
if ((sock_get_ip=socket(AF_INET, SOCK_STREAM, 0)) == -1)
{
printf("socket create failse...GetLocalIp!\n");
return ""; ......
Ò»Ö±¶ÔlinuxÆô¶¯Ê±¹ÒÔظùÎļþϵͳµÄ¹ý³Ì´æÔÚןܶàÒÉÎÊ£¬½ñÌìÔÚˮľ¾«»ªÇøÕÒµ½ÁËÓÐÓõÄ×ÊÁÏ£¬ÕªÂ¼ÈçÏ£º
1¡£linuxÆô¶¯Ê±£¬¾¹ýһϵÁгõʼ»¯Ö®ºó£¬ÐèÒªmount ¸ùÎļþϵͳ£¬Îª×îºóÔËÐÐinit½ø³ÌµÈ×ö×¼±¸£¬mount ¸ùÎļþϵͳÓÐÕâô¼¸ÖÖ·½Ê½£º
1£©ÎļþϵͳÒѾ´æÔÚÓÚÓ²ÅÌ£¨»òÕßÀàËƵÄÉ豸£©µÄij¸ö·ÖÇøÉÏÁË£¬kernel¸ù¾ÝÆô¶¯µÄÃüÁî ......
Ëæ×ÅLinuxµÄÓ¦ÓÃÈÕÒæ¹ã·º£¬ÌرðÊÇÔÚÍøÂçÓ¦Ó÷½Ã棬ÓдóÁ¿µÄÍøÂç·þÎñÆ÷ʹÓÃLinux²Ù×÷ϵͳ¡£ÓÉÓÚLinuxµÄ×ÀÃæÓ¦ÓúÍWindowsÏà±È»¹ÓÐÒ»¶¨µÄ²î¾à£¬ËùÒÔÔÚÆóÒµÓ¦ÓÃÖÐÍùÍùÊÇLinuxºÍWindows²Ù×÷ϵͳ¹²´æÐγÉÒì¹¹ÍøÂç¡£ÔÚ·þÎñÆ÷¶Ë´ó¶àʹÓÃLinuxºÍUnixµÄ£¬Ä¿Ç°LinuxµÄÉó¤Ó¦ÓÃÁìÓòÊǵ¥Ò»Ó¦ÓõĻù´¡·þÎñÆ÷Ó¦Óã¬Æ©ÈçDNSºÍDHCP·þÎñÆ÷¡¢W ......
source file :
http://hi.baidu.com/neugraduzyq/blog/item/5602432f6a1a755a4ec22666.html
ÎÒÏëÔÚPATHϼÓÒ»¸ö/tools/binµÄ·¾¶ÓÃexport PATH=$PATH:/tools/binºóÓ¦¸ÃÊǼÓÉÏÈ¥ÁË£¬µ«ÊÇÓà echo $PATH »¹ÊÇÏÔʾµÄÔÀ´µÄ$PATH±äÁ¿µÄÖµ£¬¸Ð¾õÓÃexport PATH=$PATH:/tools/binÖ»ÊÇÔÚÔÀ´µÄ$PATH±äÁ¿ºó¼ÓÁËÒ»¸ö·¾¶µ½µ±Ç°µ ......
дµÃÂùºÃµÄlinuxѧϰ±Ê¼Ç
linuxĿ¼¼Ü¹¹
/ ¸ùĿ¼
/bin ³£ÓõÄÃüÁî binary file µÄÄ¿錄
/boot ´æ·ÅϵͳÆô¶¯Ê±±ØÐë¶ÁÈ¡µÄµµ°¸£¬°üÀ¨ºËÐÄ (kernel) ÔÚÄÚ
/boot/grub/menu.lst GRUBÉèÖÃ
/boot/vmlinuz& ......