Live data from Hacker News

Costs of running a Python webapp for 55k monthly users

keepthescore.co

91–100 of 264 posts

Re: Costs of running a Python webapp for 55k monthly users

#91
post #89
post #85

Earlier quoted context omitted.

If you support 4 million monthly visitors on a media site, and have multiple EC2 instances running, I'd love to see a cost breakdown structure, because in my (obviously incomplete and possibly naive) calculations, the bandwidth alone would cost more than $200/mo.

CloudFlare covers the media bandwidth costs for a mere $20 / month. The uploading and media conversion is the difficult and costly (in terms of CPU) portion.

Also to be clear I'm talking about image uploads, not video. Still more complicated than this app.

Re: Costs of running a Python webapp for 55k monthly users

#92

I'm not familiar with Python as a web stack but to me it looks that the DO instances are a bit over-scaled for 55k monthly users. But what caught my eye was DNS Hosting: 5$/Month? Maybe it's a typo, shouldn't be more like 10$ per year to host a domain and its DNS? Anyway, thanks for sharing, very interesting.

I charge £1/zone/month for DNS-hosting, and while most of my clients only have a single zone there are people with 50+

DNS hosting can be cheap (free if you use cloudflare, etc), or very expensive. My prices give me a 50% margin over the raw AWS Route53 costs, but the appeal is that I store records under revision control and let you make changes using git:

https://dns-api.com/

Re: Costs of running a Python webapp for 55k monthly users

#93
post #36

$30 dedicated from Hetzner can do this reliably enough for a non revenue generating blog, including blue green deploys, postgres, certs, cache, edge caches (Cloudflare I guess) and even Metabase (which admittedly can be a memory hog if you don't set it in the JVM).

I put some VMs in Hetzner for a project I was working on, and found out you get what you pay for.

They mistakenly deleted all of my virtual machines and all of my backups.

If you host anything with them, or anyone I guess for that matter, make sure you have your backups hosted somewhere else.

Re: Costs of running a Python webapp for 55k monthly users

#94
post #12

It always makes my head dizzle when I read and hear how much people manage to bloat their stack because they think they need to "scale". I have web applications running that reliably serve 50k users per day and cost me $10/month, running on a single, cheap VPS.

It always amazes me how people are so free to judge other's situations. It's great that your web app only costs $10/month but others may have web apps that are more computationally intensive e.g. video processing or ML inference etc or simply can't join everything they need at runtime. And it's great that you're willing to deny those 50k users a day access to your service when that cheap VPS inevitably falls over. Bu…

I have a web app that's struggling if there are more than 2 concurrent users per CPU core. It's displaying incompressible large resolution images with EDIT: not sure why I'm downvoted, I'm just presenting my use case. They are multigigabyte images encoded with custom wavelet compression that are cut into tiles (think google earth), each user needs 5-10 tiles every second

Re: Costs of running a Python webapp for 55k monthly users

#95

Earlier quoted context omitted.

Don't do blue-green deploys when you have no revenue. Downtime costs you nothing and at 3,400 visitors a day you'll be lucky to drop a single request while deploying. Pre-compute and cache to reduce your need for beefy servers. When you can run something on your machine or in the cloud, choose your machine. EDIT: It's less about saving money and more about not spending it. EDIT2: Forgot to mention: use SQLite.

SQLite Really is a bit of a hidden gem.

Not really hidden when it is one of the most widely deployed pieces of software on the planet.

Re: Costs of running a Python webapp for 55k monthly users

#96
post #18

It's tough to generalize from things like this because "a webapp for 55k monthly users" can mean drastically different things. A user could be loading a few static pages, or that same user could be opening websocket connections or making requests that require expensive database queries. Your average user could stick around a minute, or an hour. Different apps can easily have per-monthly-user infrastructure costs that…

8$, just for infrastructure? So their costs per user is even higher?

-> Facebook is making far more than 10$ per user? Jesus Christ.

Re: Costs of running a Python webapp for 55k monthly users

#97
post #12

It always makes my head dizzle when I read and hear how much people manage to bloat their stack because they think they need to "scale". I have web applications running that reliably serve 50k users per day and cost me $10/month, running on a single, cheap VPS.

4+k daily visitors on one of the biggest fan sites for a popular mobile game, and I'm still running it with sqlite as DB backend and no caching on a shared VPS.

Re: Costs of running a Python webapp for 55k monthly users

#98
post #50

Earlier quoted context omitted.

I beg to differ. In my experience, the complicated setups that are justified by the argument of "reliability" have more downtime then a single VPS. The reason is probably that there are more moving parts and more has to be maintained / can go wrong. These days, a single VPS in the right datacenter has excellent uptime.

Agreed. I'll probably be downvoted, but these setups strike me as people who prefer to drink the cool aid than be pragmatic and only use what they need. I've also had very high reliability rates with a single VPS. They've actually given me less downtime than AWS services at times.

At work, I aim for four nines. (We put three nines in the legal paperwork).

I can't hit four nines reliably with single VPS platforms on my typical workloads, I need load balancers and redundant app servers. I could quite likely hit three nines using single VPSes. But if a client wants 99.9% SLAs, they'll be paying for HA and I'll deploy redundant ec2 instances, multi region RDS, and an ELB. And charge them 3 or 4 times what the OP is spending for it. (And I'll almost always deliver 99.99% availability.)

For my stuff or friends or people I'm doing cost saving favours for, I'll explain how much extra it costs to guarantee less then an hour of downtime a month, the realistic expectations and historical experience of how much downtime an non-HA platform might have in their use case, and often choose along with them a single VPS (or even dirt cheap cpanel hosting) while understanding and accepting the risks associated with saving upwards of a couple of hundred bucks per month.

Re: Costs of running a Python webapp for 55k monthly users

#99
post #53
post #12

It always makes my head dizzle when I read and hear how much people manage to bloat their stack because they think they need to "scale". I have web applications running that reliably serve 50k users per day and cost me $10/month, running on a single, cheap VPS.

I get what you're saying, but I think you're being a bit harsh. In my mind, choosing a dual redundant prod platform so you can do blue/green deployments is _totally_ unnecessary for a 55k MAU site generating no revenue. Same with cloud hosted metabase. You could run that on your own hardware - a spare laptop or probably even a raspberry pi for effectively nothing. On the other hand, a hobby project/side gig where you…

Given that he's complaining about the price I don't think the wasteful costs here are justified. I'll also note the article was just edited and the costs are now up to $171 / month.

This app could easily be run on the AWS free tier, although even in the paid tier he could probably be managing a lot more than this workload for under $40 / month. (That's for two servers - which as has been pointed-out is wholly unnecessary for an app of this size.) The price he's paying is presently listed at $95.

Re: Costs of running a Python webapp for 55k monthly users

#100
post #18

It's tough to generalize from things like this because "a webapp for 55k monthly users" can mean drastically different things. A user could be loading a few static pages, or that same user could be opening websocket connections or making requests that require expensive database queries. Your average user could stick around a minute, or an hour. Different apps can easily have per-monthly-user infrastructure costs that…

8$, just for infrastructure? So their costs per user is even higher? -> Facebook is making far more than 10$ per user? Jesus Christ.

Facebook average revenue per user in 2019 was USD 29.25

Source: https://www.statista.com/statistics/234056/facebooks-average...

Post reply on HN