aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-08-08 10:38:39 +0100
committerdiogo464 <[email protected]>2025-08-08 10:38:39 +0100
commit6eab78fa80a47adfeded4fe10cd57b77c20bed07 (patch)
tree5e525f2d1aff99cfdf9d8a3720d9224165594195 /src/main.rs
parent817dd1edf61f358397e0b8099bc9e2669a7d169c (diff)
doubled tcp max orphan limit
the default value on the machines seems to be 262144 but on some larger experiments dmesg will sometimes show the following logs: [Fri Aug 8 05:01:42 2025] TCP: too many orphaned sockets [Fri Aug 8 05:01:42 2025] TCP: too many orphaned sockets [Fri Aug 8 05:01:42 2025] TCP: too many orphaned sockets [Fri Aug 8 05:01:42 2025] TCP: too many orphaned sockets [Fri Aug 8 05:01:42 2025] TCP: too many orphaned sockets [Fri Aug 8 05:01:42 2025] TCP: too many orphaned sockets [Fri Aug 8 05:01:42 2025] TCP: too many orphaned sockets [Fri Aug 8 05:01:42 2025] TCP: too many orphaned sockets [Fri Aug 8 05:01:42 2025] TCP: too many orphaned sockets [Fri Aug 8 05:01:42 2025] TCP: too many orphaned sockets hopefully increasing this limit will fix that. https://serverfault.com/questions/624911/what-does-tcp-too-many-orphaned-sockets-mean the second answer on server faul also says it could be due to tcp memory limits: ``` The possible cause of this error is system run out of socket memory.Either you need to increase the socket memory(net.ipv4.tcp_mem) or find out the cause of memory consumption [root@test ~]# cat /proc/sys/net/ipv4/tcp_mem 362688 483584 725376 So here in my system you can see 725376(pages)*4096=2971140096bytes/1024*1024=708 megabyte So this 708 megabyte of memory is used by application for sending and receiving data as well as utilized by my loopback interface.If at any stage this value reached no further socket can be made until this memory is released from the application which are holding socket open which you can determine using netstat -antulp. ``` but for now I will just increase the max orphans and see if that is enough.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 636a3dc..7ef6ff6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -883,6 +883,9 @@ fn machine_configuration_script(config: &MachineConfig) -> String {
883 script.push_str("echo 16384 > /proc/sys/net/ipv4/neigh/default/gc_thresh2\n"); 883 script.push_str("echo 16384 > /proc/sys/net/ipv4/neigh/default/gc_thresh2\n");
884 script.push_str("echo 32768 > /proc/sys/net/ipv4/neigh/default/gc_thresh3\n"); 884 script.push_str("echo 32768 > /proc/sys/net/ipv4/neigh/default/gc_thresh3\n");
885 885
886 // tcp max orphan limit
887 script.push_str("echo 524288 > /proc/sys/net/ipv4/tcp_max_orphans\n");
888
886 // ip configuration 889 // ip configuration
887 script.push_str("cat << EOF | ip -b -\n"); 890 script.push_str("cat << EOF | ip -b -\n");
888 for command in config.ip_commands.iter() { 891 for command in config.ip_commands.iter() {