-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use WSD-config or system's maximum concurrent TCP connections for net::Defaults.maxTCPConnections #10375
base: master
Are you sure you want to change the base?
Conversation
68933f6
to
92d8955
Compare
92d8955
to
7597fb3
Compare
I feel readDecimal and dataToDecimal are a bit ornate if we compare to say getTotalSystemMemoryKb or getFromCGroup which just open their /proc file, read a line from it and atoll on that |
looked at them ofc and thought about adding this func .. esp due to late reviews :) |
7597fb3
to
342435e
Compare
added a tiny fix on calling readDecimal (EOS included), refined its API doc .. kicking CI again (ole cypress failure) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some good things here that can go in - but a number that need feedback. I -really- don't want review getting lost and ignored in monster review threads of giant collections of commits. It is good to split them up - lets also push them in small batches to different PRs.
checkRemoval -> fine.
Simplify UnitTimeoutBase -> no idea - a huge change with no clear rationale.
Add 'UT' -> the 'UT' is not needed - lets not make up lots of new acronyms in commit messages it is implicit in UnitTestFoo - otherwise good to see a new test -> fine.
is "Remove WebSocketHandler's WS Ping timeout functionality" a nearly straight revert - if so good; lets include the word 'Revert' in the commit message - otherwise fine.
Like the Remove redundant 'Socket::isClosed()' - but I would prefer us to remove 'isOpen' to minimize the end-to-end diff across the code. We don't want non-functional renames of methods isClosed -> isOpen is not a win.
"Add safe ..." don't like creating big, redundant helpers like this. We already have similar code, using other helpers that does this - git grep for & re-use the same code there.
why tcp_max_orphans ?
Thanks!
a3b53eb
to
dd4b6ae
Compare
Not huge IMHO, but simplifying the unit test more to its point, which pattern is also more reusable for other users.
Fun fact, I read this abbreviation somewhere else .. and picked it up. OK.
I counted usage of both, and isOpen was used more often without inversion
(other items were either accepted or discussed in upcoming PRs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When feedback is incorporated systematically please poke me to review again. Thanks.
88b0d10
to
2764bcd
Compare
Done. Remark: The requested removal of Socket::isOpen() instead of Socket::isClose() increased the diff as laid out earlier. Regardless, I hope it fits requirements as I also changed the field name to have the accessor match 1:1 w/o inverted logic. Other changes applied as requested as well. |
2764bcd
to
e97b802
Compare
e97b802
to
d95881e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets get the first two commits in- but not the third - which needs re-working.
d95881e
to
0175d07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more work to do - as well as splitting from the underlying un-necessary extra commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes but lets get them done first.
0175d07
to
ee52b02
Compare
force push: rebase to master only |
ee52b02
to
f22b4cc
Compare
Addressed comments, added config value etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @sgothel. Left some comments/notes.
…oncurrent TCP connections `net::Defaults.maxExtConnections` is set: - use COOLWSD config `net.max_ext_connections` if >= `COOLWSD::MinConnectedSessions` - or is disabled (zeroed) if config < 0. - otherwise set to system-value, see `Util::getMaxConcurrentTCPConnections`. `Util::getMaxConcurrentTCPConnections` uses Linux kernel values - /proc/sys/net/ipv4/tcp_max_orphans See https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html - /proc/sys/net/nf_conntrack_max See https://www.kernel.org/doc/html/latest/networking/nf_conntrack-sysctl.html - or returns zero if undefined The Linux kernel values are memory bound, approximately 4 concurrent TCP connections per MB system memory are provided, e.g. {4096M -> 16384}, {16384M -> 65536}, {65407M -> 262144}, ... `COOLWSD::MinConnectedSessions` is a static constexpr with value 3, symbolized for clarity. Signed-off-by: Sven Göthel <[email protected]> Change-Id: Iad74f253bdac5636757b130b299b5deacda658db
f22b4cc
to
36915ef
Compare
push:
|
@Ashod - can you do some thinking on whether we want this, and get it in if so ? =) |
Yes, will do. |
Summary
net::Defaults.maxTCPConnections: Use WSD-config or system's maximum concurrent TCP connections
net::Defaults.maxExtConnections
is set:net.max_ext_connections
if >=COOLWSD::MinConnectedSessions
Util::getMaxConcurrentTCPConnections
.Util::getMaxConcurrentTCPConnections
uses Linux kernel valuesSee https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html
See https://www.kernel.org/doc/html/latest/networking/nf_conntrack-sysctl.html
The Linux kernel values are memory bound, approximately 4 concurrent TCP connections per MB system memory are provided,
e.g. {4096M -> 16384}, {16384M -> 65536}, {65407M -> 262144}, ...
COOLWSD::MinConnectedSessions
is a static constexpr with value 3, symbolized for clarity.Checklist
make prettier-write
and formatted the code.make check
make run
and manually verified that everything looks okay