#Billing Questions

33 messages · Page 1 of 1 (latest)

merry fulcrum
#

Hi, if I switch from Hobby to Pro plan,
can I open multiple projects under the $20 monthly fee?
How does a new project (and underlying apps) incur additional costs in terms of usage?
Or are they pooled in terms of usage?

sudden ivyBOT
#

Project ID: N/A

river cypressBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

merry fulcrum
#

N/A

tepid glade
#

the 20$ is per seat, aka per user, so if it's just you then you will only have to pay that 20$ fee once a month.
you can run multiple projects on the pro plan the same way you can on hobby.
usage costs are billed the exact same way and at the same rates as hobby although pro doesn't come with any included usage like hobby does.

merry fulcrum
#

But practically speaking if you have let's say 5 projects with a Flask app in each of them or 1 project with 5 Flask apps (which could be features interacting with each other, just separated for organization purposes), you'll pay more in usage than if you have one main app where all the features are integrated in a single codebase?

tepid glade
#

well yeah, generally more services means more resource usage

merry fulcrum
#

What I mean is that if you have a web app which offers multiple standalone features which could be pushed separately, it makes more sense from a $ point of view to bundle them as a single web app instead of publishing them as separate entities (even if there can be reasons to maintain them as separate entities), just because you've got some basic hourly cost just to run a new standalone web app, even if it's idle most of the time (not consuming resources). Correct?

tepid glade
#

correct, you are talking about a microservice vs monolith architecture

merry fulcrum
#

So we do agree. On Railway, a modest monolith architecture is less expensive to run than 5 (even quieter) microservices, because of the hourly costs charged per deployment.

#

Not a problem, I just wanted to be sure I understood the principles.

tepid glade
#

for sure, though there is always pros and cons to both sides with costs only being a single factor among many other factors

merry fulcrum
#

Last question: I had deployed a simple web app (Flask/JS) to create audiograms, which basically generates N PNG frames then concatenates them to create a MP4, in let's say 50 to 200 iterations, which takes roughly 2 minutes to complete. It crashed on the Hobby plan. Would the typical Pro Plan be enough to run such a basic app? Or would it also run out of capacity?

#

I tested it on Google Cloud Run and it basically stopped at roughly the same point.

tepid glade
#

well im gonna need some more information to give you an accurate answer.. why did it crash?

merry fulcrum
#

[2023-09-20 07:13:51 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:10)

[2023-09-20 07:13:51 +0000] [10] [INFO] Worker exiting (pid: 10)

[2023-09-20 07:13:52 +0000] [1] [ERROR] Worker (pid:10) exited with code 1

[2023-09-20 07:13:52 +0000] [1] [ERROR] Worker (pid:10) exited with code 1.

[2023-09-20 07:13:52 +0000] [115] [INFO] Booting worker with pid: 115

#

from the logs

tepid glade
#

your app is running with gunicorn, gunicorn has a default timeout set to 30 seconds, to increase this timeout to 3 minutes add the --timeout 180 flag to your gunicorn start command

merry fulcrum
#

I had followed the recommendation of my GPT silicon friend:
gunicorn -w 4 myapp:app --timeout 300

But it still crashed so I gave up 🙂

tepid glade
#

still the same WORKER TIMEOUT error?

merry fulcrum
#

yep,
Still an error:
Processing audio chunks: 64%|██████▍ | 37/58 [00:22<00:12, 1.68it/s]

[2023-09-20 07:20:30 +0000] [10] [INFO] Worker exiting (pid: 10)
[2023-09-20 07:20:30 +0000] [1] [ERROR] Worker (pid:10) exited with code 1
[2023-09-20 07:20:30 +0000] [1] [ERROR] Worker (pid:10) exited with code 1.
[2023-09-20 07:20:30 +0000] [115] [INFO] Booting worker with pid: 115

#

at 64% of the first for loop

tepid glade
#

that doesnt look like the same worker timeout error

merry fulcrum
#

Well that's what I got from the logs. Above my pay grade to understand what it meant 🙂

tepid glade
merry fulcrum
#

I deleted the app in the meantime, I would have to retest...

tepid glade
#

alright no worries, if you ever wanna pick debugging this back up ill be around!

merry fulcrum
#

There was another tip of the silicon friend. I don't know if it makes sense:
Async Workers: If the timeout is related to I/O-bound tasks (like waiting for files, databases, or network responses), consider using asynchronous Gunicorn workers. You can switch to Gevent or Uvicorn workers, which handle I/O operations more efficiently. For example, with Gevent:

Install Gevent: pip install gevent
Modify your Procfile:

web: gunicorn main:app -k gevent -w 4 --timeout 300

tepid glade
#

that is a good suggestion for sure, since by default gunicorn uses sync workers

merry fulcrum
#

There was also this one but it would take longer to explore:
Background Processing: If the audio processing task is inherently long, consider offloading it to a background job system like Celery or RQ. This way, the web request will queue the task for processing and immediately respond, and the processing will happen in the background, decoupled from the web request lifecycle.

tepid glade
#

also a very good suggestion!

merry fulcrum
#

But now I need to find a way to add this audiogram feature to the mix. I'll re-explore some options.