-
Notifications
You must be signed in to change notification settings - Fork 54
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
chore: enhance libpq management #3015
Conversation
You can find the image built from this PR at
Built from 186d3a7 |
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.
Nice approach! Thank you for this!!!
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.
LGTM! Thank you.
|
||
return err("failed pqconsumeInput: unknown reason") | ||
asyncengine.addReader2(asyncFd, onDataAvailable).isOkOr: |
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.
AFAIU chronos will trigger onDataAvailable
directly on a socket read instead of doing db.check()
which is slower right?
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.
AFAIU chronos will trigger
onDataAvailable
directly on a socket read instead of doingdb.check()
which is slower right?
Yes correct :) In fact, the functions pqGetResult
and pqConsumeInput
( libpq-async ) doesn't behave well in high load conditions.
Description
Have better libpq data retrieval. In this PR we are starting to register the underlying socket FD into the chronos selectors so that we have a more optimized time management.
Also adding a metric to allow measuring the time spent in database queries and the time spent returning the response to the store client.
This is inspired by @Menduist 's comment: https://github.com/waku-org/nwaku/pull/1631/files#r1153293945