Skip to content

Commit 8b8fd42

Browse files
added memory limit setting (#34)
1 parent 0b45602 commit 8b8fd42

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# PowerSync Self Hosted Example
22

3+
## v0.5.2
4+
5+
- Added note for PowerSync service memory limits using the `NODE_OPTIONS` environment variable.
6+
37
## v0.5.1
48

59
- Use Next (development) PowerSync service image for testing.

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Populate the `replication->connections` entry with your database connection deta
3838

3939
- **Postgres:** A simple Postgres server is provided in the `ps-postgres.yaml` Docker Compose file. Be sure to keep the credentials in `powersync.yaml` in sync with the config in `ps-postgres.yaml` if using this server.
4040

41-
- **MongoDB:** See the [`nodejs-mongodb` demo](./demos/nodejs-mongodb/) for MongoDB connection configuration.
41+
- **MongoDB:** See the [`nodejs-mongodb` demo](./demos/nodejs-mongodb/) for MongoDB connection configuration.
4242

4343
### Storage
4444

@@ -56,6 +56,12 @@ The `key-generator` project demonstrates generating RSA key pairs for token sign
5656

5757
[Sync Rules](https://docs.powersync.com/usage/sync-rules) are currently defined by placing them in `./config/sync_rules.yaml`.
5858

59+
### Memory Limits
60+
61+
It's recommended to set the `NODE_OPTIONS="--max-old-space-size=<size>"` environment variable to increase the default Node.js memory limit.
62+
63+
Service memory limits should be adjusted to roughly 80 percent of the system memory capacity.
64+
5965
# Cleanup
6066

6167
If you want to start from a fresh start:

services/powersync.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ services:
4242
# command: ['start', '-r', 'unified', '-c64', '[base64 encoded content]']
4343
POWERSYNC_CONFIG_PATH: /config/powersync.yaml
4444

45+
# Service memory limits should be adjusted to roughly 80 percent of the system memory capacity
46+
NODE_OPTIONS: --max-old-space-size=1000
47+
4548
# Sync rules can be specified as base 64 encoded YAML
4649
# e.g: Via an environment variable
4750
# POWERSYNC_SYNC_RULES_B64: "[base64 encoded sync rules]"

0 commit comments

Comments
 (0)