Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Random high lock waiting time in PostgreSQL

Open
#244 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
postgresql, rails, ruby
Domain
databases

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rails/solid_cache

All issues in rails/solid_cache

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.