Skip to content
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

update best practices #735

Merged
merged 3 commits into from
May 7, 2024
Merged
Changes from all commits
Commits
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
17 changes: 13 additions & 4 deletions docs/content/getting-started/production-best-practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,25 @@ import {

<DocumentationNotice />

The following list outlines some guidelines and best practices for running OpenFGA in a production environment:
The following list outlines best practices for running OpenFGA in a production environment:

- [Configure Authentication](./setup-openfga/docker-setup.mdx#configuring-authentication)
- Enable HTTP TLS or gRPC TLS or both
- Set the log.format to "json"
- Set the log.level to "info"
- [Disable the Playground](./setup-openfga/docker-setup.mdx#playground).
- Set the log format to "json" and log level to "info"
- [Disable the Playground](./setup-openfga/docker-setup.mdx#playground)
- [Set Cluster](#cluster-recommendations)
- [Set Database Options](#database-recommendations)
- [Set Concurrency Limits](#concurrency-limits)

## Cluster Recommendations

We recommend:

1. Turn on caching via the flag `--check-query-cache-enabled`. This will reduce latency of requests, but it will increase the staleness of OpenFGA's responses. (The TTL is configurable).
2. Prefer having a small pool of servers with high capacity (memory and CPU cores) instead of a big pool of servers, to increase cache hit ratios and simplify pool management.
3. Turn on metrics collection via the flags `--metrics-enabled` and `--datastore-metrics-enabled`. This will allow you to debug issues.
rhamzeh marked this conversation as resolved.
Show resolved Hide resolved
4. Turn on tracing via the flag `--trace-enabled`, but set sampling ratio to a low value, for example `--trace-sample-ratio=0.3`. This will allow you to debug issues without overwhelming the tracing server. However, keep in mind that enabling tracing comes with a slight performance cost.

## Database Recommendations

To ensure good performance for OpenFGA, it is recommended that the [database](./setup-openfga/docker-setup.mdx#configuring-data-storage) be:
Expand Down
Loading