Multiple services in one webservice

Hey,
I am trying to start 2 services, one on port 3000 (nodejs) the other on port 8090 (pocketbase). I am using node foreman to start both services simultaneously, judging from a thread titled “best-practices-to-run-multiple-process-in-a-web-service”, it seems plausible, I can’t link the thread because of the link limit
However, upon deployment, I am stuck at the following step:

Jul 22 01:59:11 PM > towa@0.1.0 start
Jul 22 01:59:11 PM > nf --procfile etc/Procfile.prod start
Jul 22 01:59:11 PM
Jul 22 01:59:15 PM 8:59:14 PM web.1 | - ready started server on 0.0.0.0:3000, url: http://localhost:3000
Jul 22 01:59:20 PM ==> Using Node version 20.3.0 via environment variable NODE_VERSION

Jul 22 01:59:20 PM ==> Starting service with ‘npm start’
Jul 22 01:59:24 PM
Jul 22 01:59:24 PM > towa@0.1.0 start
Jul 22 01:59:24 PM > nf --procfile etc/Procfile.prod start
Jul 22 01:59:24 PM
Jul 22 01:59:28 PM 8:59:27 PM web.1 | - ready started server on 0.0.0.0:3000, url: http://localhost:3000

Please advise

update, deploying just a single service using “next start” works just fine, does this mean we can’t deploy multiple services under one instance?

Hi,

You can start multiple processes, but only one process/port can be exposed to the public internet, as covered in the docs: https://render.com/docs/web-services#host-and-port-configuration

All processes/ports could be accessed internally by other services in your account (but not when using free instance types). Running multiple processes on the same service often isn’t a great setup as it could affect performance and likely effect your ability to scale.

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.