This repository was archived by the owner on Mar 24, 2026. It is now read-only.
Repository navigation
Try lower DB pool size for Crystal - #4160
Merged
Merged
Conversation
roberthusak
pushed a commit
to roberthusak/FrameworkBenchmarks
that referenced
this pull request
Nov 6, 2018
vlazar
added a commit
to vlazar/FrameworkBenchmarks
that referenced
this pull request
Nov 11, 2018
Lower DB pool size from TechEmpower#4160 results in better RPS on Citrine. Before https://www.techempower.com/benchmarks/#section=test&runid=56076e97-0658-46a1-81bb-6f8890f2e85e After https://www.techempower.com/benchmarks/#section=test&runid=5191fd86-6a2a-405b-b326-f160fc6781b7 Before After Better JSON 345k -> 1016k ~ 3x Single query 178k -> 261k ~ 1.5x Multiple queries 9.2k -> 11.9k ~ 1.3x Fortunes 87.5k -> 258.4k ~ 3x Data updates 1.2k -> 3.1k ~ 2.7x Plain Text 740k -> 2025k ~ 2.7x Note: Keep an eye on Latency, since it's dropped a lot in some cases. Might be a good idea to try average latency from multiple runs, as latency numbers seem to be in flux sometimes for no obvious reason. Before After Worse JSON 0.2ms -> 0.7ms ~ 3x Single query 0.6ms -> 0.4 ms Multiple queries 55ms -> 309ms > 5x Fortunes 1.3ms -> 173ms > 100x (!!!) Data updates 426sm -> 535ms ~ 1.2x Plain Text 4.3ms -> 13.9ms ~ 3x
vlazar
added a commit
to vlazar/FrameworkBenchmarks
that referenced
this pull request
Nov 11, 2018
Lower DB pool size from TechEmpower#4160 results in better RPS on Citrine. Before https://www.techempower.com/benchmarks/#section=test&runid=56076e97-0658-46a1-81bb-6f8890f2e85e After https://www.techempower.com/benchmarks/#section=test&runid=5191fd86-6a2a-405b-b326-f160fc6781b7 Before After Better JSON 345k -> 1016k ~ 3x Single query 178k -> 261k ~ 1.5x Multiple queries 9.2k -> 11.9k ~ 1.3x Fortunes 87.5k -> 258.4k ~ 3x Data updates 1.2k -> 3.1k ~ 2.7x Plain Text 740k -> 2025k ~ 2.7x Note: Keep an eye on Latency, since it's dropped a lot in some cases. Might be a good idea to try average latency from multiple runs, as latency numbers seem to be in flux sometimes for no obvious reason. Before After Worse JSON 0.2ms -> 0.7ms ~ 3x Single query 0.6ms -> 0.4 ms Multiple queries 55ms -> 309ms > 5x Fortunes 1.3ms -> 173ms > 100x (!!!) Data updates 426sm -> 535ms ~ 1.2x Plain Text 4.3ms -> 13.9ms ~ 3x
NateBrady23
pushed a commit
that referenced
this pull request
Nov 12, 2018
Lower DB pool size from #4160 results in better RPS on Citrine. Before https://www.techempower.com/benchmarks/#section=test&runid=56076e97-0658-46a1-81bb-6f8890f2e85e After https://www.techempower.com/benchmarks/#section=test&runid=5191fd86-6a2a-405b-b326-f160fc6781b7 Before After Better JSON 345k -> 1016k ~ 3x Single query 178k -> 261k ~ 1.5x Multiple queries 9.2k -> 11.9k ~ 1.3x Fortunes 87.5k -> 258.4k ~ 3x Data updates 1.2k -> 3.1k ~ 2.7x Plain Text 740k -> 2025k ~ 2.7x Note: Keep an eye on Latency, since it's dropped a lot in some cases. Might be a good idea to try average latency from multiple runs, as latency numbers seem to be in flux sometimes for no obvious reason. Before After Worse JSON 0.2ms -> 0.7ms ~ 3x Single query 0.6ms -> 0.4 ms Multiple queries 55ms -> 309ms > 5x Fortunes 1.3ms -> 173ms > 100x (!!!) Data updates 426sm -> 535ms ~ 1.2x Plain Text 4.3ms -> 13.9ms ~ 3x
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I've spent some time looking at the results before and after #3209 was merged where DB pool settings were added to one of Crystal implementations as a workaround.
Before #3209 https://www.techempower.com/benchmarks/#section=test&runid=ddc974dc-8f1a-4773-b609-c9c226fb42c2&hw=ph&test=json&l=hma7sv
After #3209 https://www.techempower.com/benchmarks/#section=test&runid=e70ce78c-fa34-4007-b3be-fee596ddb09e&hw=ph&test=json&l=hma7sv
Things I've noticed on physical hardware (Server Central):
RPS
It's ruined for endpoints with no DB involved:
Dropped for DB endpoints:
Latency
Became worse for
Improved for
Improved a lot for
I'm also taking into account the latest results where it's clear that every Crystal implementation except for one with DB pool settings has quite a lot of errors. So #3209 seems to prevent errors.
I'm also aware that in Cloud environment (Azure) it now performs very good after this fix. Especially for Single query and Fortunes endpoints.
I've seen other implementations are using 3-4 pool size per CPU for physical environment and 8 for cloud and produce very good results.
So what I want to try is a much lower DB pool size to see if it will start to perform better on physical hardware and at the same time not worse in cloud environment.
If this gives good results I'm going to add DB pool settings (maybe with some autotuning) for other Crystal implementations as a separate PR to prevent errors and improve results.