Extralite support and some housekeeping - #1
Open
dbackeus wants to merge 6 commits into
Open
Conversation
When benchmarking with the popular benchmarking tool wrk, doing POST requests require creating a LUA script which is annoying. No reason to use POST for these benchmarking routes.
Also bundle update
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 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.
The initial commits in this branch is house-keeping. You may want to just cherry pick some of those into your main branch to clean this PR up and let me know if there are any changes you'd prefer not to make.
I added a
Benchmarking#long_runningaction to easily try out parallel execution in a threaded environment. I've been running rails server with a single worker / 5 threads for this purpose via:WEB_CONCURRENCY=1 RUBY_YJIT_ENABLE=1 RAILS_LOG_LEVEL=debug SECRET_KEY_BASE=asdf RAILS_ENV=production DB_CLIENT=extralite rails sThen benchmarking with concurrency of 5:
wrk -c 5 -t 1 -d 10s http://localhost:3000/benchmarking/long_runningWith extralite I get ~4 rps, with sqlite3 <1rps, so the concurrency works as expected.
However, I've had a serious struggle with some weird initialization thing (bug?) where the very first requests do not appear to respect the
busy_timeout = 5configuration. This results inExtralite::BusyErroroccuring for just the initial queries, but never for subsequent ones. Super strange. This can be reproduced viaRAILS_ENV=production SECRET_KEY_BASE=asdf DB_CLIENT=extralite rails cand running:The first time I run this I get busy errors, but subsequent executions do not. I have confirmed that the busy handler configuration method has run before I hit this issue so the
busy_timeoutis definitely set. I also cannot reproduce it when manually using usingExtralite::Database:So it appears something funky is going on inside the ActiveRecord code that causes this issue.