How much memory is consumed by the Linux kernel per TCP/IP network connection?

Source: Internet
Author: User

For a TCP connection memory consumed depends on

1) Size of SK_Buff (internal networking structure used by Linux kernel)

2) The read and write buffer for a connection

The size of buffers can be tweaked as required

Root @ X :~ # Sysctl-A | grep net | grep mem

Check for these variables

These specify the maximum default memory buffer usage for all network connections in Kernel

Net. Core. wmem_max = 131071

Net. Core. rmem_max = 131071

Net. Core. wmem_default = 126976

Net. Core. rmem_default = 126976

These specify buffer memory usage specific to TCP connections

Net. ipv4.tcp _ mem = 378528 504704 757056

Net. ipv4.tcp _ WMEM = 4096 16384 4194304

Net. ipv4.tcp _ rmem = 4096 87380 4194304

the three values specified are " Min default Max " buffer sizes. so to start with Linux will use the default values of read and write buffer for each connection. as the number of connection increases, These buffers will be subject CED [at most till the specified min value] same is the case for Max buffer value.

These values can be set using this sysctl-W key = key value

Eg. The below command ensures the Read and Write buffers for each connection are 4096 each.

Sysctl-W net. ipv4.tcp _ rmem = '2017 4096 4096'

Sysctl-W net. ipv4.tcp _ WMEM = '2017 4096 4096'

Original

Http://stackoverflow.com/questions/8646190/how-much-memory-is-consumed-by-the-linux-kernel-per-tcp-ip-network-connection

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.