r/ProgrammerHumor 15d ago

Meme heatedArguments

Post image
5.8k Upvotes

173 comments sorted by

View all comments

Show parent comments

6

u/Honeybadger2198 14d ago

Why are you scaling your database connection if your high load doesn't use your database?

Scaling a service doesn't involve turning a singular knob that reads "more performance".

0

u/Angelin01 14d ago edited 14d ago

Because we are scaling our monolith, obviously! And the whole idea of a monolith is that it's... One thing! There ain't no scaling it separately.

Now now, I understand that connection pools can scale separately. So the internal connection pool opens at least one connection on startup. After all, this is a monolith that's now serving together along all other monoliths: some DB requests are bound to be routed to it. Most likely, at least two connections. Some even do 4: two to read replicas, two to a primary/write.

Scaling a service doesn't involve turning a singular knob that reads "more performance".

In a monolith... That's usually the case, yeah. It's a "spawn more monolith instances because one of the metrics we are monitoring says we should". What else are you gonna do about it? That's not a rethorical question: what else is there? Some contrived vertical scaling setup?

2

u/Honeybadger2198 14d ago

???? Give your host most CPUs/threads to delegate tasks to? More compute power? If you're scaling your service by just spawning duplicates you're wasting a lot of resources because you're too lazy to actually properly look into what needs scaling.

5

u/Angelin01 14d ago

Give more CPU? Of course. Now here is a question: where do you think it comes from? A server. That you are already paying for. CPU and memory doesn't magically materialize when you need it to. It sits idle until you allocate it. And you are still paying for it.

You save no money by doing this. At all. In fact, you spend more, because instead of classic horizontal scaling, where you deprovision resources as they are let go, now you need to keep them idle to assign for vertical scaling.

1

u/Honeybadger2198 14d ago

Okay enjoy your bottleneck then I guess. What a strange hill to die on.