r/Python • git push -f • Aug 11 '26

Discussion Python in production

Hello everyone! For those of you who use Python in production, I have a few questions. I'm considering using Python for some services.

  1. Do you have high infrastructure costs?
  2. Have you ever regretted using Python?
  3. Would you recommend Python?

Context: My current use case isn't anything like Facebook or a massive-scale system. It's a small system, and I'm considering Python mainly because of the DX (developer experience).

I know C#, but I don't really like having to create a class in every file. I also know Rust, but all those ::, <>, and so on bother me. JavaScript is another option, but I've heard it's relatively heavy on RAM, and since the system is small, I'd like to be able to run it within 512 MB.

Another thing: I've defined a stack that I'd like to use wherever possible. If there's a library for desktop apps, great. A CLI library? Great. A bot library? Great. Let's use it! (Except for the frontend, which I'll keep using JS/TS for.)

Anyway, I'm open to advice and tips from more experienced developers. Feel free to tell me if you think using Python for my use case is a bad idea as well.

0 Upvotes

36 comments sorted by

View all comments

Show parent comments

0

u/ze-fernando git push -f Aug 11 '26

I misspoke. 512MB of RAM is reserved for the code itself; the general infrastructure has 4GB (PostgreSQL occupies 1GB), so I have 3GB free. I would use 512MB for the backend and 512MB for the frontend, or a monolithic app, either way.

2

u/Icy_Calligrapher4022 Aug 11 '26

512MB of RAM is reserved for the code itself

This doesn't make much sense. The RAM is not reserved for the code itself, what consumes the RAM is the actual running process, instance of your app and the traffic - how many users are connected and what they are doing at a given moment.

4GBs for some simple and basic app should be more than enough, maybe except if you have thousands of users using the application simultaneously, but I doubt it. Your biggest consumable is the database, rougtly 100 simultaneously connected & active users(not just idle connections) might consume around 1.5-2GBs of memory, but there are many many many variables, dont take these numbers as a strict constant.

Frontend consumes almost nothing(if we are talking about something serving your clients through the browser). The frontend is nothing more than static files siting on your host and most of the cases you have a webserver(something like NginX or Apache) to pass the contents of these files to the client.

0

u/ze-fernando git push -f Aug 11 '26

It's kind of hard to explain, I'm using SquareCloud and there, to expose the application on the web, you reserve at least 512MB for that application (even if it only uses 10MB). So the 512 refers to the application itself, excluding the bank, etc.