mirror of
https://github.com/bgp/stayrtr.git
synced 2024-05-06 15:54:54 +00:00
Add switch to disable TCP_NODELAY
This in an attempt quell CPU usage, since PCCW is having issues when their {N} number of routers all start RTR sessions at the same time. A `perf` of the system suggests all of the CPU is going to sending TCP traffic, and since golang enables NO_DELAY (infamously?) by default, this is a good smoking gun, since this would imply that stayrtr is sending 1 TCP packet per RTR PDU, something that would indeed cause a lot of CPU usage in aggergate!
This commit is contained in:
@ -536,8 +536,16 @@ func (s *Server) Start(bind string) error {
|
||||
|
||||
var DisableBGPSec = flag.Bool("disable.bgpsec", false, "Disable sending out BGPSEC Router Keys")
|
||||
var DisableASPA = flag.Bool("disable.aspa", false, "Disable sending out ASPA objects")
|
||||
var EnableNODELAY = flag.Bool("enable.nodelay", false, "Force enable TCP NODELAY (Likely increases CPU)")
|
||||
|
||||
func (s *Server) acceptClientTCP(tcpconn net.Conn) error {
|
||||
if !*EnableNODELAY {
|
||||
tc, ok := tcpconn.(*net.TCPConn)
|
||||
if ok {
|
||||
tc.SetNoDelay(false)
|
||||
}
|
||||
}
|
||||
|
||||
client := ClientFromConn(tcpconn, s, s)
|
||||
client.log = s.log
|
||||
if s.enforceVersion {
|
||||
|
Reference in New Issue
Block a user