You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by franz1981 <gi...@git.apache.org> on 2017/06/08 12:13:52 UTC
[GitHub] activemq-artemis pull request #1324: ARTEMIS-1214 Improve performance of rea...
GitHub user franz1981 opened a pull request:
https://github.com/apache/activemq-artemis/pull/1324
ARTEMIS-1214 Improve performance of read on Paging
For NIO and MAPPED SequentialFile based Pages uses a READ_ONLY memory mapping to perform the bulk read.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/franz1981/activemq-artemis mapped_read_page
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/activemq-artemis/pull/1324.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1324
----
commit f3ad52d7961d51f6aff42f594d0a8f765ecca7f2
Author: Francesco Nigro <ni...@gmail.com>
Date: 2017-06-08T09:58:27Z
ARTEMIS-1214 Improve performance of read on Paging
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by franz1981 <gi...@git.apache.org>.
Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
About the environments,yes it is.
But with libAIO I'm not sure, because libAIO doesn't rely on the page cache,so it won't benefits by exploiting it.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
@franz1981 there are only two parts...
paging/reading.. journal/loading.. journal/printdata (which is using the load.. so I'm not counting this one).. only two
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #1324: ARTEMIS-1214 Improve performance of rea...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/activemq-artemis/pull/1324
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by franz1981 <gi...@git.apache.org>.
Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
I wasn't aware we were reading from LibAIO SequenceFile..where we are using it?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
journal.load... but it could use any mechanism we think it's fast at that point... (for reading that is).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
I'm a bit concerned with isolation of concern on Page.. Why don't you bring your change to SequentialFile and use a method on SequentialFile to read it...
if reading files through mmap is that faster than NIO, lets always read using mmap... even the load on libaio would speed up, as it's using (as far as I remember).
is this the same on any env? lets just use that way always?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
@franz1981 agreed, I think it's sensible to do just the initial scope of paging and later revisit the other / possible future use cases. It avoids muddying the waters/risks. IMO
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by franz1981 <gi...@git.apache.org>.
Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
In that case I can close this PR and make another one using the other branch I've posted...but I'm concerned on the use case here...Mapped reads are the fastest just because NIO/MAPPED share the same OS page cache while writing ,with ASYNCIO I need to do some testz before...
My supposition is that It will rise major page faults on each OS page read because the OS page cache is cold with ASYNCIO that doesn't use it for the writes...so the only benefit will be to avoid to instantiate the direct ByteBuffer ...is not a big improvement...
But If the read was performed with a huge direct ByteBuffer like the paging case..it could worth...wdyt?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by franz1981 <gi...@git.apache.org>.
Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
@michaelandrepearce @clebertsuconic I just need to push another little improvement and I think it is ready to be merged.
FYI the improvement is to recycle the ``ActiveMQBuffers.wrappedBuffer`` used to read/write the page.
I've found that the JVM is not able to allocate it on the stack if not after a huge number of iterations: with pooling it wil make the writes near to garbage free.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by franz1981 <gi...@git.apache.org>.
Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
I've built an "enhanced" solution that brings mapping views of native File as a public SequentialFile feature: https://github.com/franz1981/activemq-artemis/tree/mapped_view_seq_file.
I could consider to push it only if others beside paging could benefit from having such feature implemented on SequentialFile.
@clebertsuconic @mtaylor @michaelandrepearce Makes sense?Any of you know of other points in the code that could need it?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by franz1981 <gi...@git.apache.org>.
Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
In the other branch I've linked I've a proposal about having it as a default method on SequentialFile too, but it needs some unit tests in that case IMHO....but if right now is needed only on paging it could be pushed later when other parts of Artemis will needed...
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
libaio should read a whole file on load... it could use the same mmap mechanism to read the file..
we only need writes to go through libaio, on the cases where users want to sync.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by franz1981 <gi...@git.apache.org>.
Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
@michaelandrepearce
This PR aim to improve the performances (and memory footprint too) while performing reads while Paging when NIO (not JDBC) Paging is in charge.
In addition, the proposal of @clebertsuconic is to use this enhancement as a feature of all the SequentialFile implementations that could support it, similar to what I've done in this branch: https://github.com/franz1981/activemq-artemis/tree/mapped_view_seq_file.
The reason is to speed up the load phase of the journal, but as I've pointed out (and you too), with AIO is needed some additional tests to be sure it's worth.
Right now I'll prefer to stick to support it only with Paging.
Just thinking loud...
A different case would be if we start to use the Journal to be read (LMDB do that and AFAIK Kafka too) and using a map (a BloomFilter would be better) to store where the the records are stored in the journal.
In that case having AIO and exploiting the OS Page Cache could be a very nice idea to avoid the cache to be filled of new OS pages that doesn't have the locality required by the read load patterns.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #1324: ARTEMIS-1214 Improve performance of read on Pa...
Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on the issue:
https://github.com/apache/activemq-artemis/pull/1324
@franz1981 @clebertsuconic been going through this the last two days, one bit I'm unclear on is where or what logic flow are we intending this to improve things for?
Journal
Paging
I ask as if its for the latter (paging), and we're doing it to use page caching as another layer of keeping as much as possible in memory (though not on heap), then i don't think AIO is an option there, as such should probably just scope the work to NIO and MAPPED.
If its for Journal, i thought the journal was write heavy, as the read is only on broker restart, where do we really care, for the extra complexity it will cause if we had to deal with AIO? (i may have miss understood the read path for Journal btw)
Cheers
Mike
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---