bluethundr
bluethundr

Reputation: 1345

error setting net.ipv4.tcp_tw_reuse & net.ipv4.tcp_tw_recycle in sysctl.conf

I tried setting the following in my /etc/sysctl.conf file to try and help with a MySQL port exhaustion issue:

net.ipv4.tcp_tw_reuse = true
net.ipv4.tcp_tw_recycle = true

But I get an error when running sysctl -p:

sysctl: setting key "net.ipv4.tcp_tw_reuse": Invalid argument
sysctl: setting key "net.ipv4.tcp_tw_recycle": Invalid argument

I also tried setting it this way, with no arguments:

net.ipv4.tcp_tw_reuse
net.ipv4.tcp_tw_recycle

And I get this response back on executing sysctl -p:

sysctl: /etc/sysctl.conf(31): invalid syntax, continuing...
sysctl: /etc/sysctl.conf(32): invalid syntax, continuing...

Can someone please tell me how to set these values correctly?

Thanks

Upvotes: 0

Views: 6143

Answers (2)

CRMcMullen
CRMcMullen

Reputation: 76

So that syntax is for the linux kernel, and you would use 1 or 0 for true/false, not the actual spelled out words. So in your example, it would be:

net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1

If you're trying to adjust this setting in OSX on your Mac, then it's a different syntax. It would be:

net.inet.tcp.msl=1000

Hope that helps.

Upvotes: 6

Evgenii Kazmiruk
Evgenii Kazmiruk

Reputation: 11

If it's still actual for you - "true" is wrong value here, you have to use 1 as "enabled" and 0 as "disabled"

Upvotes: 0

Related Questions