Linux Performance Optimization 14: adjusting socket buffer

Source: Internet
Author: User
Linux performance tuning 14: adjusting socket buffer talking about linux performance tuning 13: performance analysis concepts http://www.2cto.com/os/201307/229890.html Applications communicate with remote hosts through socket system calls. Each socket has a read/write buffer... linux performance tuning 14: adjusting socket buffer talking about linux performance tuning 13: performance analysis concepts http://www.2cto.com/os/201307/229890.html Applications communicate with remote hosts through socket system calls. Each socket has a read/write buffer. The Read Buffer Zone stores the data sent from the remote host. if the buffer zone is full, the data is discarded, and the write buffer period stores the data to be sent to the remote host. if the write buffer zone is slow, then the system application will be blocked when writing data. We can see that the buffer zone has a size. BDP provides a simple method to calculate the theoretically optimal TCP socket buffer size (which stores the data waiting for transmission and waiting for the application to receive ). If the buffer is too small, the TCP window cannot be fully opened, which will limit the performance. If the buffer area is too large, valuable memory resources will be wasted. If the buffer size you set is suitable, you can use the available bandwidth BDP = bandwidth * latency (in bytes) bandwidth * latency/8*2 ^ 20 = *** B bandwidth: Mebibites latency: s (RTT) Note: core must be adjusted before tcp adjustment. for tcp, udp cannot exceed the core limit. default value: net. core. rmem_max = 131071 128Knet. core. rmem_default = 123168net. core. wmem_max = 131071net. core. wmem_default = 124928. net. ipv4.tcp _ rmem = 4096 87380 2691072net. ipv4.tcp _ wmem = 4096 16384 2691072 example: Bandwidth: 1.5 M 500 M latency: ms 3000ms1. 5*0.5/8*2 ^ 20 ====== net. ipv4.tcp _ wmem100 * 3/8*2 ^ 20 ====== net. ipv4.tcp _ wmem
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.