R
Railwayβ€’14mo ago
CallMeFred

Billing Questions

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?
28 Replies
Percy
Percyβ€’14mo ago
Project ID: N/A
CallMeFred
CallMeFredβ€’14mo ago
N/A
Brody
Brodyβ€’14mo ago
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.
CallMeFred
CallMeFredβ€’14mo ago
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?
Brody
Brodyβ€’14mo ago
well yeah, generally more services means more resource usage
CallMeFred
CallMeFredβ€’14mo ago
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?
Brody
Brodyβ€’14mo ago
correct, you are talking about a microservice vs monolith architecture
CallMeFred
CallMeFredβ€’14mo ago
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.
Brody
Brodyβ€’14mo ago
for sure, though there is always pros and cons to both sides with costs only being a single factor among many other factors
CallMeFred
CallMeFredβ€’14mo ago
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.
Brody
Brodyβ€’14mo ago
well im gonna need some more information to give you an accurate answer.. why did it crash?
CallMeFred
CallMeFredβ€’14mo ago
[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
Brody
Brodyβ€’14mo ago
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
CallMeFred
CallMeFredβ€’14mo ago
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 πŸ™‚
Brody
Brodyβ€’14mo ago
still the same WORKER TIMEOUT error?
CallMeFred
CallMeFredβ€’14mo ago
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
Brody
Brodyβ€’14mo ago
that doesnt look like the same worker timeout error
CallMeFred
CallMeFredβ€’14mo ago
Well that's what I got from the logs. Above my pay grade to understand what it meant πŸ™‚
CallMeFred
CallMeFredβ€’14mo ago
I deleted the app in the meantime, I would have to retest...
Brody
Brodyβ€’14mo ago
alright no worries, if you ever wanna pick debugging this back up ill be around!
CallMeFred
CallMeFredβ€’14mo ago
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
Brody
Brodyβ€’14mo ago
that is a good suggestion for sure, since by default gunicorn uses sync workers
CallMeFred
CallMeFredβ€’14mo ago
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.
Brody
Brodyβ€’14mo ago
also a very good suggestion!
CallMeFred
CallMeFredβ€’14mo ago
When he's not hallucinating, he's pretty good. He was my guide for https://www.aijinglemaker.com/ πŸ˜‰ Nice collaboration.
AI JINGLEMAKER - Easy affordable audio jingle creation.
The easiest way to create audio jingles (DJ Drops, Station IDs, podcast intros and much more)
CallMeFred
CallMeFredβ€’14mo ago
But now I need to find a way to add this audiogram feature to the mix. I'll re-explore some options.
Brody
Brodyβ€’14mo ago
oh yeah i saw that in #🎭|show-off-your-stuff nice work!
Want results from more Discord servers?
Add your server