Skip to content

Commit dffa1e6

Browse files
build(fly): use fly.toml .swap_size_mb to create swap (#706)
* build(fly): use `fly.toml` `.swap_size_mb` to create swap The previous manual swap creation no longer works. Signed-off-by: Hunar Roop Kahlon <[email protected]> * docs: update docs for setting up swap Signed-off-by: Hunar Roop Kahlon <[email protected]> --------- Signed-off-by: Hunar Roop Kahlon <[email protected]>
1 parent 4c9b2b1 commit dffa1e6

File tree

5 files changed

+4
-23
lines changed

5 files changed

+4
-23
lines changed

docs/database.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,6 @@ You've got a few options:
333333

334334
```yml
335335
# exec:
336-
# - cmd: node ./other/setup-swap.js
337-
338336
# - cmd: npx prisma migrate deploy
339337
# if-candidate: true
340338

@@ -343,8 +341,7 @@ You've got a few options:
343341

344342
2. Commit this change and deploy the app to fly.
345343
- This will make sure that after building the dockerfile and deploying it
346-
to the fly machine, the `node ./other/setup-swap.js`,
347-
`npx prisma migrate deploy` and `npm start` commands won't be executed.
344+
to the fly machine, `npx prisma migrate deploy` and `npm start` commands won't be executed.
348345
3. Now that the main machine is up and running, you can SSH into it by
349346
running `fly ssh console --app [YOUR_APP_NAME]` in the terminal.
350347
4. Create a backup of the DB and download it by following the steps mentioned
@@ -373,8 +370,6 @@ You've got a few options:
373370

374371
```yml
375372
exec:
376-
- cmd: node ./other/setup-swap.js
377-
378373
- cmd: npx prisma migrate deploy
379374
if-candidate: true
380375

docs/memory.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ avoid memory pressure even at that scale, we allocate a 512MB swap file. Learn
66
more about this decision in
77
[the memory swap decision document](decisions/010-memory-swap.md).
88

9-
To modify or increase the swap file, check `other/setup-swap.js`. This file is
10-
executed before running our app within the `litefs.yml` config.
9+
To modify or increase the swap file, check `.swap_size_mb` in `fly.toml`. This
10+
file is executed before running our app within the `litefs.yml` config.
1111

1212
> **NOTE**: PRs welcome to document how to determine the effectiveness of the
1313
> swap file for your app.

fly.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ primary_region = "sjc"
33
kill_signal = "SIGINT"
44
kill_timeout = 5
55
processes = [ ]
6+
swap_size_mb = 512
67

78
[experimental]
89
allowed_public_ports = [ ]

other/litefs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ lease:
2929
key: 'epic-stack-litefs/${FLY_APP_NAME}'
3030

3131
exec:
32-
- cmd: node ./other/setup-swap.js
33-
3432
- cmd: npx prisma migrate deploy
3533
if-candidate: true
3634

other/setup-swap.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)