Skip to content

Commit 57599e5

Browse files
authored
docs(gateway): added a new page with resources info (#6422)
1 parent e75085b commit 57599e5

File tree

3 files changed

+49
-10
lines changed

3 files changed

+49
-10
lines changed

packages/web/docs/src/pages/docs/gateway/deployment/_meta.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export default {
22
index: 'Overview',
3+
'resources-requirements': 'Resources',
34
docker: 'Docker',
45
serverless: 'Serverless / On the Edge',
56
'node-frameworks': 'Frameworks',
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { Callout } from '@theguild/components'
2+
3+
# Resources Requirements
4+
5+
Defining the right amount of resources for your GraphQL gateway is crucial for maintaining
6+
performance and reliability. This guide will help you understand how to allocate resources
7+
effectively.
8+
9+
## CPU and Memory
10+
11+
The primary resources you need to allocate for your gateway are CPU and memory. These resources
12+
ensure that your gateway runs efficiently.
13+
14+
For most applications, you can start with the following default values:
15+
16+
- **CPU: 1**
17+
- **Memory: 1GB**
18+
19+
These values are suitable for most applications. However, you may need to adjust them based on your
20+
application's specific requirements. For instance, if your application experiences high traffic, you
21+
may need to increase the CPU and memory allocations.
22+
23+
For production environments with high traffic, we recommend the following values:
24+
25+
- **CPU: 2**
26+
- **Memory: 2-4GB**
27+
28+
## Environment Variables
29+
30+
Set `NODE_ENV` to `production` to ensure your gateway runs in production mode. This setting also
31+
enables [parallelism optimizations](https://nodejs.org/api/cluster.html) that can enhance
32+
performance.
33+
34+
By default, the gateway uses the available parallelism (number of CPUs, based on NodeJS's
35+
`os.availableParallelism`) to determine the number of workers to spawn.
36+
37+
You can set the `FORK` environment variable to specify the number of workers you want to spawn. For
38+
example, to spawn 12 workers, set `FORK=12`.

pnpm-lock.yaml

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)