#1233 Cache roster of offline users

Reporter Zash
Owner Zash
Created
Updated
Stars ★★ (2)
Tags
  • Priority-High
  • Milestone-0.12
  • Type-Enhancement
  • Status-Fixed
  • Difficulty-Easy
  • Performance
  1. Zash on

    Summary: Cache rosters of offline users in order to improve performance Motivation Access checks involving rosters happens a lot, especially with PEP. This can lead to loading the same users' roster a large number of times every time one of their contacts broadcast presence. Loading recently used rosters from a cache instead of storage should improve performance and reduce needless I/O.

  2. Zash on

    Should be fairly easy, just sprinkle some util.cache on top and call it a day! ;)

    Changes
    • tags Difficulty-Easy
  3. MattJ on

    Changes
    • tags Priority-High
  4. Zash on

    Done in https://hg.prosody.im/trunk/rev/42a3e3a28248

    Changes
    • tags Status-Fixed
    • owner Zash
  5. MattJ on

    Applied in 0.11 as 3df479098696

  6. ge0rg on

    That's pretty awesome. 24h roster lookup stats from my server: 1804191 load_roster: cache hit 102511 load_roster: cache miss, loading from storage That's already great, but I'd like to micromanage this some more. Could you please make the size of the roster cache configurable?

  7. MattJ on

    Not necessarily opposing, but without knowing the memory usage (one side of the trade-off) I don't see how you can meaningfully configure this value.

New comment

Not published. Used for spam prevention and optional update notifications.