Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.3k views
in Technique[技术] by (71.8m points)

so reuseport - SO_REUSEPORT not working on centos 7.5 kernel 3.10.0-1160.11.1.el7.x86_64

I am using code from :

https://stackoverflow.com/a/34605407/4758816

Works On (Ubuntu)

$ uname -a
Linux my_machine1-15-3567 4.4.0-186-generic #216-Ubuntu SMP Wed Jul 1 05:34:05 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$ netstat -nlp | grep 9091
tcp        0      0 0.0.0.0:9091            0.0.0.0:*               LISTEN      5781/a.out      
tcp        0      0 0.0.0.0:9091            0.0.0.0:*               LISTEN      5736/a.out  

But if I follow same steps on (Centos 7.5)

$uname -a
Linux my_machine2 **3.10.0**-1160.11.1.el7.x86_64 #1 SMP Fri Dec 18 16:34:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

netstat on my_machine2 shows only process which started 2nd, looks like port in being handed over to process started 2nd.

SO_REUSEPORT is added in kernel 3.9.0, not sure if centos needs any extra steps to enable same.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...