deepstream.io icon indicating copy to clipboard operation
deepstream.io copied to clipboard

Question - using DS with PM2

Open TertiumQuid opened this issue 10 years ago • 3 comments

Are there any issues running a deepstream nodejs server or client with the PM2 library (pm2.keymetrics.io)?

They seem complementary, but (without looking at the source) maybe there are low-level gotchas with how deepstream c libs handle things.

TertiumQuid avatar Oct 15 '16 12:10 TertiumQuid

We use pm2 quite often to run deepstream, and have not run into any issues as of yet! PM2 can run pure binaries too so is not confined to the nodeJS space.

We will be looking to provide our own daemon in the near future,, allowing multiple deepstreams to be run on the same machine to easily scale vertically and deal automatically with log rotation and such ( will be focused mainly on linux servers at first ).

yasserf avatar Oct 15 '16 12:10 yasserf

Generally, we recommend using the compiled executable. This is perfectly possible with pm2 as well which is just as good handling non-node processes. The command to start a deepstream process with a name of ds-dev and a specific config file would be e.g.

pm2 start --name ds-dev deepstream -- start -c ~/config-dev.yml

You can find more detailed examples here

http://stackoverflow.com/questions/39662059/multiple-instances-of-deepstream-io-server-inside-one-node

WolframHempel avatar Oct 15 '16 18:10 WolframHempel

Thanks a lot! That's all clear, and very helpful. I don't expect to have many parallelism use-cases, certainly not on AWS, but I'm just trying to figure out possible architecture strategies and tech stack.

TertiumQuid avatar Oct 20 '16 14:10 TertiumQuid