Allow configuration of Synapse's cache without using synctl or environment variables#6391
Conversation
…environment variables.
7f59798 to
a14831d
Compare
synapse/http/client.py
Outdated
| # lots of idle connections around. | ||
| pool = HTTPConnectionPool(self.reactor) | ||
| pool.maxPersistentPerHost = max((100 * CACHE_SIZE_FACTOR, 5)) | ||
| # XXX: Why does this use the cache factor???? |
There was a problem hiding this comment.
it was just a handy way of making it scale for larger instances. The logic went that if you're running a larger instance, you'll bump your cache factor, and will probably want a bigger connection pool too. it's a bit of a hack, but otoh I didn't want to have millions of options that you have to tune.
| self._state_group_members_cache = DictionaryCache( | ||
| "*stateGroupMembersCache*", | ||
| 500000 * get_cache_factor_for("stateGroupMembersCache"), | ||
| "*stateGroupMembersCache*", 500000 |
There was a problem hiding this comment.
Why does this no longer have a cache factor?
There was a problem hiding this comment.
because now DictionaryCache does the cache factor math, not the things that call it
There was a problem hiding this comment.
Sorry, I'm not following where its doing that? AFAICT get_cache_factor_for is only called for a single cache?
There was a problem hiding this comment.
right, but now you can configure any of the cache sizes, so it's done in the caches itself
richvdh
left a comment
There was a problem hiding this comment.
sorry I'm still banging on about sample config.
docs/sample_config.yaml
Outdated
| # Controls the global cache factor. This overrides the "SYNAPSE_CACHE_FACTOR" | ||
| # environment variable. |
There was a problem hiding this comment.
please can you explain what a global cache factor is, and document the default setting?
docs/sample_config.yaml
Outdated
| # false | ||
|
|
||
|
|
||
| ## Cache Configuration ## |
There was a problem hiding this comment.
I'm surprised the very end of the file is the most appropriate place?
There was a problem hiding this comment.
I've moved it much further up, near the database config. What do you think?
…cache-config-without-synctl
…cache-config-without-synctl
…cache-config-without-synctl * 'develop' of github.com:matrix-org/synapse: (43 commits) Remove unused store method get_hosts_in_room (#7448) Don't UPGRADE database rows RST indenting Put rollback instructions in upgrade notes Fix changelog typo Oh yeah, RST Absolute URL it is then Fix upgrade notes link Provide summary of upgrade issues in changelog. Fix ) Move next version notes from changelog to upgrade notes Changelog fixes 1.13.0rc1 Documentation on setting up redis (#7446) Rework UI Auth session validation for registration (#7455) Extend spam checker to allow for multiple modules (#7435) Implement OpenID Connect-based login (#7256) Add room details admin endpoint (#7317) Fix errors from malformed log line (#7454) Drop support for redis.dbid (#7450) Fixes typo (bellow -> below) (#7449) ...
…nment variables (#6391)
…nment variables (#6391)
This mostly applise to `*stateGroupCache*` and co. Broke in #6391.
This mostly applise to `*stateGroupCache*` and co. Broke in #6391.
…#7580) This mostly applise to `*stateGroupCache*` and co. Broke in matrix-org#6391.
This is useful in docker environments, where you have the ability to easily change config files, not not always env vars. It also makes it not a weird odd-one-out as far as configuring your Synapse install.