[ 
https://issues.apache.org/jira/browse/ROCKETMQ-317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16279735#comment-16279735
 ] 

ASF GitHub Bot commented on ROCKETMQ-317:
-----------------------------------------

githublaohu commented on issue #195: [ROCKETMQ-317] Take advantage of Linux 
native libaio
URL: https://github.com/apache/rocketmq/pull/195#issuecomment-349550112
 
 
   @lizhanhui 
   读取 mmap的数据,有两种情况,
   第一种是 读取的数据,被mmap映射到内存空间了,那么从内存读取
   第二种是 读取的数据,的内存空间被刷下了。从而从磁盘读,mmap默认是读取4K,
   
   1. netty io线程阻塞是因为 第二种情况造成的。引入linux aio是解决第二种情况,致使netty io线程阻塞,造成响应慢的情况。
   但是也屏蔽掉了第一种情况,数据被mmap映射到内存中的读取速度 比linux aio的读取数据块太多了,
   
   2. ,linux aio 不使用内存,mmap会把数据映射到内存中,而使用大量的内存,在某些情况下,会占用大量的内存,而不使用。
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Make full use of Linux native libaio 
> -------------------------------------
>
>                 Key: ROCKETMQ-317
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-317
>             Project: Apache RocketMQ
>          Issue Type: Improvement
>            Reporter: Zhanhui Li
>            Assignee: vongosling
>
> libaio is a library, developed as part of the Linux kernel project. With 
> libaio, writes are submitted to the operating system where they are processed 
> asynchronously. When the writes have been processed, the operating system 
> calls the code back.
> When messages being pulled were reclaimed out of main memory, making use of 
> Linux native AIO system calls still allows zero-copy without blocking netty 
> IO threads.
> https://activemq.apache.org/artemis/docs/latest/libaio.html
> https://www.ibm.com/developerworks/library/l-async/
> https://access.redhat.com/documentation/en-us/jboss_enterprise_application_platform/5/html/hornetq_user_guide/libaio
> https://stackoverflow.com/questions/8768083/difference-between-posix-aio-and-libaio-on-linux



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to