-1

I have been studying about OS and currently, I am on "types of the kernel". Now in the book and some websites are saying Monolithic kernel-based OS is faster, but how are they faster than Microkernel-based OS.

4
  • What book, and what websites? I would assume that if they state that one type is slower they would also give possible reasons.CommentedOct 13, 2020 at 12:12
  • In particular, if you had had a look at this website, you would have found this discussion: cs.stackexchange.com/q/29854CommentedOct 13, 2020 at 12:16
  • VTC. Addressed on CS.SE: cs.stackexchange.com/questions/29854/…
    – svidgen
    CommentedOct 13, 2020 at 16:16
  • @Hans-MartinMosner indeed, it's not too hard to find, if you know what to google for: it's related to the overhead of the switch from user to kernel mode when passing from kernel to user-space drivers and conversely.CommentedOct 14, 2020 at 7:48

2 Answers 2

2

It depends on who you ask.

Proponents of microkernels say: "in microkernels, everything is separated and segregated into small components, whereas in monolithic kernels, everything is tightly coupled together, therefore microkernels are faster because you can optimize each part individually without fear of breaking anything else, whereas in a monolithic kernel you cannot really touch anything because it could have ripple effects through the entire system".

Proponents of monolithic kernels say: "in microkernels, everything is separated and segregated into small components, whereas in monolithic kernels, everything is tightly coupled together, therefore monolithic kernels are faster because you don't have all that communication overhead between the separate components".

There are not really any statistically sound benchmarks comparing the two, so we simply don't know.

Also, there aren't really any microkernels and monolithic kernels in the same niche, so we don't have real-world experience. Servers, workstations, and desktops are all monolithic (or maybe we can call NT and XNU "hybrid"), realtime devices are all microkernel or even nanokernel or exokernel. We see some library OSs in the cloud space.

And another question is: which microkernel? It is generally thought that communication overhead is the main limitation on microkernel performance. L4's IPC performance is easily 10x the one of Mach, so are you measuring Mach or are you measuring L4?

1
  • (Preface: I have no skin in this game, I don't care for one kernel design over another) Saying that "everything is tightly coupled together" in a monokernel isn't really true. "Everything" is running in kernel mode, and no modules are extracted to run in user space. That doesn't mean that all the code has to be a big ball of spaghetti mud. There could isolated modules, with well-designed interfaces. It just so happens that none of those interfaces jump back/forth between kernel/user space or across process boundaries.
    – Alexander
    CommentedOct 13, 2020 at 16:27
1

The performance issue with microkernel operating systems is related to the overhead of switching from user mode to privileged kernel mode, which is a slight overhead.

In a microkernel architecture, where only the core is in system-land and all the other system services are in user-land, you paradoxically add more user-to-kernel mode switches and hence the lower performance. This affects among other the device drivers and all the many I/O that must be performed on a running OS.

This is not an opinion question. There are hard facts behind that. As a reference, you can look at this introduction to microkernels and MINIX where in the middle of the document, you'll see that new techniques allowed to reduce the performance penalty to "only 5 to 10%" (which according to the author was proven by at least four independent studies).

In software engineering, there is no best solution: it's always a question of balance. Microkernel compensate the performance issue with a higher reliability and security: it's exteremely difficult to corrupt and crash the kernel. So it might not be the best architecture for high I/O webservers, but it could be a very good match for autonomous and mission critical systems that need hardening and cannot afford to crash.

2
  • Actually a webserver is a good example of something you'd like to not crash. (An example of something that needs more speed and less reliability is a scientific simulation)CommentedOct 15, 2020 at 11:00
  • @user253751 indeed, but there are not so many microkernel based webservers out there. Probably because of horizontal scalability: If you have load balancing with 20 webservers and one crashes, the results will be very different from a plane with 20 subsystems and one crashes.CommentedOct 15, 2020 at 18:02

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.