नेटवर्क इंजीनियर अक्सर उन स्थितियों का सामना करते हैं जहां टीसीपी विंडोिंग या एप्लिकेशन प्रदर्शन को नेटवर्क अवसंरचना पर दोषी ठहराया जाता है। व्यापक पैकेट कैप्चर, tcpdumps और नेटवर्क विश्लेषण के प्रदर्शन के बाद, वास्तविक बोतलबंदी को अक्सर खोजा जाता है: ग्राहक या सर्वर सिस्टम पर निकास एनआईसी (नेटवर्क इंटरफेस कार्ड) या ओएस-लेवल बफर।
यह लेख लिनक्स, विंडोज और मैकओएस के लिए दोनों विरासत (circa 2009) और वर्तमान (2025-2026) बफर विन्यास प्रदान करता है, साथ ही साथ नैदानिक तकनीकों के साथ बफर थकावट की पहचान करने से पहले यह एक महत्वपूर्ण मुद्दा बन जाता है।
टीसीपी एक प्रवाह नियंत्रण तंत्र का उपयोग करता है जहां रिसीवर एक "विंडो आकार" का विज्ञापन करता है, यह दर्शाता है कि यह कितना डेटा स्वीकार कर सकता है। जब सिस्टम बफर भरते हैं, तो यह विंडो शून्य हो जाती है, प्रेषक को प्रतीक्षा करने के लिए मजबूर करती है। यह एक नेटवर्क समस्या के रूप में प्रकट होता है लेकिन वास्तव में एक मेजबान संसाधन मुद्दा है।
# Check current TCP buffer settings sysctl net.ipv4.tcp_rmem sysctl net.ipv4.tcp_wmem sysctl net.core.rmem_max sysctl net.core.wmem_max # Check NIC ring buffer sizes ethtool -g eth0 # Monitor socket buffer usage ss -tm # Check for TCP zero window events tcpdump -i any 'tcp[tcpflags] & tcp-push != 0' -vv # Check network statistics for buffer issues netstat -s | grep -i "buffer\|queue\|drop"
# Check TCP parameters
netsh interface tcp show global
# View network adapter buffer settings
Get-NetAdapterAdvancedProperty -Name "Ethernet" | Where-Object {$_.DisplayName -like "*buffer*"}
# Monitor TCP statistics
netstat -s -p tcp
# Check receive window auto-tuning
netsh interface tcp show global | findstr "Receive Window"
# Check current buffer settings sysctl kern.ipc.maxsockbuf sysctl net.inet.tcp.sendspace sysctl net.inet.tcp.recvspace # View network statistics netstat -s -p tcp # Monitor socket buffers netstat -an -p tcp
| पैरामीटर | लेगैसी वैल्यू (2009) | विवरण |
|---|---|---|
| net.core.rmem default | 124928 (122KB) | डिफ़ॉल्ट प्राप्त सॉकेट बफर आकार |
| net.core.rmem max | 131071 (128KB) | अधिकतम प्राप्त सॉकेट बफर आकार |
| net.core.wmem default | 124928 (122KB) | डिफ़ॉल्ट भेजें सॉकेट बफर आकार |
| net.core.wmem max | 131071 (128KB) | अधिकतम सॉकेट बफर आकार |
| net.ipv4.tcp rmem | 4096 87380 174760 | टीसीपी बफर प्राप्त: न्यूनतम, डिफ़ॉल्ट, अधिकतम ( bytes में) |
| net.ipv4.tcp wmem | 4096 16384 131072 | टीसीपी भेजें बफर: न्यूनतम, डिफ़ॉल्ट, अधिकतम ( bytes में) |
| net.ipv4.tcp mem | 196608 262144 393216 | टीसीपी मेमोरी पेज: कम, दबाव, उच्च |
| net.core.netdev max backlog | 1000 | इनपुट कतार में अधिकतम पैकेट |
| Netcore.optmem max | 10240 (10KB) | प्रति सॉकेट अधिकतम सहायक बफर आकार |
| Parameter | वर्तमान मूल्य | Description |
|---|---|---|
| net.core.rmem_default | 16777216 (16MB) | Default receive socket buffer size |
| net.core.rmem_max | 134217728 (128MB) | Maximum receive socket buffer size |
| net.core.wmem_default | 16777216 (16MB) | Default send socket buffer size |
| net.core.wmem_max | 134217728 (128MB) | Maximum send socket buffer size |
| net.ipv4.tcp_rmem | 4096 87380 | टीसीपी बफर प्राप्त: न्यूनतम, डिफ़ॉल्ट, अधिकतम (128 एमबी अधिकतम) |
| net.ipv4.tcp_wmem | 4096 65536 134217728 | टीसीपी भेजें बफर: न्यूनतम, डिफ़ॉल्ट, अधिकतम (128 एमबी अधिकतम) |
| net.ipv4.tcp_mem | 8388608 12582912 16777216 | टीसीपी मेमोरी पेज: कम, दबाव, उच्च (64GB सिस्टम) |
| net.core.netdev_max_backlog | 250000 | इनपुट कतार (10GbE+) में अधिकतम पैकेट |
| net.core.optmem_max | 65536 (64KB) | Maximum ancillary buffer size per socket |
| net.ipv4.tcp congestion control | bbr | BBR भीड़ नियंत्रण (Google's एल्गोरिदम) का उपयोग करें |
| net.ipv4.tcp window scaling | 1 | टीसीपी विंडो स्केलिंग सक्षम करें (आरएफसी 1323) |
| net.ipv4.tcp timestamp | 1 | बेहतर आरटीटी आकलन के लिए टीसीपी टाइमस्टैम्प सक्षम करें |
| net.ipv4.tcp sack | 1 | सक्षम चयनात्मक Acknowledgment |
| net.ipv4.tcp no metrics save | 1 | टीसीपी मेट्रिक्स की अक्षम कैशिंग |
इन सेटिंग्स को जोड़ें /etc/sysctl.conf या एक नई फाइल बनाना /etc/sysctl.d/99-network-tuning.conf:
# Network Buffer Tuning for High-Performance Applications # Optimized for 10GbE+ networks with RTT up to 300ms # Core socket buffer settings net.core.rmem_default = 16777216 net.core.rmem_max = 134217728 net.core.wmem_default = 16777216 net.core.wmem_max = 134217728 # TCP buffer settings net.ipv4.tcp_rmem = 4096 87380 134217728 net.ipv4.tcp_wmem = 4096 65536 134217728 net.ipv4.tcp_mem = 8388608 12582912 16777216 # Device buffer settings net.core.netdev_max_backlog = 250000 net.core.netdev_budget = 50000 net.core.netdev_budget_usecs = 5000 net.core.optmem_max = 65536 # TCP optimizations net.ipv4.tcp_congestion_control = bbr net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_timestamps = 1 net.ipv4.tcp_sack = 1 net.ipv4.tcp_no_metrics_save = 1 net.ipv4.tcp_moderate_rcvbuf = 1 # Apply with: sysctl -p /etc/sysctl.d/99-network-tuning.conf
# Check current ring buffer sizes ethtool -g eth0 # Set maximum ring buffer sizes (adjust based on NIC capabilities) ethtool -G eth0 rx 4096 tx 4096 # Make persistent by adding to /etc/network/interfaces or systemd service
| Parameter | Legacy Value (2009) | स्थान |
|---|---|---|
| TcpWindowSize | 65535 (64KB) | Registry: HKLM \ System \CurrentControlSet \ Services \ Tcpip \Parameters |
| Tcp1323Opts | 0 (अक्षय) | डिफ़ॉल्ट रूप से अक्षम विंडो स्केलिंग |
| डिफ़ॉल्टरिसीवविंडो | 8192 (8KB) | डिफ़ॉल्ट प्राप्त विंडो |
| डिफ़ॉल्टSendWindow | 8192 (8KB) | डिफ़ॉल्ट भेजें विंडो |
| GlobalMaxTcpWindowSize | 65535 (64KB) | अधिकतम टीसीपी विंडो आकार |
| TcpNumConnections | 16777214 | अधिकतम टीसीपी कनेक्शन |
आधुनिक विंडोज का उपयोग करता है विंडो ऑटो ट्यूनिंग प्राप्त करें सुविधा, जो गतिशील रूप से नेटवर्क स्थितियों के आधार पर बफर प्राप्त करता है।
| फ़ीचर | वर्तमान सेटिंग | Description |
|---|---|---|
| ऑटो ट्यूनिंग स्तर | सामान्य (10GbE+) | गतिशील प्राप्त विंडो समायोजन |
| प्राप्त-साइड स्केलिंग (RSS) | सक्षम | CPU में नेटवर्क प्रसंस्करण वितरित करें |
| चिमनी ऑफलोड | स्वचालित (या आधुनिक एनआईसी पर अक्षम) | टीसीपी ऑफलोड से एनआईसी हार्डवेयर |
| NetDMA | विकलांग | डायरेक्ट मेमोरी एक्सेस (डिप्रीकेटेड) |
| टीसीपी ग्लोबल पैरामीटर | नीचे आदेश देखें | सिस्टम-वाइड टीसीपी सेटिंग्स |
| भीड़ प्रदाता | CUBIC (or NewReno Fallback) | टीसीपी भीड़ नियंत्रण एल्गोरिथ्म |
# Check current auto-tuning level netsh interface tcp show global # Enable auto-tuning (normal mode - default for most scenarios) netsh interface tcp set global autotuninglevel=normal # For high-bandwidth, high-latency networks (10GbE+, data center environments) netsh interface tcp set global autotuninglevel=experimental # For conservative tuning (if experimental causes issues) netsh interface tcp set global autotuninglevel=restricted # For very conservative tuning (not recommended for high-performance networks) netsh interface tcp set global autotuninglevel=highlyrestricted # Enable CUBIC congestion provider (Windows Server 2022/Windows 11+ only) netsh interface tcp set supplemental template=Internet congestionprovider=cubic # Note: Windows 10 and Server 2019 use Compound TCP or NewReno by default # CUBIC is not available on these older versions # Enable Receive-Side Scaling (RSS) netsh interface tcp set global rss=enabled # Set chimney offload (automatic is recommended) netsh interface tcp set global chimney=automatic # Disable NetDMA (recommended for modern systems) netsh interface tcp set global netdma=disabled # Enable Direct Cache Access (if supported) netsh interface tcp set global dca=enabled # Enable ECN (Explicit Congestion Notification) netsh interface tcp set global ecncapability=enabled # Set initial congestion window to 10 (RFC 6928) netsh interface tcp set global initialRto=3000
# View current adapter settings Get-NetAdapterAdvancedProperty -Name "Ethernet" # Increase receive buffers (adjust based on NIC) Set-NetAdapterAdvancedProperty -Name "Ethernet" -DisplayName "Receive Buffers" -DisplayValue 2048 # Increase transmit buffers Set-NetAdapterAdvancedProperty -Name "Ethernet" -DisplayName "Transmit Buffers" -DisplayValue 2048 # Enable Jumbo Frames (if network supports it) Set-NetAdapterAdvancedProperty -Name "Ethernet" -DisplayName "Jumbo Packet" -DisplayValue 9014 # Enable Large Send Offload (LSO) Set-NetAdapterAdvancedProperty -Name "Ethernet" -DisplayName "Large Send Offload V2 (IPv4)" -DisplayValue Enabled Set-NetAdapterAdvancedProperty -Name "Ethernet" -DisplayName "Large Send Offload V2 (IPv6)" -DisplayValue Enabled
# These settings are typically NOT needed on Windows 10/11 due to auto-tuning # Only modify if auto-tuning is disabled or problematic # Registry path: HKLM\System\CurrentControlSet\Services\Tcpip\Parameters # Maximum TCP window size (if auto-tuning disabled) # TcpWindowSize = 16777216 (16MB) - REG_DWORD # Enable window scaling (enabled by default on modern Windows) # Tcp1323Opts = 3 - REG_DWORD # Number of TCP Timed Wait Delay # TcpTimedWaitDelay = 30 - REG_DWORD (default 240)
| Parameter | Legacy Value (2009) | Description |
|---|---|---|
| kern.ipc.maxsockbuf | 262144 (256KB) | अधिकतम सॉकेट बफर आकार |
| Net.intcp.sendspace | 32768 (32KB) | डिफ़ॉल्ट टीसीपी भेजें बफर |
| Net.intcp.recvspace | 32768 (32KB) | डिफ़ॉल्ट टीसीपी प्राप्त बफर |
| net.intcp.autorcvbufmax | 131072 (128KB) | अधिकतम ऑटो-ट्यून प्राप्त बफर |
| net.intcp.autosndbufmax | 131072 (128KB) | अधिकतम ऑटो-ट्यून भेजे गए बफर |
| net.inet.tcp.rfc1323 | 0 (disabled) | टीसीपी विंडो स्केलिंग |
| Parameter | Current Recommended Value | Description |
|---|---|---|
| kern.ipc.maxsockbuf | 8388608 (8MB) | Maximum socket buffer size |
| net.inet.tcp.sendspace | 131072 (128KB) | Default TCP send buffer |
| net.inet.tcp.recvspace | 131072 (128KB) | Default TCP receive buffer |
| net.inet.tcp.autorcvbufmax | 16777216 (16MB) | Maximum auto-tuned receive buffer |
| net.inet.tcp.autosndbufmax | 16777216 (16MB) | Maximum auto-tuned send buffer |
| net.inet.tcp.rfc1323 | 1 (सक्षम) | टीसीपी विंडो स्केलिंग सक्षम करें |
| net.intcp.sack | 1 (enabled) | Enable Selective Acknowledgment |
| net.inet.tcp.mssdflt | 1440 | डिफ़ॉल्ट टीसीपी अधिकतम सेगमेंट आकार |
| net.inet.tcp.delayed ack | 3 | विलंबित ACK व्यवहार |
# Check current settings sysctl kern.ipc.maxsockbuf sysctl net.inet.tcp.sendspace sysctl net.inet.tcp.recvspace sysctl net.inet.tcp.autorcvbufmax sysctl net.inet.tcp.autosndbufmax # Apply settings temporarily (until reboot) sudo sysctl -w kern.ipc.maxsockbuf=8388608 sudo sysctl -w net.inet.tcp.sendspace=131072 sudo sysctl -w net.inet.tcp.recvspace=131072 sudo sysctl -w net.inet.tcp.autorcvbufmax=16777216 sudo sysctl -w net.inet.tcp.autosndbufmax=16777216 sudo sysctl -w net.inet.tcp.rfc1323=1 sudo sysctl -w net.inet.tcp.sack=1 # Make settings persistent (create /etc/sysctl.conf) sudo tee /etc/sysctl.conf <Persistent सेटिंग्स के लिए लॉन्च डेमन बनाना
# Create /Library/LaunchDaemons/com.local.sysctl.plist sudo tee /Library/LaunchDaemons/com.local.sysctl.plist <EOF sudo chmod 644 /Library/LaunchDaemons/com.local.sysctl.plist sudo launchctl load /Library/LaunchDaemons/com.local.sysctl.plist Label com.local.sysctl ProgramArguments /usr/sbin/sysctl -w kern.ipc.maxsockbuf=8388608 RunAtLoad चेतावनी: MacOS Ventura (13) और बाद में सिस्टम इंटीग्रिटी प्रोटेक्शन (SIP) प्रतिबंध है। कुछ कर्नेल मापदंडों को सूडो के साथ भी संशोधित नहीं किया जा सकता है। अपने विशिष्ट वातावरण में टेस्ट सेटिंग।
# Server side iperf3 -s # Client side - test TCP throughput iperf3 -c server_ip -t 60 -i 5 -w 16M # Test with multiple parallel streams iperf3 -c server_ip -P 10 -t 60 # Test UDP performance iperf3 -c server_ip -u -b 1000M -t 60
# Capture and display TCP window sizes tcpdump -i any -n 'tcp' -vv | grep -i window # Save capture for Wireshark analysis tcpdump -i any -w /tmp/capture.pcap 'tcp port 443'
बफर मुद्दों के इन संकेतकों के लिए देखो:
# Linux - Monitor network buffer statistics watch -n 1 'cat /proc/net/sockstat' watch -n 1 'ss -tm | grep -i mem' # Check for drops netstat -s | grep -i drop # Windows - Monitor TCP statistics netstat -e 1 # macOS - Monitor network statistics netstat -s -p tcp
अपने नेटवर्क के लिए इष्टतम बफर आकार निर्धारित करने के लिए, बैंडविड्थ देरी उत्पाद की गणना करें:
BDP = Bandwidth (bits/sec) × RTT (seconds) Example for 10 Gigabit Ethernet with 50ms RTT: BDP = 10,000,000,000 × 0.050 = 500,000,000 bits = 62.5 MB Buffer Size = BDP × 2 (for bidirectional traffic and headroom) Buffer Size = 62.5 MB × 2 = 125 MB This is why modern settings recommend 128MB maximum buffers.
| कार्यभार प्रकार | अनुशंसित बफर आकार | प्रमुख पैरामीटर |
|---|---|---|
| वेब सर्वर (कम विलंबता) | 4-16 MB | लोअर बफर, अधिक कनेक्शन, तेज प्रतिक्रिया |
| डेटाबेस सर्वर | 16-32 MB | मध्यम बफर, सुसंगत throughput |
| फ़ाइल ट्रांसफर / बैकअप | 64-128 MB | अधिकतम बफर, उच्च थ्रूपुट प्राथमिकता |
| वीडियो स्ट्रीमिंग | 32-64 MB | बड़े बफर, लगातार वितरण दर |
| HPC / डेटा सेंटर | 128-256 MB | अधिकतम बफर, विशेष भीड़ नियंत्रण |
| वायरलेस / मोबाइल | 2-8 MB | रूढ़िवादी बफर, चर विलंबता हैंडलिंग |
बफर थकावट प्रदर्शन मुद्दों का एक आम मूल कारण है जो नेटवर्क से संबंधित प्रतीत होता है। 2009 की 128KB सीमाओं से आज की 128MB क्षमताओं तक बफर साइज के विकास को समझकर, नेटवर्क इंजीनियर जल्दी से इन मुद्दों की पहचान कर सकते हैं।
कुंजी टेकअवे:
याद रखें: टीसीपी शून्य खिड़कियों को दिखाने के लिए पैकेट विश्लेषण द्वारा प्रकट एक "नेटवर्क समस्या" वास्तव में एक मेजबान प्रणाली संसाधन समस्या है। उचित बफर ट्यूनिंग के साथ, आप इन झूठे निदान को खत्म कर सकते हैं और इष्टतम प्रदर्शन प्राप्त कर सकते हैं।
आखरी अपडेट: फरवरी 2, 2026
लेखक: Baud9600 तकनीकी टीम