-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Limit the amount of requests the proxy can queue up in memory #2812
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
Limit the amount of requests the proxy can queue up in memory #2812
Conversation
|
closes #2792 |
|
|
||
| bool operator == (const RequestStream<T>& rhs) const { return queue == rhs.queue; } | ||
| bool isEmpty() const { return !queue->isReady(); } | ||
| uint32_t size() const { return queue->size(); } |
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.
Seems like this is added but not used?
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.
yeah, at one point I actually used it, but figured it was still probably a good function so I left it in
ajbeamon
left a comment
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.
I guess the priority changes make us more vulnerable to CPU starvation at higher numbers of requests. We could probably minimize that by limiting the work done with each request at ReadSocket priority to only be the logic that lets it into the queue or rejects it.
|
Rejected requests may be a useful metric for status. |
|
add errors to status |
…CPU with large numbers of outstanding requests
By receiving messages from the network at a high priority, we can track the number of requests outstanding, and if the proxy already has too many requests, send an error instead of responding to the message.
If a 6.2.18 or lower client sees this error from a GRV call, it will see database_locked or transaction_too_old errors instead of the proxy_memory_limit_exceeded error.