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

docs(gateway): added a new page with resources info #6422

Merged
merged 4 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default {
index: 'Overview',
'resources-requirements': 'Resources',
docker: 'Docker',
serverless: 'Serverless / On the Edge',
'node-frameworks': 'Frameworks',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Callout } from '@theguild/components'

# Resources Requirements

Defining the right amount of resources for your GraphQL gateway is crucial for maintaining
performance and reliability. This guide will help you understand how to allocate resources
effectively.

## CPU and Memory

The primary resources you need to allocate for your gateway are CPU and memory. These resources
ensure that your gateway runs efficiently.

For most applications, you can start with the following default values:

- **CPU: 1**
- **Memory: 1GB**

These values are suitable for most applications. However, you may need to adjust them based on your
application's specific requirements. For instance, if your application experiences high traffic, you
may need to increase the CPU and memory allocations.

For production environments with high traffic, we recommend the following values:

- **CPU: 2**
- **Memory: 2-4GB**

## Environment Variables

Set `NODE_ENV` to `production` to ensure your gateway runs in production mode. This setting also
enables [parallelism optimizations](https://nodejs.org/api/cluster.html) that can enhance
performance.

By default, the gateway uses the available parallelism (number of CPUs, based on NodeJS's
`os.availableParallelism`) to determine the number of workers to spawn.

You can set the `FORK` environment variable to specify the number of workers you want to spawn. For
example, to spawn 12 workers, set `FORK=12`.
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading