Introduction to Linux hardware I/O optimization and linuxio

Source: Internet
Author: User

Introduction to Linux hardware I/O optimization and linuxio
Introduction to Linux hardware I/O Optimization

First of all, let's briefly introduce the following hardware devices ):

1. CPU: the central processor is one of the core components of computer operation control, which is equivalent to human brain. For example

2. RAM: the memory stick communicates with the CPU. A lot of data and operations are temporarily processed in the memory, which is equivalent to the state of your quick memory operation, such:

  

3. disk, the hard disk space is larger than the memory size. As the saying goes in your notebook, it's better to have a good memory than a bad pen. As long as the notebook is not lost, the data will always be there, so you can see it at a glance! For example:

  

4. NIC, to help you quickly contact your friends. For example:

  

5. mainboard: The mainboard is the work environment required by the above equipment. It is like a team, each of which is responsible for playing its role to complete various complex operation records. Like the environment we live in, we need to think about how to handle all kinds of work (CPU), record the good memories of life (RAM ), use a camera to take the most beautiful moments (disk) and contact friends and family (NIC ). The figure is as follows:

  

Let's take a look at the figure after the above device is set up:

This figure reflects the relationship between the corresponding link annotation and its function in the processor space. The larger the space, the read/write speed is generally inversely proportional, similar to a large warehouse, it is certainly slow to find the goods you want. Compared with a small warehouse, it is easy to find goods in a few square meters. Let's continue to look at another figure:

The relationship between the read/write speed and time of each link is briefly listed here. The space here is the size and speed of the data to be processed, rather than the storage space. Remember not to confuse it. This figure simply and rudely shows that the powerful computing power of the CPU and the response speed of the computing speed are in the nanosecond level. The memory is closely followed by the CPU, but obviously there is much less data to be processed, just like the questions solved by xueba second, you still need to think about how many seconds to dozens of seconds to solve the problem.

Then how can we solve the problem? The intermediate handling relationship is also called optimization:

Common Solution 1 is as follows:

For example, when your website has a large amount of data written, you must ensure that the data read at the same time is fast enough to use all the data written into the memory to control a certain data size. One row is written as hard disk, we have already introduced the data processed by the CPU. The write and read operations in the memory are closely followed by the CPU, so as to ensure the effective speed during reading and writing, reduce the number of hard disk reads and writes (because it is known that the hard disk read and write efficiency is slow and only suitable for data storage ). Here is just a discussion of ideas, specific according to requirements.

Common solution 2:

This section describes how to read a webpage. For example, if a blog is only used for browsing, a few users can directly write data to the hard disk in comments, which is slow in hard disk reading and writing, CPU writing speed can provide more time and resource processing efficiency for user reading. Of course, all we are talking about now is a theoretical discussion. There are many different factors, such as the actual application and complex environment, the usage methods are certainly different. It is only used to give an example of which starting point should we find in practical applications, and provide better optimization and design. Finally, I would like to thank you very much for watching this article. You are also welcome to come up with good ideas and comments to explore and learn!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.