Skip to content

Commit 1e761d1

Browse files
removing the socket cleanup completely, the original fixes prevent the CLOSE_WAITS from even appearing now:
[10:20:20] rss=292.3MiB LISTEN=1 [10:20:25] rss=292.3MiB LISTEN=1 [10:20:31] rss=310.6MiB LISTEN=1 TIME_WAIT=118 [10:20:36] rss=336.7MiB LISTEN=1 TIME_WAIT=283 [10:20:41] rss=336.2MiB LISTEN=1 TIME_WAIT=453 [10:20:47] rss=370.5MiB LISTEN=1 TIME_WAIT=633 [10:20:52] rss=371.1MiB LISTEN=1 TIME_WAIT=804 [10:20:58] rss=396.4MiB LISTEN=1 TIME_WAIT=976 [10:21:03] rss=417.8MiB LISTEN=1 TIME_WAIT=1196 [10:21:08] rss=425.8MiB LISTEN=1 TIME_WAIT=1260 [10:21:14] rss=425.6MiB LISTEN=1 TIME_WAIT=1260 [10:21:19] rss=425.6MiB LISTEN=1 TIME_WAIT=1260 [10:21:24] rss=425.6MiB LISTEN=1 TIME_WAIT=1260 [10:21:30] rss=425.6MiB LISTEN=1 TIME_WAIT=1199 [10:21:35] rss=425.6MiB LISTEN=1 TIME_WAIT=1085 [10:21:41] rss=425.6MiB LISTEN=1 TIME_WAIT=970 [10:21:46] rss=425.6MiB LISTEN=1 TIME_WAIT=684 [10:21:51] rss=425.6MiB LISTEN=1 TIME_WAIT=520 [10:21:57] rss=288.0MiB LISTEN=1 TIME_WAIT=398 [10:22:02] rss=288.0MiB LISTEN=1 TIME_WAIT=113 [10:22:07] rss=288.0MiB LISTEN=1 [10:22:13] rss=288.0MiB LISTEN=1 [10:22:18] rss=288.0MiB LISTEN=1 no more CLOSE_WAIT sockets setting the v8 heap to 1GB will still allow gc to trigger, gently and then more aggressively as the heap usage gets close to 1GB. Even 512Mb would be fine...
1 parent 31ab609 commit 1e761d1

3 files changed

Lines changed: 1 addition & 35 deletions

File tree

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ COPY --from=builder /app/packages/db/migrations ./db/migrations
5252
# Automatically leverage output traces to reduce image size
5353
# https://nextjs.org/docs/advanced-features/output-file-tracing
5454
COPY --from=builder /app/apps/nextjs/.next/standalone ./
55-
COPY --from=builder /app/apps/nextjs/socket-cleanup.cjs ./apps/nextjs/socket-cleanup.cjs
5655
COPY --from=builder /app/apps/nextjs/.next/static ./apps/nextjs/.next/static
5756
COPY --from=builder /app/apps/nextjs/public ./apps/nextjs/public
5857
COPY scripts/run.sh ./run.sh

apps/nextjs/socket-cleanup.cjs

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

scripts/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ TASKS_PID=$!
5151
node apps/websocket/wssServer.cjs &
5252
WSS_PID=$!
5353

54-
node --max-old-space-size=1024 --expose-gc --require apps/nextjs/socket-cleanup.cjs apps/nextjs/server.js &
54+
node --max-old-space-size=1024 apps/nextjs/server.js &
5555
NEXTJS_PID=$!
5656

5757
# Function to handle SIGTERM and shut down services

0 commit comments

Comments
 (0)