Repository navigation
cmd/strelaysrv: Increase default strelaysrv network buffer size (fixes #7514) - #7517
Conversation
…#7514) Increases throughput at the cost of more memory per connection
|
Sorry, looking more closely at this I don't think this is appropriate. It's already a flag so the user can optimize as they like, lots of relays have a hundred sessions which by my mental count would cost 13+ gigs of RAM. So no, I think the current default is fine despite the better performance with a bigger buffer. I guess an alternative would be some sort of smarter shared buffer handling that only used buffer space when required, but that's not what we have. |
|
This is only needed for active sessions, maximum we have at the moment is 1115, which is |
|
I guess even setting it to 32k or 16k would be beneficial over the current 2k. |
|
I'm a dumbass and off by a factor 1024. This is fine. |
| uri, err := url.Parse(fmt.Sprintf("relay://%s/?id=%s&pingInterval=%s&networkTimeout=%s&sessionLimitBps=%d&globalLimitBps=%d&statusAddr=%s&providedBy=%s", mapping.Address(), id, pingInterval, networkTimeout, sessionLimitBps, globalLimitBps, statusAddr, providedBy)) | ||
| if err != nil { | ||
| log.Fatalln("Failed to construct URI", err) | ||
| return |
There was a problem hiding this comment.
Your fancy lint started crying.
There was a problem hiding this comment.
Yeah what it means is that the defer doesn’t run due to Fatalln, but they doesn’t matter much
There was a problem hiding this comment.
🤷♂️
In these cases, in case of failure, defer never gets called.
Example:
defer os.Remove(filename)
if bad {
log.Fatalf("something bad happened")
}
should be written as:
defer os.Remove(filename)
if bad {
log.Printf("something bad happened")
return
}
There was a problem hiding this comment.
Println + return is a normal return so the defer runs. Fatalln is an immediate exit so no defer gets a chance to run. But the defer is a context cancel so we have no reason to care. Their example with deferred os.Remove is another matter.
* main: (36 commits) etc: Fix start-limit parameters location in systemd units (ref syncthing#7439) (syncthing#7529) gui: Add confirmation dialog for revert/override (fixes syncthing#7520) (syncthing#7522) readme: Larger link for Fitt's law, still semantic (syncthing#7523) gui, man, authors: Update docs, translations, and contributors lib/model: Reset conn when enc token is missing (fixes syncthing#7198) (syncthing#7518) lib: Handle adding enc folders on an existing conn (fixes syncthing#7509) (syncthing#7510) cmd/strelaysrv: Increase default strelaysrv network buffer size (fixes syncthing#7514) (syncthing#7517) lib/ur: Prevent panic when blocksResult is nil (ref syncthing#7495) (syncthing#7515) lib/model: Encrypted fileinfo trailer needs to be in wire format (syncthing#7505) lib/model: Error check in test (syncthing#7508) lib/osutil: Fix raising max FDs on macOS (syncthing#7507) lib/connections: Silence "connected to myself" messages. (syncthing#7500) lib/osutil: Remove unused code all: Simplify some method calls (syncthing#7499) cmd/uraggregate: Ignore errors harder (syncthing#7498) cmd/syncthing: Error handling on upgrade (syncthing#7497) Remove unnecessary guard around `delete` (syncthing#7496) all: Remove miscellaneous vestigial code (syncthing#7495) all: Remove crypto/md5 (syncthing#7493) lib/api: Missing error handling in API delete-device (syncthing#7494) ...
Increases throughput at the cost of more memory per connection