r/AskComputerScience • • 1d ago

When do operating system behaviors begin to affect backend architecture choices?

Lately I've been digging deeper into operating system internals, particularly how scheduling behaves under load, virtual memory (paging and fragmentation), and the cost of syscalls.

I'm after something practical rather than academic:

For engineers building high-concurrency or high-throughput backend systems, at what point does OS-level behavior start to genuinely shape architectural choices?

For instance:

Have you actually seen scheduler behavior materially impact latency-sensitive services?

How often do memory fragmentation or paging patterns turn up as real production bottlenecks?

In containerized setups, how much does kernel behavior still bleed into application performance?

I'm weighing how far to go into OS internals versus spending more time on distributed systems and networking. I care less about theoretical value and more about where OS knowledge has changed real production decisions.

0 Upvotes

5 comments sorted by

2

u/bobsmissingdesire 1d ago

Of course it all matters, we wouldn't bother optimising them at all otherwise.

The less obvious distinction is scale.

If you have one server you don't care. The cost of making the server a bit bigger or using a bit more ram is less than the expense of thinking about it.

If you are running a million servers and you can reduce the power bill by just 1 cent per month then that could cover the annual salary of a junior engineer for an entire year.

2

u/Either_Letterhead_77 1d ago

100%. I know people who work at hyperscalers and they are very interested in speeding stuff up at every level. To quote them, "Reducing the active runtime across the entire fleet by even 0.1% is a big deal"

2

u/garagedragon 1d ago

FWIW, it's worth keeping in mind that if you're looking at modern Linux, you're already looking at behaviours that have been optimised to death to minimise their detrimental impact, and maximise flexibility on backend architecture.

If you rewind even a few years, the difference is much more stark. Memory fragmentation in particular could be absolutely killer on 32-bit machines, because even if you had the physical RAM available, there could be no large enough contiguous gap for it. That's essentially a non-problem on a 64-bit system - the application-layer memory manager can just grab 1TB of memory upfront to use later and it'll always succeed, and then you effectively never have to context-switch back to the OS for any memory operations over the whole program lifetime.

Even with less critical features, it used to be a question about whether it was even worth using containers at all vs just using cgroups, or whether it was worth the additional overhead of the kernel supporting async IO. You can imagine that your backend application architecture would be massively impacted if these capabilities either didn't exist at all or did not have performance equal or better than doing things the "conventional" way.

2

u/dashingThroughSnow12 1d ago edited 1d ago

The more you know, the more often it effects architecture choices. Let alone programming choices in general.

Edit: Monday was the last time that memory fragmentation led me to change a load bearing part of the product I work on that has a few tens of millions of active users.

1

u/hopefulpippa94 1d ago

once you're past a few thousand concurrent connections, syscall overhead and scheduler wakeups start showing up in your p99, tbh. that's when pinning threads or switching to io_uring actually pays off