[
https://issues.apache.org/jira/browse/ARTEMIS-2399?focusedWorklogId=277028&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-277028
]
ASF GitHub Bot logged work on ARTEMIS-2399:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 15/Jul/19 22:28
Start Date: 15/Jul/19 22:28
Worklog Time Spent: 10m
Work Description: michaelpearce-gain commented on pull request #2750:
ARTEMIS-2399 Improve performance when there are a lot of subscribers
URL: https://github.com/apache/activemq-artemis/pull/2750#discussion_r303663059
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageReader.java
##########
@@ -0,0 +1,88 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.core.paging.cursor.impl;
+
+import org.apache.activemq.artemis.core.paging.PagedMessage;
+import org.apache.activemq.artemis.core.paging.cursor.PageCache;
+import org.apache.activemq.artemis.core.paging.cursor.PagePosition;
+import org.apache.activemq.artemis.core.paging.impl.Page;
+import org.jboss.logging.Logger;
+
+public class PageReader implements PageCache {
+ private static final Logger logger = Logger.getLogger(PageReader.class);
+
+ private Page page;
+
+ public PageReader(Page page) {
+ this.page = page;
+ }
+
+ @Override
+ public long getPageId() {
+ return page.getPageId();
+ }
+
+ @Override
+ public int getNumberOfMessages() {
+ return page.getNumberOfMessages();
+ }
+
+ @Override
+ public void setMessages(PagedMessage[] messages) {
+ }
+
+ @Override
+ public PagedMessage[] getMessages() {
+ throw new UnsupportedOperationException("get messages should not be
called for index page cache");
+ }
+
+ @Override
+ public boolean isLive() {
+ return false;
+ }
+
+ @Override
+ public synchronized PagedMessage getMessage(PagePosition pagePosition) {
+ if (pagePosition.getMessageNr() >= getNumberOfMessages()) {
+ return null;
+ }
+ try {
+ PagedMessage msg;
+ if (pagePosition.getFileOffset() != -1) {
+ msg = page.readMessage(pagePosition.getFileOffset(),
pagePosition.getMessageNr(), pagePosition.getMessageNr(), pagePosition);
+ } else {
+ if (logger.isTraceEnabled()) {
+ logger.trace("get message from pos " + pagePosition, new
Exception("trace get message"));
+ }
+ msg = page.readMessage(0, 0, pagePosition.getMessageNr(),
pagePosition);
+ }
+ return msg;
+ } catch (Exception e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ public synchronized void close() {
+ try {
+ page.close(false);
+ } catch (Exception e) {
+ logger.warn("Closing page " + page.getPageId() + " occurs
exception:", e);
Review comment:
should be a parametised error with an error code.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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: 277028)
Time Spent: 8h 20m (was: 8h 10m)
> Improve performance when there are a lot of subscribers
> -------------------------------------------------------
>
> Key: ARTEMIS-2399
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2399
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: Broker
> Affects Versions: 2.9.0
> Environment: broker 2.9.0
> cpu: 4 cores, memory: 8G, disk: ssd 500G
> broker.xml:
> <thread-pool-max-size>60</thread-pool-max-size>
> <address-setting match="#">
> <max-size-bytes>51Mb</max-size-bytes>
> <page-size-bytes>50Mb</page-size-bytes>
> <page-max-cache-size>1</page-max-cache-size>
> <address-full-policy>PAGE</address-full-policy>
> </address-setting>
> <message-expiry-scan-period>-1</message-expiry-scan-period>
> Reporter: yangwei
> Priority: Major
> Time Spent: 8h 20m
> Remaining Estimate: 0h
>
> We noticed that there was a significant drop in performance when entering
> page mode in the case of multiple subscribers.
> We created a topic and 100 queues bound to it. We ran our _GrinderRunner
> test_ in our inner test infra cluster with 500 threads producing message and
> 560 threads, each one picked a random queue to subscribe. The test showed
> performance is bad: 13000 msg/s sent and 5000 msg/s received.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)