Skip to content

Random high lock waiting time in PostgreSQL #244

Description

@bubiche

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions