Random high lock waiting time in PostgreSQL
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
No source file or test is named. Start by reproducing the reported workload around the solid_cache_entries INSERT ... ON CONFLICT write and the frequent key_hash reads, then inspect PostgreSQL lock-wait behavior under the stated rates. Done means identifying the cause of the intermittent waits and documenting a verified mitigation.
Written by the indexing model from the issue text.
Description
I have been encoutering high lock wait time for the cache write query INSERT INTO "solid_cache_entries" ... randomly. These spikes don't correlate with a surge in traffic or anything. Is there a way for me to investigate more into this and how can I improve the situation?
I have tried using UNLOGGED TABLE as suggested here, which improved cache write perforamnce but it still didn't help.
For context the cache read query SELECT "solid_cache_entries"."key", "solid_cache_entries"."value" FROM "solid_cache_entries" WHERE "solid_cache_entries"."key_hash" IN ($1) is run ~7700 times/s and the cache write query INSERT INTO
"solid_cache_entries" ... ON CONLICT ... is run ~550 times/s, our database server CPU usage is only ~16% when the high lock waiting time happened.
- Dominant language
- Ruby
- Stars
- 1k
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rails/solid_cache
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rails/solid_cache#307 · 4 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
rails/solid_cache#195 · 6 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rails/solid_cache#101 · 5 comments · 11 reactions ·
All issues in rails/solid_cache
Similar issues
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
grafana/pyroscope#5729 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rubygems/rubygems.org#6895 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
samvera/hyku#3359 · 1 comment ·
Maintainers usually reply within 1 day
-
Child factories do not inherit traits from their parentPossibly taken @alassek claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rom-rb/rom-factory#99 ·