Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MaxAcceptPerEvent = 128 MaxReadBytesPerEvent = 256 * 1024 MaxFlushBytesPerEvent = 256 * 1024 MaxCmdPerEvent = 1024 MaxCmdFlushConnsPerEvent = 1024 AcceptSocketNoDelay = true AcceptSocketSendBufBytes = 0 TlsHandshakeWorkers = 0 TlsHandshakeQueueSize = 1024 TlsHandshakeMaxPending int32 = 4096 WriteQueueCoalesceMaxBytes = 128 WriteQueueCompactMaxBytes = 4 * 1024 WriteQueueShrinkCap = 4 * 1024 DefProfiles = map[string]Profile{ "balanced": ProfileBalanced(), "throughput": ProfileThroughput(), "latency": ProfileLatency(), "gateway": ProfileGateway(), } )
Live globals used by eventloop/connection.
View Source
var ( // WSRequireClientMask enforces RFC6455: client->server frames must be masked. WSRequireClientMask = true // WSMaxFramePayloadBytes limits a single frame payload size. WSMaxFramePayloadBytes = 16 * 1024 * 1024 // WSMaxMessageBytes limits a reassembled fragmented message size. WSMaxMessageBytes = 16 * 1024 * 1024 )
WebSocket knobs (0 = unlimited).
Functions ¶
Types ¶
type Connection ¶
type Connection struct {
WriteQueueCoalesceMaxBytes int // coalesce small writes
WriteQueueCompactMaxBytes int // compact tail
WriteQueueShrinkCap int // shrink items cap
}
Connection write-queue knobs.
type EventLoop ¶
type EventLoop struct {
MaxAcceptPerEvent int // accepts per poll
MaxReadBytesPerEvent int // read bytes per poll
MaxFlushBytesPerEvent int // flush bytes per poll
MaxCmdPerEvent int // cmds per poll
MaxCmdFlushConnsPerEvent int // conns flushed per poll
AcceptSocketNoDelay bool // set TCP_NODELAY on accepted sockets
AcceptSocketSendBufBytes int // set SO_SNDBUF on accepted sockets (0 = keep system default)
TlsHandshakeWorkers int // handshake workers (0 => GOMAXPROCS)
TlsHandshakeQueueSize int // handshake queue
TlsHandshakeMaxPending int32 // handshake cap
}
EventLoop budgets.
type Profile ¶
type Profile struct {
Name string
EventLoop EventLoop
Connection Connection
}
Profile is a preset.
func ProfileGateway ¶
func ProfileGateway() Profile
ProfileGateway targets throughput with bounded tail latency.
Click to show internal directories.
Click to hide internal directories.