Knowledgebase

Running Node in Production Print

  • backenddevelopment, backend, caching, webhosting, guide, howto, solution, zillionkinghost
  • 0

Operating the runtime.

WHAT TO USE

A process manager, restarting on failure and on server restart.

WHY

A crashed process otherwise stays down.

WHAT TO CONFIGURE

Automatic restart Log output to files or a collector Memory limits Startup on boot

WHAT ABOUT MULTIPLE CORES

One process uses one core.

WHAT TO DO

Run several processes behind a load balancer or the clustering facility.

WHAT TO PUT IN FRONT

A reverse proxy, handling encryption, static files and request limits.

WHY

It is better at those than the application.

WHAT TO SET

Graceful shutdown: finish in-flight requests, close connections, then exit.

WHY

Abrupt termination during deployment drops requests.

WHAT TO MONITOR

Event loop delay, which indicates blocking Memory, which indicates leaks Restart frequency

WHAT A GROWING MEMORY PROFILE INDICATES

A leak: listeners, timers or caches accumulating.

WHAT TO CHECK IN SHARED HOSTING

Whether persistent processes are permitted at all.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot