News for hackers. Stuff that matters.
Re:Costs of running a Python webapp for 55k monthly users by aahortwwy on Friday September 04, 2020 @02:40AM (#24372316)
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.

Re:Costs of running a Python webapp for 55k monthly users by stevekemp on Friday September 04, 2020 @03:16AM (#24372531)
Caching is, in general, a good thing. But it's worth thinking about how you do it. I recently sped up a large system by dropping the use of redis entirely - because it was being badly used.

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 by aembleton on Friday September 04, 2020 @04:54AM (#24373093)
Couldn't you have cached locally using something like ehcache?
Re:Costs of running a Python webapp for 55k monthly users by stevekemp on Friday September 04, 2020 @08:08AM (#24374200)
Perhaps, yes. It was the latency of the network calls that was killing performance, so something local, or even redis on localhost, would have been better.
Re:Costs of running a Python webapp for 55k monthly users by limteary on Friday September 04, 2020 @04:00AM (#24372770)
Why use SQLite?

My postgres process doesn't come close to using up enough resources to push me out of even the cheap VPS tiers and I don't have to worry about locking if there's a heavy write load.

Re:Costs of running a Python webapp for 55k monthly users by theshrike79 on Friday September 04, 2020 @05:25AM (#24373266)
Backing up an SQLite database is as simple as copying a single file. As long as nothing is writing in the file, you're good.
Re:Costs of running a Python webapp for 55k monthly users by mattmanser on Friday September 04, 2020 @05:46AM (#24373397)
That's not a reason.

Plus setting up a nightly back up of any SQL database, regardless of creed, is like a 10 line cron job.

Re:Costs of running a Python webapp for 55k monthly users by ClumsyPilot on Friday September 04, 2020 @07:57AM (#24374131)
Some developers have never written a cron job.

I think the point here is, SQLite setup would provide satisfactory results at this scale.

If the choice is betweeen a PAAS database offering and SQLite, you can pick SQLite. If you have skills / are prepared for managing dbserver yourself, then do that.

Re:Costs of running a Python webapp for 55k monthly users by aahortwwy on Friday September 04, 2020 @05:47AM (#24373406)
Yeah, fair point. From a cost standpoint it's more about using the same server for your application and your database.
Re:Costs of running a Python webapp for 55k monthly users by chillfox on Friday September 04, 2020 @03:01AM (#24372451)
SQLite Really is a bit of a hidden gem.
Re:Costs of running a Python webapp for 55k monthly users by rapsey on Friday September 04, 2020 @03:29AM (#24372609)
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 by bigiain on Friday September 04, 2020 @03:40AM (#24372655)
Sure, but as an underlying dependency for iOS/Android, it's pretty well hidden from casual users...
Re:Costs of running a Python webapp for 55k monthly users by krtkush on Friday September 04, 2020 @04:11AM (#24372825)
That's true for even a casual website user. They have no idea or care about the underlying database.

Every app developer is aware about SQLite.

Re:Costs of running a Python webapp for 55k monthly users by chillfox on Friday September 04, 2020 @03:40AM (#24372661)
I guess not in absolute terms, but it’s mostly overlooked for web apps.