Repository navigation
ate-setup: default the apiserver's read/write pool to 20 connections - #2493
Davanum Srinivas (dims) wants to merge 1 commit into
Conversation
d122ae5 to
e8ab6c6
Compare
f277ee5 to
d986670
Compare
|
I think the reason for this fix is good, but the new default causes two problems: 🤖 AI review finding
Possible fixes:
Separately, two docs still show the old default of Please also add a test for the new default and for a connection string that already sets |
|
Jeremy Alvis (@iplay88keys) thank you for the review. i will explore the second option. will take care of the other things you pointed out as well |
d986670 to
bf1c244
Compare
|
Jeremy Alvis (@iplay88keys) Done and ready. PTAL |
7c3b191 to
4bbcc70
Compare
|
I'm not sure my approval carries mergeability weight, so you'll want a review by one of the maintainers. That being said, here's a follow-up review: 🤖 AI review finding The size10 limit now also applies to external PostgreSQL. Before this change, the limit of 64 was only in the bundled connection string. Now Nits:
|
You are all i've got :) |
4bbcc70 to
ce41a8b
Compare
9e56c9b to
730221e
Compare
d79833e to
97edb07
Compare
1d05771 to
8229e48
Compare
pgxpool's default of max(4, NumCPU) opens one connection per CPU of the node, which on a large host exhausts PostgreSQL's 100 default slots. The installer now sets ATE_API_POSTGRES_POOL_MAX_CONNS to 20 per replica, and to 64 on size10 with the bundled PostgreSQL, which used to pin that through its DSN and is provisioned for it; an external database keeps 20, and an adopted Cloud SQL install keeps its recorded limit. A supplied value wins over the size profile. ateapi's own flag keeps its unset default, so a direct run still follows the DSN or pgxpool. Zero is refused by the installer. Signed-off-by: Davanum Srinivas <davanum@gmail.com>
8229e48 to
7ba1421
Compare
On a large host ateapi's read/write pool defaulted to one connection per CPU (pgxpool's
max(4, NumCPU)), so a few replicas exhausted PostgreSQL's 100 default slots and requests failed withremaining connection slots are reserved.The installer now sets
ATE_API_POSTGRES_POOL_MAX_CONNSto 20 per replica, and to 64 on--cluster-size size10with the bundled PostgreSQL, which used to pin that through its DSN and is provisioned for it. An external database keeps 20, and an adopted Cloud SQL install keeps its recorded limit. A supplied value wins over the size profile; 0 is refused at install time.ateapi's own flag keeps its unset default, so a direct run still follows the DSN or pgxpool.Docs:
docs/guides/postgres.md,docs/guides/operator-install.md,docs/guides/benchmarking.mdanddocs/dev/cloud-sql-scaling-guide.md.go test -race ./cmd/ate-setup/...(newTestLoadPostgresPoolMaxConns, including size10 with an external database, and an adopted install without a recorded limit inTestCreateAPIServerEnvVarsAdoptsPostgresIdentity) and the newTestReadWritePoolConfigMaxConnsin atepg, which pins that a set limit replaces the DSN'spool_max_connsand an unset one keeps it;go vet,golangci-lint.