Is Your Web Service Really I/O Bound? | Ankush Menat

submited by
Style Pass
2024-11-22 17:00:06

I read that most web services that talk to DB are I/O Bound. I am working on a web service that talks to DB. Therefore, I have an I/O bound service. Since I have I/O bound service, I should rewrite it in event-driven architecture to improve CPU utilization.

Web services are often cited as example of typical I/O bound service and this is typically correct, but this may not be true for your specific service. It is essential to properly study your service and workload it services in production, failing to do so can result in engineering efforts that yield sub-optimal results.

"Systems Performance" by Brendan Gregg calls this method of studying workload "Workload Characterization".

You might have encountered this way of classifying processes from OS literature, where different processes have different scheduling needs. I/O bound processes use disk or networking to communicate with other processes like database or cache. This means they often yield CPU long before their timeslice expires, on the other hand, CPU Bound processes tend to use their entire timeslice.

Schedulers improve CPU utilization by running other processes while I/O bound processes are waiting for a response from disk or network. This same logic applies to the performance of individual processes too. If the I/O bound process frequently yields CPU then it can not saturate available CPU with useful work. Two popular approaches to improving CPU utilization are:

Leave a Comment