Live data from Hacker News

Costs of running a Python webapp for 55k monthly users

keepthescore.co

221–230 of 264 posts

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

#221
post #82

Earlier quoted context omitted.

While this article has steps in the right direction, it's a lot of "use this thing". I operate a simple Flask/PostgreSQL webapp for CS Education through the luxury of my university. If/When I graduate from my program, what are the aspects I can do to minimize my costs for hosting the app? Of course I'll look for best approaches but why does that need to be forbidden knowledge known to a select few? Its an aside, but…

>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. That's basically all of software development for your entire career. Never not had a day or a week not like that.

That is true and I recognize the purpose of being a proficient Googler; however my concerns stem out of the idea that learning many of those skills are not taught at all or expected to be learned in situ through programming assignments.

Here are examples of what I mean:

- An undergraduate Networking/Security course may not provide practice on appropriately salting passwords. It is merely discussed as part of some larger conceptual model. Students are browbeaten in earlier courses to not simply copy/paste code they find on the internet

- Debugging practice has to come from the student's own generated code, but if they made a mistake, they already are showing they do not fully grasp the material. There have been efforts to explicitly train debugging [1] but they are still in early stages of researching their benefits.

[1] The Code Mangler - https://dl.acm.org/doi/pdf/10.1145/3017680.3017704

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

#223

Earlier quoted context omitted.

You mean like how repairing roads should be a no brainer, but no-one wants to pay for it?

Even here in Russia, which is famous for its awful roads, there's plenty of private roads, both closed to public, and operated for-profit with toll booths that are in great condition. Tragedy of the commons doesn't happen when things actually belong to someone.

If I had a penny for every time people write blanket statements of this nature, id be a wealthy man.

The list of privatised institutions that perform worse than their publically owned equivalents nations is very long.

Passenger rail in US and UK is privately owned and terrible compared to French and Spanish. US broadband is quite poor. US healthcare is much worse value. Private prisons - I dont even know what they were thinking.

One must carefully access if market-based solution for a given problem is suitable, or if the potential for abuse and natural monopoly just too great.

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

#224
post #211

Earlier quoted context omitted.

If $171 month is discouraging, let me reassure them. There’s statistically a 95-99%+ chance you’ll never get to 55k monthly users with your app so don’t worry!

Let's leave this kind of snark out of this community. It's comments like this that slippery slope a community from helpful to harmful. You see it each time a reddit community gets too large.

I don't think its snark. Its, don't worry about optimization to soon.

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

#225

Earlier quoted context omitted.

Even here in Russia, which is famous for its awful roads, there's plenty of private roads, both closed to public, and operated for-profit with toll booths that are in great condition. Tragedy of the commons doesn't happen when things actually belong to someone.

If I had a penny for every time people write blanket statements of this nature, id be a wealthy man. The list of privatised institutions that perform worse than their publically owned equivalents nations is very long. Passenger rail in US and UK is privately owned and terrible compared to French and Spanish. US broadband is quite poor. US healthcare is much worse value. Private prisons - I dont even know what they we…

Amtrak is owned by the US government.

US broadband is run by local monopolies established by government action.

US Healthcare is heavily regulated, and grew massively expensive only after regulations were added, and preconditions were excluded.

All US prisons have problems.

You have any real examples?

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

#226
post #65

Earlier 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…

Both you and TekMoi should probably value your own time higher. The cost savings are great, but once you spend 4 hours on configuring a database server, that'll probably be $200+ worth of your time and, thus, wipe out most of the savings.

I value four hours of my time at considerably more than $200 and the reason I'm able to do that is because I know things like how to configure a database server.

But your argument is nonsensical because a one-time investment of time (much less than four hours for me, but I've been doing this for 20 years) can save you several hundred dollars a month. AWS AuroraDB, for instance, (which I also know how to configure, by the way) has much higher latency than a hand-rolled instance and will cause bottlenecks throughout your code in a DB-driven application. If I hadn't experienced the difference firsthand, or had failed to profile my app's performance adequately, I might assume I need to solve the problem by spinning up more ec2 instances to distribute the load. I've had the misfortune of working with a company that had exactly that problem and knowing how to spin up a new DB server saved the company thousands of dollars a month and took considerably less than four hours. Transferring a 3TB database to a new server without downtime did take considerably longer, however, but I was being paid hourly anyway, and it was still a worthwhile investment for the company which saved considerably more than my fee.

Any tradesperson should know their tools. A programmer is no different and if you don't know how to use your tools because your "value your own time higher" then thank you: you're the guy who ends up getting me called in to fix things at a much higher hourly fee.

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

#227
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.

Depends on the type of web app. https://anim8.io - a site for hobby animators could never run on a $10VPS. The bandwidth usage is just way too high and video compression requires GPU compute.

The videos on that site aren't hosted inhouse or first-party. Definitely doable.

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

#228
post #65

Earlier 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…

What are the right resources, you would suggest someone if he had to setup his servers properly. Will really appreciate if you can refer some books/videos/articles. Thanks.

If you're talking about serving many requests cost-effectively, then really the problem is not the servers (except over-provisioning, which is rampant. Learn to use tools like AWS' auto-scaling system instead) - it's the code.

If you understand the basics of algorithmic time complexity (that's your Big-O notation) and profiling your code then you're ahead of 98% of other developers in practice. I'm constantly amazed at how many developers think adding more libraries, newer frameworks, or more layers of tooling will magically speed up their code because "it's so fast". If you actually time things you'll find out doing it the "slow" way is frequently an order of magnitude faster.

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

#229
post #204

Earlier quoted context omitted.

I'm such a klutz - sorry. This is what I get for reading HN when I'm still in bed and without putting my glasses on first. This is a terrible habit that I need to break.

Username now in question

Tough to argue against that under the circumstances.

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

#230

Earlier quoted context omitted.

Absolutely. Profligacy is often the rational course in a capitalist system.

In any system, there will be a tension between shrinking cost/benefit, and spending more to achieve better benefit-cost. This has nothing to do with capitalism. It's a fundamental aspect of systems where there is a non-fixed relationship between investment and return (i.e. almost all systems of any kind).

The notion that "[financial] investment and [financial] return" are the only two factors worth considering in "all systems of any kind" is an artefact of capitalist thinking.
Post reply on HN