[
https://issues.apache.org/jira/browse/ARTEMIS-2224?focusedWorklogId=186314&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-186314
]
ASF GitHub Bot logged work on ARTEMIS-2224:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 17/Jan/19 14:29
Start Date: 17/Jan/19 14:29
Worklog Time Spent: 10m
Work Description: franz1981 commented on pull request #2494: ARTEMIS-2224
Reduce contention on LivePageCacheImpl
URL: https://github.com/apache/activemq-artemis/pull/2494#discussion_r248691840
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/LivePageCacheImpl.java
##########
@@ -16,30 +16,31 @@
*/
package org.apache.activemq.artemis.core.paging.cursor.impl;
-import java.util.LinkedList;
-import java.util.List;
-
import org.apache.activemq.artemis.core.paging.PagedMessage;
import org.apache.activemq.artemis.core.paging.cursor.LivePageCache;
import org.apache.activemq.artemis.core.paging.impl.Page;
import org.apache.activemq.artemis.core.server.LargeServerMessage;
+import
org.apache.activemq.artemis.utils.collections.ConcurrentAppendOnlyChunkedList;
import org.jboss.logging.Logger;
/**
* This is the same as PageCache, however this is for the page that's being
currently written.
*/
-public class LivePageCacheImpl implements LivePageCache {
+public final class LivePageCacheImpl implements LivePageCache {
private static final Logger logger =
Logger.getLogger(LivePageCacheImpl.class);
- private final List<PagedMessage> messages = new LinkedList<>();
+ private static final int CHUNK_SIZE = 32;
Review comment:
@qihongxu This should do the "trick" to improve things when is expected an
heavy usage of paging with small messages and big pages: if you tweak this in a
separate branch (taken from master too) into `CHUNK_SIZE = 64*1024` it would
save many cache misses and it should speedup in a visible way the paged message
queries.
You can give it a try and if it should work we can think to expose it or
just provide an cursor-like implementation instead of a generic query that
would give more hints about which access pattern is being used eg sequential I
suppose. Many thanks for the tests/efforts and intuitions! :+1:
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 186314)
Time Spent: 3h 40m (was: 3.5h)
> Reduce contention on LivePageCacheImpl
> --------------------------------------
>
> Key: ARTEMIS-2224
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2224
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: Broker
> Affects Versions: 2.7.0
> Reporter: Francesco Nigro
> Assignee: Francesco Nigro
> Priority: Major
> Time Spent: 3h 40m
> Remaining Estimate: 0h
>
> Has been measured that LIvePageCacheImpl operations are a source of
> contention on producer side while paging.
> This contention decrease the scalability of the broker in an evident way
> while using topics, because the page cache is been accessed concurrently by
> several producers to ack transactions while the messages are being appended.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)