-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
Improve PG performance by 28% (!!!) #703
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A very long overdue PostgreSQL querying performance optimization that should have used cached queries, but ... somehow didn't. Also, this PR adds two new `just` tasks: `run-release` and `bench-http` I used [oha](https://github.com/hatoo/oha) for its visual appeal. All tests were using keep-alive, which I think is relatively accurate because clients make many tile requests on the same connection. As a target, I used the same non-empty small tile to reduce the PostgreSQL indexing load. ❯ just run-release ❯ oha -z 120s http://localhost:3000/function_zxy_query/18/235085/122323 <pre> | before the change | after the change | |----------------------------------|----------------------------------| | Summary: | Summary: | | Success rate: 1.0000 | Success rate: 1.0000 | | Total: 120.0004 secs | Total: 120.0002 secs | | Slowest: 0.1339 secs | Slowest: 0.3505 secs | | Fastest: 0.0015 secs | Fastest: 0.0012 secs | | Average: 0.0076 secs | Average: 0.0055 secs | | Requests/sec: 6583.6946 | Requests/sec: 9073.5398 | | | | | Total data: 113.02 MiB | Total data: 155.76 MiB | | Size/request: 150 B | Size/request: 150 B | | Size/sec: 964.41 KiB | Size/sec: 1.30 MiB | | | | | Response time histogram: | Response time histogram: | | 0.002 [1] | 0.001 [1] | | 0.015 [785706] ■■■■■■■■■■■■■ | 0.036 [1088825] ■■■■■■■■■■■■■ | | 0.028 [4225] | 0.071 [0] | | 0.041 [111] | 0.106 [0] | | 0.054 [2] | 0.141 [0] | | 0.068 [0] | 0.176 [0] | | 0.081 [0] | 0.211 [0] | | 0.094 [0] | 0.246 [0] | | 0.107 [0] | 0.281 [0] | | 0.121 [0] | 0.316 [0] | | 0.134 [1] | 0.350 [1] | | | | | Latency distribution: | Latency distribution: | | 10% in 0.0057 secs | 10% in 0.0039 secs | | 25% in 0.0064 secs | 25% in 0.0045 secs | | 50% in 0.0073 secs | 50% in 0.0053 secs | | 75% in 0.0084 secs | 75% in 0.0063 secs | | 90% in 0.0098 secs | 90% in 0.0074 secs | | 95% in 0.0107 secs | 95% in 0.0082 secs | | 99% in 0.0135 secs | 99% in 0.0102 secs | </pre>
nyurik
changed the title
Improve PG Query perf by 28% (!!!)
Improve PG performance by 28% (!!!)
Jun 4, 2023
stepankuzmin
approved these changes
Jun 4, 2023
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.
🔥
cc: @tobinbradley - you may want to re-run your perf test (this was released as v0.8.6) |
Will do! |
Nice! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A very long overdue PostgreSQL querying performance optimization that should have used cached queries, but ... somehow didn't.
Also, this PR adds two new
just
tasks:run-release
andbench-http
I used oha for its visual appeal. All tests were using keep-alive, which I think is relatively accurate because clients make many tile requests on the same connection. As a target, I used the same non-empty small tile to reduce the PostgreSQL indexing load.
bench-http
runs this command:Fixes #678