Deploying my nodejs that runs using pm2 on app platfrom

Okay I was searching for my options to deploy my nodejs and found app platform which I thing is great but If I wanted to run my nodejs using pm2 to enable clustering is that possible or should I just implement my clustering logic on my own. Secondly If I wanted to use redis later on to cache some endpoints results on my server would that be possible? And would any of those cause additional fees (assuming I dont need more RAM)?

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

DigitalOcean Employee
DigitalOcean Employee badge
March 11, 2021
Accepted Answer

The app platform has a load balancer built into it, allowing you to scale the number of instances of your application to your needs. That being said, could be times when you would like something like pm2. Some of the instance sizes offered have multiple CPU cores, and to be able to take advantage of them you would need to either have multi-threaded code, or spawn multiple worker processes. There are multiple ways to achieve that. Also, if the app platform will try to restart the application if the process dies.

It is possible to add connections to redis or other databases. DigitalOcean offers managed databases (redis, mysql, postgres, mongodb) which can be used with the app platform.

Pricing depends on the scale of the application, plus any overage fees for extra bandwidth or excessive building times. Managed databases are also an additional service that would add extra charges. Pricing for app platform can be found here. Pricing for managed database can be found here.