Skip to content

Read replica production best practices #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9da32a8
Merge pull request #1 from googleforgames/master
syntxerror Nov 17, 2020
b00f71b
Merge pull request #2 from googleforgames/master
syntxerror Jan 22, 2021
13b7bfa
Merge pull request #3 from googleforgames/master
syntxerror Mar 3, 2021
e1a9ed8
Merge pull request #4 from googleforgames/master
syntxerror Mar 24, 2021
7d929d1
Merge branch 'master' of github.com:googleforgames/open-match-docs
syntxerror Apr 13, 2021
aee6a58
Merge branch 'master' of github.com:googleforgames/open-match-docs
syntxerror Apr 14, 2021
e6e277b
update versioning across files on master
syntxerror Apr 15, 2021
a057e8f
Merge branch 'master' of github.com:googleforgames/open-match-docs
syntxerror May 2, 2021
f3796fd
Merge branch 'master' of github.com:googleforgames/open-match-docs
syntxerror May 3, 2021
b19d756
Merge branch 'googleforgames:master' into master
syntxerror May 14, 2021
cb3fc58
Merge branch 'master' of github.com:googleforgames/open-match-docs
syntxerror May 18, 2021
6bdacc7
Merge branch 'master' of github.com:syntxerror/open-match-docs
syntxerror May 18, 2021
854b0fd
Merge pull request #5 from googleforgames/master
syntxerror Oct 16, 2021
48f7c9f
rebase
syntxerror Jun 6, 2022
aac8c34
another rebase
syntxerror Jun 21, 2022
99f70c7
Merge pull request #6 from googleforgames/main
syntxerror Jun 21, 2022
ebfbb46
Add read replica documentation
syntxerror Jun 21, 2022
43deed7
Add line of conn to modify
syntxerror Jun 21, 2022
e78ce74
fixed styling
syntxerror Jun 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion site/content/en/docs/Guides/Production/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,11 @@ helm install open-match --create-namespace --namespace open-match open-match/ope
--set open-match-override.enabled=true \
--set open-match-core.redis.enabled=false \
--set open-match-core.redis.hostname= # Your redis server address
```
```

## Enabling Read Replicas
Open Match can support many profiles (see the [issue](https://github.com/googleforgames/open-match/issues/1125) here), but read replica support has benefits depending on scale. It currently uses an open-source Redis image, and all reads and writes are on the master node (which will be referred to as the primary node going forward). At scale, there will be a considerable load when reading and writing, especially when querying tickets for profiles. To turn on read-replicas, follow the suggestions below:
- Ensure that Redis is configured for read-replicas (read the documentation for Redis to help) within the values.yaml/values-production.yaml.
- Within `internal/statestore/redis.go`, modify the [RedisBackend](https://github.com/googleforgames/open-match/blob/120a114647fdae3423fa492fd4c01bdd9f6498b3/internal/statestore/redis.go#L58) to have a read-only pool. The port 6379, which is the port to connect to replicas for read-only access by default for most Redis images (see the documentation for the Redis image used)
- Within the [`GetTickets`](https://github.com/googleforgames/open-match/blob/120a114647fdae3423fa492fd4c01bdd9f6498b3/internal/statestore/ticket.go#L60) function in `internal/statestore/ticket.go`, modify the function to use the read-only pool for the [connection](https://github.com/googleforgames/open-match/blob/120a114647fdae3423fa492fd4c01bdd9f6498b3/internal/statestore/ticket.go#L61).
Reading and caching tickets will now happen on replicas, and the load on the primary node will be lessened.