-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
workload: add idle-conns flag for adding idle connections to tpcc #62740
workload: add idle-conns flag for adding idle connections to tpcc #62740
Conversation
Did some manual testing with the flag on a local setup. Do we actually want to add some configurations to roachtest? Also there is a flag for configuring number of connections These examples only show a loose correlation between latencies increasing and idle conns. I want to do more testing with diff configurations. idle_0.txt |
3551f19
to
b7f5ab3
Compare
b7f5ab3
to
86fb915
Compare
Ran more tests with idle conns, tpcc for 300s on 3 node roachprod cluster, don't see a trend for latencies and idle conns. idle_0.txt |
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @RichardJCai)
pkg/workload/tpcc/tpcc.go, line 681 at r1 (raw file):
fmt.Printf("Initializing %d idle connections...\n", w.idleConns) var conns []*pgxv4.Conn
any reason to use pgx/v4 just for this part? i think it'd be better to use the same version everywhere in the same package
pkg/workload/tpcc/tpcc.go, line 682 at r1 (raw file):
fmt.Printf("Initializing %d idle connections...\n", w.idleConns) var conns []*pgxv4.Conn for i := 0; i < w.idleConns; i++ {
ah interesting. this seems like a good knob to have!
i didn't quite have this mind -- i was imagining that we would want more/better configuration for the MultiConnPool
that is set up above (lines 620-630).
i thought the place to start would be to make MaxConnsPerPool
not be hardcoded to 50. hmm but reading how pg_helpers.NewMultiConnPool works, maybe that setting isn't so relevant. we already have configuration for MaxTotalConnections
which is more relevant for determining pool size (and influence the number of idle connections)
i think the issue here is that the pgxpool isn't that configurable. turns out all the interesting options (like MaxConnLifetime and MaxConnIdleTime) are only in v4... https://pkg.go.dev/github.com/jackc/pgx/v4/pgxpool
do you have an idea of how complicated it would be to upgrade this code to use pgx/v4 everywhere?
86fb915
to
29d88b5
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rafiss)
pkg/workload/tpcc/tpcc.go, line 681 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
any reason to use pgx/v4 just for this part? i think it'd be better to use the same version everywhere in the same package
Yeah going to use the same version.
pkg/workload/tpcc/tpcc.go, line 682 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
ah interesting. this seems like a good knob to have!
i didn't quite have this mind -- i was imagining that we would want more/better configuration for the
MultiConnPool
that is set up above (lines 620-630).i thought the place to start would be to make
MaxConnsPerPool
not be hardcoded to 50. hmm but reading how pg_helpers.NewMultiConnPool works, maybe that setting isn't so relevant. we already have configuration forMaxTotalConnections
which is more relevant for determining pool size (and influence the number of idle connections)i think the issue here is that the pgxpool isn't that configurable. turns out all the interesting options (like MaxConnLifetime and MaxConnIdleTime) are only in v4... https://pkg.go.dev/github.com/jackc/pgx/v4/pgxpool
do you have an idea of how complicated it would be to upgrade this code to use pgx/v4 everywhere?
It would be a fair bit of manual work to upgrade it to pgx/v4, we have to update MultiConnPool in pgx_helpers.go
to pgx/v4 as well which has a lot of uses. We would have to completely rework MultiConnPool
since it has a pgx.ConnPool which from what I've seen, pgx/v4 does not actually have, decent amount of plumbing to replace it but I'll make an issue for it.
29d88b5
to
ddd4cf1
Compare
Release note: None
ddd4cf1
to
fbb2898
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.
lgtm! hopefully either you or i can get to that followup issue later after the first batch of work is done
Reviewed 2 of 2 files at r2.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rafiss)
Yep my plan is to tackle in during flex week. |
TFTR bors r=rafiss |
bors r=rafiss |
Build failed (retrying...): |
Build failed: |
I think it flaked, will try again |
Build succeeded: |
workload: add idle-conns flag for adding idle connections to tpcc
Release note: None
#62526