Research on the Linux Native AIO asynchronous AIOhttp://rango.swoole.com/archives/282First of all, the Epoll+nonblock from a macro point of view can be called full async, but from a microscopic point of view or synchronous IO. Only after the data arrives to get the system notification, then synchronously executes recv retrieves the data, does not have the iowait.The real asynchronous IO (called AIO below) s
Some time ago, I ran mysql on the self-developed iSCSI-based SAN, And the CPU iowait was very large. Later I switched to Native AIO, which greatly improved. Here is a brief summary of the implementation of Native AIO. For databases with IO as the biggest bottleneck, native AIO is almost the best choice. It relies only on multithreading and obviously cannot solve
InnoDB started using Linux native AIO (N-AIO later) from 5.5 and said goodbye to the previous simulation method. We will analyze the native AIO architecture of InnoDB from the source code 5.6.10.InnoDB has n Io handler threads (n = 1 ibuf_io_thread + 1 log_io_thread +Innodb_read_io_threads read_io_thread + innodb_write_io_threads write_io_thread), these threads a
Introduction:The most common input/output (I/O) model in Linux is synchronous I/O. In this model, when a request is sent, the application blocks until the request is met. This is a good solution because no central processing unit (CPU) is required when calling an application waiting for the completion of I/O requests ). However, in some cases, I/O requests may need to overlap with other processes. POSIX asynchronous I/O (AIO) application interface (AP
mainly introduces the use of the asynchronous network IO API and the design of the framework, taking the TCP server as an example. First look at the new classes and interfaces to support AIO introduction:
Java.nio.channels.AsynchronousChannel
Marking a channel supports asynchronous IO operations.
Java.nio.channels.AsynchronousServerSocketChannel
ServerSocket's AIO version, creating a TCP server, bindin
crucial difference, the synchronization must wait or the initiative to ask whether the IO completes, then why say is blocked? Because this is done by a select system call, and the Select function itself is implemented in a blocking way, the advantage of using the Select function is that it can listen to multiple file handles at the same time (if viewed from the UNP (UNIX Net programing) perspective, Select belongs to the synchronization operation. Because the process also needs to read and writ
Java, NIO, AIO-2JavaGive me a chestnut.Then, then, the C/S mode, the reactor mode, and the Proactor mode are the common processing models for server processing IO, and this article explains these modes:Take a food and beverage as an example, each person to eat is an event, he will first look at the menu, then order food. Just like a website will have a lot of requests, ask the server to do something. We need our service staff to deal with these dining
Java, NIO, AIO-2JavaGive me a chestnut.Then, then, the C/S mode, the reactor mode, and the Proactor mode are the common processing models for server processing IO, and this article explains these modes:Take a food and beverage as an example, each person to eat is an event, he will first look at the menu, then order food. Just like a website will have a lot of requests, ask the server to do something. We need our service staff to deal with these dining
JDK7 Although has been released for some time, but helpless, AIO related introduction, especially rely on the introduction of way is too little. The brothers spent some time in sorting the book, hoping to help learner.
Epoll became the first choice for developing a large concurrent Web server under Linux for years, and the Java world didn't use this feature until the AIO of JDK 7 came into being. Hey. But
(IOException e) {e.printstacktrace (); }} @Override public void Run () {while (true) {try {//select block, listen for related events This.seletor.select (); Unblocking,Return select key, key contains channel, status and other information iteratorThe Bio client communicates with the NIO server to be aware of:Bio server, once IO has a definite end point, the client again read will return-1After the NIO service end of an IO, no channel is closed, it may turn the chann
Recently looked at this, did a AIO case to try, unfortunately, the compiler has no problem, the runtime needs permissions, open the way of access to the Internet, this permission is root can be, the company is not possible to give me this permission.
1. Determine the state of the Aio0 driver. Run the following AIX command:Lsdev-c-L Aio0
Example Output:
Aio0 Defined asynchronous I/O2. Run the cfgmgr AIX command:Cfgmgr-l Aio03. Chdev-l aio0-p-a autoconf
http://my.oschina.net/bluesky0leon/blog/132361Also about Bio | NIO | AIO (Java Edition) reprinted from: Zheng-lee blogRelease time: 2013/05/21 12:56About Bio | NIO | The discussion of AIO has always been there, and sometimes it is easy to confuse, to give an explanation as to my understanding:BIO | NIO | AIO, the description of itself is based on the Java languag
constraints, the full use of CPU and memory potential, is the core content of performance optimization.And how is CPU and memory dragged down by IO? This starts with several typical IO operating modes in Java.Ii. Typical IO operation mode in Java 2.1 synchronous blocking modeThe bio-style API in Java is the pattern, for example:Socket socket =// cannot read data vow not to returnIn this mode, the most intuitive feeling is that if the IO device temporarily has no data to read, the call API will
About Bio | NIO |the discussion of AIO is always there, and sometimes it's easy to confuse, as I understand it, to give an explanation: BIO| NIO |AIO, the description of itself is based on the Java language. While describing IO, we need to start from two levels: the programming language implements the underlying fundamentals from the programming language level bio| NIO |
something else to read it.2.3 Asynchronous non-blocking modeThe AIO-style API in Java is the pattern, for example:Asynchronoussocketchannel Asynchronoussocketchannel = Getasynchronoussocketchannel (); Asynchronoussocketchannel.read (Bytebuffer.allocate (4), NULL, New CompletionhandlerThis mode of service is most in place, in addition to making programming relatively complex, almost impeccable.2.4 SummaryFor IO operations, the essential difference bet
Linux AIO Mechanism
Linux's I/O mechanism has gone through several stages of evolution:1. synchronous blocking I/O: User processes perform I/O operations until the I/O operations are completed.2. Non-blocking I/O synchronization: the user program can set the O_NONBLOCK attribute of the file descriptor, and the I/O operation can return immediately, but it does not guarantee that the I/O operation is successful.3. asynchronous event blocking I/O: User p
Today, when using AB for stress testing, it is unintentional to discover:Requests per second:xxx [#/sec] (mean)Ab-n 5000-c http://www:8080/upload/5kb.jpg (nioserver:700 aio:400)Ab-n 5000-c http://www:8080/upload/18kb.jpg (nioserver:560 aio:360)Ab-n 2000-c http://www:8080/upload/134kb.jpg (nioserver:330 aio:300)Ab-n 2000-c http://www:8080/upload/134kb.jpg (nioserv
. If it is not blocked, it is non-blocking Io.
The main improvement of Java NiO 2.0 is the introduction of asynchronous io (including files and networks). Here we mainly introduce the use of Asynchronous Network I/O APIs and the design of the framework. Take the TCP server as an example. First, let's take a look at the new classes and interfaces introduced to support AIO:
Java. NiO. channels. asynchronouschannel indicates that a channel supports a
IO does not have much to do with multithreading, but NIO changes the way threads are used at the application level and solves some of the practical difficulties. AIO is also somewhat related to the asynchronous IO and the previous series. Here, in order to learn and record, also write an article to introduce NiO and AIO.
1. What is NiO
NIO is the abbreviation for new I/O, which, by name, represents a new
is complete, the application will continue to execute downward.Depending on the process above, the process of interacting with the kernel in the bio process is as follows:2. NIO (New I/O)Java supports NIO (New IO) from version 1.4, which enables non-blocking I/O. The obvious difference between nonblocking I/O and blocking I/O is that when the first system call request occurs, the thread is not blocked, but it does not do anything else, but is constantly initiating the system call request.Such a
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.