This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Precompute joined hosts and store in Redis #9198
Precompute joined hosts and store in Redis #9198
Changes from 7 commits
4c56124
baac88a
62857fb
007c326
e980279
eacd623
da4ad62
dfb92dd
a5c3589
51b9cb3
a524c1b
0125d67
f37f0e2
7a4fbb5
b8f3ea4
77764e0
6fd1172
c5cc378
e78ea69
2103b32
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this should be
redis enabled and more than one federation sender
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or at the very least if the federation sending is done by the main process it probably doesn't make sense to use this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, though it is worth noting that it's a) probably cheaper to calculate it on event creator, as you'll already have the state in the cache, and b) means that you can run multiple event creators to split up the work without having to run multiple federation senders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right that makes sense. I guess it is a reasonable assumption that anyone running workers would be running at least one of an event creator or federation sender?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, and its really not the end of the world if they aren't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our other caches seem to name these methods as simply
set
andget
I also wonder if instead of
expire_seconds
we should doexpiry_ms
as theExpiringCache
does.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Annoyingly the
ExpiringCache
usesexpiry_ms
(with a y). I don't know if matters much.Also do you have thoughts on
set
/get
vs.set_cache
/get_cache
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I KNEW THERE WAS SOMETHING I FORGOT TO DO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at a quick glance, txredisapi encodes integers as strings (starting with
$<len>\r\n
) rather than ints (starting with:
) for the redis protocol, so the json-encoding of an int is the same as the int itself.possibly to counter that bit of hackery, txredisapi also has a
convertNumbers
setting, which is enabled for us, which will make it try to convert things-that-look-like-numbers back into numbers. That sounds like a CPU sink and a thing we should turn off...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, that's quite special. Yeah, I agree we should turn it off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do it in a separate PR though I think