Skip to content
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

Remove disabled StreamSocket::checkRemoval criteria minimum throughput #10325

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

sgothel
Copy link

@sgothel sgothel commented Oct 25, 2024

Change-Id: I9212cdf8b87c1c7b0df5761db956cbaa4fd44f58

Summary

PR #9916 added MinBytesPerSec minimum throughput criteria for checkRemoval to limit connections, i.e. cleaning up unresponsiveness or lagging sockets.

Due to its unreliable nature per request, the criteria has been disabled per default but remained in the code test w/ UT UnitTimeoutSocket.

Turns out that even the UT may fail on certain test setups.

We decided to remove this criteria altogether, as it will nor be used.

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

…` minimum throughput

PR #9916 added `MinBytesPerSec` minimum throughput criteria for checkRemoval
to limit connections, i.e. cleaning up unresponsiveness or lagging sockets.

Due to its unreliable nature per request, the criteria has been disabled per default
but remained in the code test w/ UT UnitTimeoutSocket.

Turns out that even the UT may fail on certain test setups.

We decided to remove this criteria altogether, as it will nor be used.

Signed-off-by: Sven Göthel <[email protected]>
Change-Id: I9212cdf8b87c1c7b0df5761db956cbaa4fd44f58
@sgothel sgothel added the 24.04 label Oct 25, 2024
@sgothel sgothel requested a review from Ashod October 25, 2024 09:51
@sgothel sgothel self-assigned this Oct 25, 2024
Copy link
Contributor

@Ashod Ashod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @sgothel. Less code is more reliable code.

Copy link
Contributor

@mmeeks mmeeks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible to me - I was really unsure why that was there in the 1st place - was this based on some research of some other server that does this.

Also - we should consider not dis-connecting sockets that still have live requests being processed - and/or/particularly those with un-sent data in the output socket-buffer.

@sgothel
Copy link
Author

sgothel commented Oct 25, 2024

Looks sensible to me - I was really unsure why that was there in the 1st place - was this based on some research of some other server that does this.

It was one of your ideas in #9833, see #9833 (comment)

Also - we should consider not dis-connecting sockets that still have live requests being processed - and/or/particularly those with un-sent data in the output socket-buffer.

Then I shall add another PR, not hard closeConnection(), but rather leaving it up to the _shutdownSignalled instrument in StreamSocket via its shutdown() only. Will do.
(Edit: Address with #10326)

@sgothel sgothel merged commit 105e6ea into master Oct 25, 2024
13 checks passed
@sgothel sgothel deleted the private/sgothel/socket_removal_drop_minthroughput branch October 25, 2024 10:58
@mmeeks
Copy link
Contributor

mmeeks commented Oct 25, 2024

Ah ! =) so slow-DOS prevention; worth reading how other proxies & web servers handle this - makes sense in the abstract of course.

@sgothel
Copy link
Author

sgothel commented Oct 25, 2024

Ah ! =) so slow-DOS prevention; worth reading how other proxies & web servers handle this - makes sense in the abstract of course.

Yup, could re-add this - however, would need a well average-throughput statistical fancy working method.

While the removed throughput was an average, it should have been skipped for some initial time at least
and also would need heavy testing etc.

I did the relaxed ping lag average on the WSPing though .. which seems to be OK.

@Ashod
Copy link
Contributor

Ashod commented Oct 25, 2024

A threshold for open sockets is a good starting point. Only when we are above it do we need to see which sockets are slow/unresponsive and remove them. With a sensible threshold (ideally configurable), this should be safe while being defensive (when needed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Handle limited open Connections due to keepalive connections (cool#9621)
3 participants