Increase open file (fd) limit if possible
This will decrease the risk of running out of file descriptors for the database and other bad things, which could otherwise potentially happen if we're serving lots of requests and scanning in parallel, etc. Windows doesn't have a per process open file limit like Unix so we don't need to worry about it there.
This commit is contained in:
@@ -454,6 +454,11 @@ func syncthingMain() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
}
|
||||
|
||||
// Attempt to increase the limit on number of open files to the maximum
|
||||
// allowed, in case we have many peers. We don't really care enough to
|
||||
// report the error if there is one.
|
||||
osutil.MaximizeOpenFileLimit()
|
||||
|
||||
// Ensure that that we have a certificate and key.
|
||||
cert, err := tls.LoadX509KeyPair(locations[locCertFile], locations[locKeyFile])
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user