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…
Costs of running a Python webapp for 55k monthly users
81–90 of 264 posts
Re: Costs of running a Python webapp for 55k monthly users
#82Earlier quoted context omitted.
Not to sound mean, but if there aren't posts/blogs/whatever explicitly telling people how to minimize costs... then they'll continue to follow the ones that make them pay $100+.
Ok, here is a quick tutorial: Step 1: Copy Peter Levels stack: https://www.nocsdegree.com/pieter-levels-learn-coding/ If he serves hundreds of thousands of monthly users and makes a million a month with a single VPS, you certainly won't have scaling issues when you start out or just have tens of thousands of users. Step 2: If you really scale beyond that, resist the urge to bloat your stack. Think long and hard about…
Its an aside, but the mentality of "let them figure it out" is a major issue in education. Foundational knowledge should be easy to acquire so I can worry about higher level thinking issues. Literally spending hours trying to figure out how to set things up through hours of Googling doesn't really help that, nor does it promote the "figuring it out" people think it does - its just stumbling upon the right set of commands that let me move past this particular hurdle.
From the devops perspective, what about telling someone how to set up their own server to do/minimize X is so taxing?
Re: Costs of running a Python webapp for 55k monthly users
#83Earlier 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.
> 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. Again, maybe in your experience but that's not universal. There's literally no redundancy wit…
What does excellent uptime
mean in your book?
Something like less then an hour of downtime per year.Over the last years, across multiple datacenters, I have seen maybe one or two short downtimes per year. None ever lasting more then 5 minutes.
Re: Costs of running a Python webapp for 55k monthly users
#84Earlier quoted context omitted.
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…
TekMoi is right. I have an Alexa top 6k site which is vastly more complicated (media hosting, load balancing, multiple VMs, DDOS protection, transactional emails, automated backups) which costs $200 / month on AWS. The fact that this person is spending nearly as much to support 50k users a day as I do to support more than 4 million cannot be hand-waived away by "people are so free to judge other's[sic] situations". T…
Re: Costs of running a Python webapp for 55k monthly users
#85Earlier quoted context omitted.
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…
TekMoi is right. I have an Alexa top 6k site which is vastly more complicated (media hosting, load balancing, multiple VMs, DDOS protection, transactional emails, automated backups) which costs $200 / month on AWS. The fact that this person is spending nearly as much to support 50k users a day as I do to support more than 4 million cannot be hand-waived away by "people are so free to judge other's[sic] situations". T…
Re: Costs of running a Python webapp for 55k monthly users
#86It 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.
Re: Costs of running a Python webapp for 55k monthly users
#87Earlier quoted context omitted.
Not to sound mean, but if there aren't posts/blogs/whatever explicitly telling people how to minimize costs... then they'll continue to follow the ones that make them pay $100+.
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.
During a single request there might be 50+ cache-lookups, each taking a round-trip to a remote redis server to fetch a single key at a time. Batching those up to a set/hash would have been more efficient, but the codebase had evolved in such a way as to make that difficult.
Instead of making 50+ redis fetches it turned out that just fetching all the stuff from the database was faster.
(There will be refactoring to batch up the key fetches, but for the moment there was a measurable increase in performance under current loads just by removing redis.)
Re: Costs of running a Python webapp for 55k monthly users
#88Earlier quoted context omitted.
The article does not mention video processing or ML. It describes their setup for what they describe as a generic web app.
If you want to provide uninterrupted service to your clients you’ll have to spend some $. You want to have redundancy, machines hosted in different different locations, backup prod servers, monitoring, analysis tools. Even if it is for 1k monthly users, if you want reliability - it will increase the costs.
On a site currently generating zero revenue, I hope the OP is happily enough paying most of that $145/month as a learning experience or for resume bullet points (which are perfectly valid was to spend your money). They've admitted elsewhere in the comments that the two $40/month droplets are way oversized (from an attempt to solve a problem that turned out not to be droplet size/resource related) - so without redundancy and without AWS hosted metabase, this would be about $100/month less expensive to run.
I still think that's over provisioned or under engineered. Like others have commented, I'd be surprised if the features you can see on the site require any more than the $15/month the FAQ claims it costs to run, plus perhaps the $10/month Discus expenses. That seems about where a hobby/side-gig project should sit for a lot of devs before you start thinking about how to make it pay for itself... YMMV, especially if you're not comfortable earning at least junior dev salary already in some reasonably well paying part of the world.
Re: Costs of running a Python webapp for 55k monthly users
#89Earlier quoted context omitted.
TekMoi is right. I have an Alexa top 6k site which is vastly more complicated (media hosting, load balancing, multiple VMs, DDOS protection, transactional emails, automated backups) which costs $200 / month on AWS. The fact that this person is spending nearly as much to support 50k users a day as I do to support more than 4 million cannot be hand-waived away by "people are so free to judge other's[sic] situations". T…
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.
Re: Costs of running a Python webapp for 55k monthly users
#90That said, are you making the right tradeoffs? Most of your spend is going to 'luxury'. Dual overcapacitated deployments, hosted managed Postgress, hosted Metabase.
It does sound like you could very significantly reduce your spend almost instantly with just a few minor changes, and dramatically if you would do a rethink of your stack.