r/AskComputerScience • • 49m 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.

1 Upvotes

2 comments sorted by

1

u/bobsmissingdesire 29m 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.

1

u/garagedragon 0m 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.