3b5e72913e
I spent some time today on my local Mac to figure out why Consul 1.6.3+ was not accepting limits.http_max_conns_per_client. This adds an explicit check on number of file descriptors to be sure it might work (this is no guarantee as if many clients are reaching the agent, it might consume even more file descriptors) Anyway, many users are fighting with RLIMIT_NOFILE, having a clear message would allow them to figure out what to fix. Example of message (reload or start): ``` 2020-03-11T16:38:37.062+0100 [ERROR] agent: Error starting agent: error="system allows a max of 512 file descriptors, but limits.http_max_conns_per_client: 8192 needs at least 8212" ```
10 lines
193 B
Go
10 lines
193 B
Go
// +build windows
|
|
|
|
package config
|
|
|
|
// getrlimit is no-op on Windows, as max fd/process is 2^24 on Wow64
|
|
// Return (16 777 216, nil)
|
|
func getrlimit() (uint64, error) {
|
|
return 16_777_216, nil
|
|
}
|