#General Question - Are threads and workers supported in the Procfile?

47 messages · Page 1 of 1 (latest)

flat pike
#

If I were to use the following Procfile, would it work as intended?

web: gunicorn --bind :8000 --workers 4 --threads 15 mysite.wsgi:application
worker: python manage.py someclusterservice
pallid oysterBOT
#

Project ID: N/A

flat pike
#

N/A

wet sinew
#

Yes

#

Those are gunicorn things

#

We just run them

#

Though we'll only run one of them

flat pike
#

wdym exactly? you'll run both the web and the worker service, right?

wet sinew
#

no

#

Just one

#

You'll have to create another service for the other

flat pike
#

I see. But what if I want to run the worker service on the same deployed web service? I won't be having two procfiles in the same repo.

wet sinew
#

You need to split out the service into two services

flat pike
#

here's an example: I want to run a celery queue for a django application, how do I do that given I have only one procfile at the root.

wet sinew
flat pike
#

so essentially, i just create two services stemming from the same repo and define the worker or web command over here?

vagrant basin
#

yes

flat pike
#

alright gotcha, thanks a lot

#

do you have any plans to support running multiple services from a single deployment or is that against the pattern (i.e. every deployment is an independent service) you have at railway?

flat pike
#

also, railway seems to detecting a dockerfile which is cool but what if I don't want to use the dockerfile? the option would be to use a procfile, right? but since you seemed to suggest that I'd have to delete the Procfile to run multiple services from the same repo, what are my options?

wet sinew
#

If you wanna upvote you can do that there

flat pike
#

aight will do

flat pike
#

okay so i'm trying the two-service approach (one a background qcluster for a django app and the other a gunicon web service).

#

not the most cohesive way to run services imo but I'm glad it works!

wet sinew
#

What do you suggest? They need to be split out

#

They’ll need to scale independently

flat pike
#

true but coming from aws ecb, I recall they had logging for pretty much everything with the ability to run services from the procfile like I mentioned earlier.

#

or at least, there could be a way to "connect" services to existing services, perhaps? cause rn, I'm duplicating all my env variables for the other service to run (since it runs from the same app essentially just as a different service now).

wet sinew
flat pike
#

I'm unaware of that.

wet sinew
#

Interesting

#

CC @crystal sandal

#

So, if you add two of the same across services it doesn’t tell you that?

#

It should prompt you to convert it to a Project Variable

#

(Which you can access in project settings)

flat pike
#

I went straight to the raw editor and this is what I got with an empty file when creating a new service.

wet sinew
#

Interesting. Might not show it in the raw editor?

#

But ya, you can go to the canvas

#

And hit Settings

flat pike
#

I think that's it because that's the only thing i clicked on while adding variables.

#

lemme try the other way.

#

hmm it still doesn't prompt me. anyway, I'll look into project variables.