You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.11.1
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
linux, centos 7, amd4
What did you do?
I have a program need to create large number of listening UDPConn, basically around 30k, each UDPConn will run in its own go routine waiting incoming packets, so that's 30k go routines, however I hit the wall of 10000 system threads limitation; after search around, I found it is because I set socket option to use ESPinUDP encap: "syscall.SetsockoptInt(conn_fd, syscall.IPPROTO_UDP, 100, 2)" , with the socket option set, each go routine is blocked in syscall, thus consuming a lots of system threads:
How are you getting the value conn_fd that you mention? My first guess would be that you are doing something that causes the file descriptor to go into blocking mode. If so, the fix will be to call the SyscallConn method and call the Control method of the returned syscall.RawConn value.
Closing on the assumption that that is what you are looking for. Please comment if you disagree. In general, please ask questions on a forum, not the issue tracker; see https://golang.org/wiki/Questions . Thanks.
Thanks, what you suggested works.
I was using File().Fd() to get the fd, and using syscall.SetsockoptInt
btw: I knew this is not right place to ask questions, but I have posted this question on go-nuts a few days ago, did't get any reply ...
mikioh
changed the title
UDPConn.ReadFromUDP blocked in syscall when underlying socket option is set
net: UDPConn.ReadFromUDP blocked in syscall when underlying socket option is set
Oct 12, 2018
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.11.1
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?linux, centos 7, amd4
What did you do?
I have a program need to create large number of listening UDPConn, basically around 30k, each UDPConn will run in its own go routine waiting incoming packets, so that's 30k go routines, however I hit the wall of 10000 system threads limitation; after search around, I found it is because I set socket option to use ESPinUDP encap: "syscall.SetsockoptInt(conn_fd, syscall.IPPROTO_UDP, 100, 2)" , with the socket option set, each go routine is blocked in syscall, thus consuming a lots of system threads:
if I don't set the socket option, then number of thread is far less, and go routine no longer use syscall:
so is there way to use socket option without consume so many system threads?
What did you expect to see?
consume less system threads
What did you see instead?
hit 10000 system threads limitation
The text was updated successfully, but these errors were encountered: