nean-stack-starter icon indicating copy to clipboard operation
nean-stack-starter copied to clipboard

2 instances of App

Open CharlBest opened this issue 6 years ago • 0 comments

Advantages:

  • requests can be handled quicker
  • less blocking
  • gently deploy and restart instances (zero downtime deployments) by shutting down one (two is still up), update one, startup one, shut down 2, one takes over requests, update two, startup two
  • After gentle zero downtime with 2 instances in available setup cron job to restart Nodejs (PM2) instances once a day for optimal perf (memory heap release etc.)

Disadvantages:

  • session token now needs to be stored in Reddis because in-memory user auth token won't necessarily be available depending on which instance the user hits

CharlBest avatar Aug 15 '19 07:08 CharlBest