Skip to content

Random high lock waiting time in PostgreSQL #244

@bubiche

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions