I/O input/output is divided into two parts: IO device and IO interface.stayPOSIXOn compatible systems, such asLinuxsystem[1],I/O operationsThere are many ways, such as DIO (Direct I/O),AIO(Asynchronous I/O, asynchronous I/O), Memory Mapped I/O(Memory mapped I/O)Different I/O modes have different implementation modes and performance, and different I/O modes can be selected according to different applications.
Chinese name
I/O
Foreign name
IO
I/O input/output
It is divided into two parts: IO device and IO interface
The input/output I/O stream can be regarded as reading bytes or packaged bytes, that is, taking them out and putting them into two-way switching;Realize the transfer and isolation between the weak current line of the linkage control system and the strong current line of the controlled equipment to prevent the strong current from entering the system,support system Safety;
Plug in structure, which can be installed on the wall like a detector, and the switching module can be inserted into the base after wiring and before engineering commissioning.Easy to construct and maintain;
The passive dynamic closing contact or switching AC220V voltage is used as the response signal.
Confirmation light action light - red, answer light - green;During action, the action light and the answer light are always on.
terminal1 Connected to the start end of multi wire reel;Terminal 2 is connected to the stop end of multi wire reel;
Terminal 3 is connected to the answer terminal of the multi wire panel;Terminal 4 connectionPower supply groundG;
Terminals 5 and 6 are normally open contact outputs corresponding to the stop command;
Terminals 11 and 12 are connected with 220V answer signal;
Terminals 13 and 14 are normally open contact outputs corresponding to the start command;Terminals 14 and 15 are normally closed contact outputs corresponding to the start command;
Contact output is passive.
Terminal 16 is connected to 24V power supply positive pole;
Application (connected to dedicated control panel)
Note: AC220V or passive closing signal can be used as feedback signal.
JBF-151F/D has only one answer input, which is the answer to start 1.
JBF-151F/D can provide a group of normally open or normally closed contacts after starting, and only one pair of normally open points will be output when stopping command output.
Increase cache
Announce
edit
In the calculation of several indicators to measure performance, we can see that a 15k speed disk has random read and write accessIOPSIt is only about 140, but we can see many storage systems marked with 5000 IOPS or higher in practical applications. How can a storage system with such a large IOPS come from?It comes down to variousStorage technologyThe most widely used of these storage technologies isCache(Cache) andDisk redundant array(RAID), this article will discuss the methods of cache and disk array to improve storage IO performance.
Cache
Announce
edit
Among the current storage products, from fast to slow should beMemory>Flash Memory>Disk>Tape, however, the faster the speed is, the higher the price is. Although flash memory has a good development momentum, the speed of disk is undoubtedlycomputer systemThe biggest bottleneck in, so when disk must be used and want to improve performance, people came up with a compromise solution by embedding a high-speed memory in the disk to save frequently accessed data to improve the efficiency of reading and writing. This embedded memory is called cache.
Speaking of cache, from the operating system layer to the disk controller, andCPUInternally, there are caches inside a single disk. All these caches exist for the same purpose, that is, to improve the efficiency of system execution.
Of course, here we only mention the cache related to IO performance. The cache directly related to IO performance arefile systemFile SysTemp Cache, Disk Controller Cache, andDisk Cache(Disk Cache, also known as Disk Buffer)system performance Time fileSystem cacheIt will not be taken into account. We focus on disk controller cache and disk cache.
Whether it is controller cache or disk cache, their role is mainly divided into three parts: cache data, read ahead (Read-ahead)And Write back.
Cache data
First, the data read by the system will be cached in the cache, so that the next time you need to read the same data, you don't need to access the disk again, and you can directly fetch data from the cache.Of course, the used data cannot be permanently retained in the cache. The cached data is generallyLRUThe algorithm is used for management, so that it will not be used for a long timedata dumpOut of cache, those frequently accessed can be kept in the cache until the cache is cleared.
read-ahead
Read ahead refers to using the read ahead algorithm to read data from the disk into the cache in advance when there is no system IO request. Then when the system sends a read IO request, it will check whether there is data to be read in the cache. If there is data (that is, hit), it will directly return the results. At this time, the disk no longer needs addressing, rotating, waitingRead the data sequence, which can save a lot of time;If there is no hit, issue a real command to read the disk to get the required data.
Cachedhit rateIt has a lot to do with the size of the cache. Theoretically, the larger the cache, the more data it can cache, so the higher the hit rate is. Of course, the cache cannot be too large. After all, the cost is there.If a storage system with a large capacity is equipped with a small read cache, there will be a big problem at this time, because the amount of data in the small cache cache is very small, and the proportion is very low compared with the entire storage system, so random reading(database systemIn most cases, the hit rate is also naturally low. This kind of cache can not improve efficiency (because most read IO must read the disk), but it will waste time every time to match the cache.
The ratio between the number of read data in the cache and all data to be read is calledcache hit rate (Read Cache Hit Radio). If a storage system can achieve 150 IOPS for random small IO reads without using cache, and its cache can provide 10% cache hit ratio, then its IOPS can actually reach 150/(1-10%)=166.
Write back
First of all, the cache used for the write back function is called the Write Cache.In a set of storage with write cache open, a series of write IO commands issued by the operating system will not be executed one by one. These write IO commands will be written to the cache first, and then the changes in the cache will be pushed to the disk at one time. This is equivalent to combining the same multiple IOs into one, and combining multiple small IOs for continuous operation into a large IO,The other is to change multiple random write IOs into a group of continuous write IOs, which can reduce the time consumed by disk addressing and other operations, and greatly improve the efficiency of disk writing.
Although write caching can significantly improve efficiency, it also causes serious problems, because caching is the same as ordinary memory,Power failureIn the future, all data will be lost. When the write IO command issued by the operating system is written to the cache, it is considered that the write is successful. In fact, the data is not actually written to the disk. At this time, if power is lost, the data in the cache will be lost forever. This corresponds to a disaster. The best way to solve this problem is to equip the cache with batteries,Ensure that the cache data can be saved after power failure.
Like read, write cache has a Write Cache Hit Radio. However, unlike read cache hits, the actual IO operations cannot be eliminated even though the cache hits. They are just merged.
In addition to the above functions, the controller cache and disk cache also play other roles. For example, the disk cache has the function of saving the IO command queue. A single disk can only process one IO command at a time, but it can receive multiple IO commands. These commands that enter the disk but are not processed are saved in the IO queue in the cache.
RAID(RedundantArrayOf Inexpensive Disks)
If you are aDatabase administratorOr you should be familiar with RAID when you often contact the server. As the cheapest storage solution, RAID has already been popularized in server storage.In all RAID levels, RAID 10 and RAID 5 should be used (but RAID 5 has basically come to an end,RAID6It is rising. See here for the reasons.Next, we will talk about the impact of disk arrays on disk performance in terms of RAID expansion at RAID0, RAID1, RAID5, RAID6, and RAID10 levels. Of course, you must be familiar with the structure and working principle of RAID at all levels before reading the following content, so that you won't be confused. It is recommended to checkwikipediaThe following entries are listed above: RAID, Standard RAID levels, Nested RAID levels.
RAID0
Announce
edit
RAID0 transfers dataStriping(striping) Scatter continuous data on multiple disks for access. IO commands issued by the system (whether read or write) can be executed in parallel on the disk. Each disk executes its own part of the request separately. This parallel IO operation can greatly enhance the overallstorage system Performance.Suppose a RAID0 array consists of n (n>=2) disks, and the random read/write IO capacity of each disk reaches 140, then the entiredisk array The IO capacity of will be 140 * n.At the same time, if the transmission capacity of the array bus allows, RAID0Throughput rateIt will also be n times that of a single disk.
otherRAID area
RAID1Image disk, using two hard disks, generallySystem diskThe read IO is the IO of one hard disk and the write IO is the IO of two hard disks.
RAID10It can not only increase the read/write performance of IO, but also achieve data redundancy. The number of disks used is a multiple of 2 andGreater than or equal to4. The hard disk space is the same. The disadvantage is that the number of hard disks must be increased to achieve IO expansion, and the cost of hard disks to achieve the same performance must be doubled.Allow differencesHard disk dataAny piece of is missing.
RAID3Take out a single disk as the parity disk to achieve data redundancy
In this case, one hard disk is allowed to be damaged.As any data on the disk changes, the check disk will be rewritten again, so too many write operations will become the bottleneck of the whole systemRAID Levels Only forCounterreadingAn environment with relatively high requests and few write requests.RAID3 has been basically eliminated and is generally replaced by RAID5 technology.