Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

device_list_stream is stored inefficiently, leading to massive disk space use #1962

Closed

Description

@richvdh

the device_list_stream table is supposed to store deltas of device lists (ie, just the devices which change), but sometimes it gets confused and ends up storing the entire device list for certain users.

We have users who have over 6000 devices (which is a separate problem), so it's possible to churn through disk space at gigabytes per hour.

Activity

  1. richvdh commented on Mar 2, 2017

    @richvdh
    MemberAuthor

    we also SELECT user_id FROM device_lists_stream WHERE stream_id > ?, rather than SELECT DISTINCT, so the query result is potentially huge, which can make synapse use all the memory.

  2. richvdh commented on Mar 3, 2017

    @richvdh
    MemberAuthor

    To check if you are being affected by this, connect to the database and:

    SELECT count(*) c,user_id from device_lists_stream group by user_id having count(*) > 1000000;
    

    if the above shows users with many entries, you can delete them with:

    DELETE from device_lists_stream WHERE user_id=<user_id>;
    

    (Note that this may harm your ability to communicate with that user using end-to-end-encryption).

  3. richvdh commented on Mar 8, 2017

    @richvdh
    MemberAuthor

    fixed in #1964 / #1969, I think.

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