Beware of the rise of I/O on an e-commerce architecture

By

Maintaining good performance on your e-commerce shop requires paying attention to all details. On the server side, one piece of data should be monitored carefully: the usage rate of the “Disk I/O”. The term increase of “Disk I/O” refers to the phenomenon that occurs on your server if it is not able to read or write quick enough on hard drives (or on a network drive if you have a NFS server). So do you avoid this phenomenon?

Monitor your I/O rate to avoid slowdowns

If you have launched heavy queries on the database (an import in the back-office? a flow? or a backup at the wrong time?), the drives become more requested and Magento faces many difficulties to run. An action is taken at the wrong moment, and the iowait rate increases…

io-one

Without proper monitoring or corrective action, we have witnessed iowait rates (system wait times for writing or reading data) increase, sometimes up to 40%! This means that 40% of the CPU activity has to wait for the execution of a reading or writing operation on a drive. It is a monumental waste of server resources which greatly slow down Magento’s operation.

In an ideal world you should always try to keep a CPU graph that looks like this (see below the image of a healthy CPU graph):

io-two

In this example, with a limited iowait, a CPU occupation rate spent mainly in the blue area (the “user time”), the site works perfectly, queries are executed quickly… and visitors can enjoy your services in good conditions (of course, as long as the CPU usage does not come close to 100%! If this occurs, you will have to optimize Magento or add additional servers to your architecture).

What should be avoided at all costs is an increase in the iowait. When you have a peak in the iowait, serious consequences become visible on the load times of the site. For example, we see the site’s response time blow up with the increase of the iowait rate:

io-three

Pages take much longer to be generated by Magento, the experience of visitors is altered, and the conversion as well! In this event, Magento will do everything to try to deliver the page, but it does not have enough material resources available. Therefore, each process will take much longer to be delivered, and the site will become slower.