Is NodeBB compatible with PM2?


  • Plugin & Theme Dev

    https://github.com/Unitech/pm2

    Will be using this instead of forever. Suggestions?


  • Admin

    NodeBB has been shown to work fine with pm2. However, I do not use it for the following reasons:

    • pm2 launches a "Satan" daemon that does not get killed, ever. This daemon hogs ports, so if you use stop or stopAll, congratulations, your previous NodeBB ports are now blocked forever.
    • Unitech's suggestion is to use Node 0.11.x. Are you serious? The latest stable build is still 0.10.
    • pm2 has no "programmatic" interface so I can use it as a module inside of a script. Forever has forever-monitor, and even though it's pretty buggy (outfiles and logs don't even work), at least I have that instead of... nothing.
    • In my (albeit limited) testing, I found that pm2 restart acted more like a soft restart. All modules were still loaded, meaning in development, old data was still being served.

    In short, I have to jump through hoops to kill -9 the satan instance in order to free a port. That's enough of a turn-off for me, but lots of people like it.

    Edit: Can you tell I don't like pm2?

    Edit 2: It is worth mentioning that I haven't tried pm2 in nearly a month. It may work better now.


  • Admin

    Suggestion to use pm2 kill to stop instances

    I understand that it is difficult when the underlying software (Node.js) breaks a crucial part of your program, and there is no obvious solution, so it isn't really the fault of the developers. I just simply won't use pm2 until Node v0.11 hits the shelves.

    I really tried to like pm2...!


  • Admin

    pm2 readme contains this snippet, which is a purported "workaround" to the ports issue on stop/stopAll:

    $ pm2 start index.js -x  # start my app in fork mode
    

  • Plugin & Theme Dev

    I can say that when I used it about 2 months ago I know what you're talking about when you have to jump through a bunch of b.s. to kill a process that won't die.

    I believe pm2 has gotten a bit better as I've been watching their progress closely which is why I've been hesitant on using it.

    @julian thanks for the information! Now you're making me not want to use it until node 0.11



  • currently using pm2 (8 processes on an 8 core server) works but only for non socket calls. Chat messages don't appear and the connection shows to constantly be lost and re established (from the browser) very rapidly.

    Any help on this?


  • Admin

    @Joseph-Mordica What features of pm2 do you use? If it's just to allow for horizontal scaling by having NodeBB instances use up all cores, then it's possible that we will bake that into our loader executable in future releases of NodeBB...


Log in to reply
 

Suggested Topics

  • 9
  • 2
  • 9
  • 4
  • 28
| |