[GitHub] [activemq-artemis] wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers
wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers URL: https://github.com/apache/activemq-artemis/pull/2750#issuecomment-511398767 @michaelandrepearce I deployed the test without MAX_DEPAGE_NUM limit during depage. The performance result as follows: 1. Running in 51MB size page and 1 page cache in the case of 100 multicast queues. The consumer tps dropped to ~11000 compared to ~16000 in pr. ![image](https://user-images.githubusercontent.com/7719761/61217429-45120600-a742-11e9-8f52-835b10cbabaf.png) ![image](https://user-images.githubusercontent.com/7719761/61217451-4f340480-a742-11e9-8d5a-690b69312d6f.png) 2. Running in 5MB size page and 100 page cache in the case of 100 multicast queues. The consumer tps dropped to ~1 compared to ~15000 in pr. ![image](https://user-images.githubusercontent.com/7719761/61217513-6e329680-a742-11e9-991e-b90a83f2001e.png) ![image](https://user-images.githubusercontent.com/7719761/61217537-74c10e00-a742-11e9-84d1-23c136eaa59a.png) 3. Running in 51MB size page and 1 page cache in the case of 1 queue. Performance results similar. ![image](https://user-images.githubusercontent.com/7719761/61217894-4abc1b80-a743-11e9-88ad-c9fa9a1f2a61.png) ![image](https://user-images.githubusercontent.com/7719761/61217904-514a9300-a743-11e9-9334-47725ba33773.png) Seems like paged message removed and re reading file resulted in the performance drop particularly in the case of heavy usage of memory(test #1,#2). Even if there was enough free memory and messages were not gced(test #3), the performance didn't make a big difference - instead memory footprint might be increased. Considering we've totally relied on the kernel page cache, it seems not to need spare messages in memory. I personally assume this is an import feature. 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [activemq-artemis] wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers
wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers URL: https://github.com/apache/activemq-artemis/pull/2750#issuecomment-513725688 Rebased and fixed to add deps and configuration 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [activemq-artemis] wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers
wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers URL: https://github.com/apache/activemq-artemis/pull/2750#issuecomment-514875375 > I will need some time to review this last week. > > Can you rebase again after I merged your change? I'm working on PageReader per queue these days. Unluckily some problem was encountered. After investigation, I found it was related to #2740 which would sync files while closing. Given we put PageReader in PageSubscription meaning 100 times of file open/close for each page in our case(100 queues), although page file is only opened for reading, the sync operation does cause great performance loss - ~5000 msg/s received and 13000 msg/s sent now compared with 16000 msg/s received and 11000 msg/s sent of pr. Should I file a new jira and pr to fix the problem introuduced by #2740 or just fix it in this one? 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [activemq-artemis] wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers
wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers URL: https://github.com/apache/activemq-artemis/pull/2750#issuecomment-515812679 I've submitted a new pr #2769 to fix it. After reviewed and merged, I would rebase and push the new code with PageReader per queue. 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [activemq-artemis] wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers
wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers URL: https://github.com/apache/activemq-artemis/pull/2750#issuecomment-516807021 Pushed to change PageReader per queue. The perf result is below: 1. Running in 51MB size page and 1 page cache in the case of 100 multicast queues. 19000 msg/s received and 9500 msg/s sent vs. 16000 msg/s received and 11000 msg/s sent with previous PageReader cache. consumer tps: ![per_queue_multi_consumer](https://user-images.githubusercontent.com/7719761/62190465-fdc38080-b3a3-11e9-8c25-078fa75e54d2.png) producer tps: ![per_queue_multi_producer](https://user-images.githubusercontent.com/7719761/62190509-159b0480-b3a4-11e9-9cee-5abc42dacb06.png) 2. Running in 5MB size page and 100 page cache in the case of 100 multicast queues. 16000msg/s received and 8200 msg/s sent vs. 15000 msg/s received and 8500 msg/s sent with previous PageReader cache. consumer tps: ![per_queue_multi_consumer_small](https://user-images.githubusercontent.com/7719761/62206438-67ec1d80-b3c4-11e9-842e-463e2a325187.png) producer tps: ![per_queue_multi_producer_small](https://user-images.githubusercontent.com/7719761/62206486-8225fb80-b3c4-11e9-93f4-a8e5e97dbba8.png) 3. Running in 51MB size page and 1 page cache in the case of 1 queue. 16000 msg/s received and 29000 msg/s sent vs. 13500 msg/s received and 3 msg/s sent with previous PageReader cache. consumer tps: ![per_queue_single_consumer](https://user-images.githubusercontent.com/7719761/62190825-dc16c900-b3a4-11e9-94ee-1946b851adea.png) producer tps: ![per_queue_single_producer](https://user-images.githubusercontent.com/7719761/62190864-f0f35c80-b3a4-11e9-932c-f706d569d56e.png) Generally speaking, the consumer tps increase a little and producer tps reduce less, with total tps increasing by about 1000. It's to be noted that there was frequent file opening/closing in second test scenario(5MB size page and 100 page cache). I added some logging and saw two subsequent deliver was scheduled a few seconds after depage. In the case that message of PagedReference was cleared, calling getPriority/checkExpired in deliver() would trigger reading message. Due to the small page file, reading messages were more likely to hit page before the current cursor. Given PageReader before current cursor was closed, this would cause constantly page file open/close(log showed approximately 6000 times per second in average). In first test scenario(51MB size page and 1 page cache), approximately 700 times per second in average of file open/closing occurred. 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [activemq-artemis] wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers
wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers URL: https://github.com/apache/activemq-artemis/pull/2750#issuecomment-518064779 I've added a new commit to reduce file open/close. The log before this commit showed for each queue depage was followed by two deliver after a few seconds, something like this: `2019-07-31 11:24:12,915 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] Queue Memory Size after depage on queue=sub86 is 4470916 with maxSize = 5242880. Depaged 2000 messages, pendingDelivery=0, intermediateMessageReferences= 2000, queueDelivering=984 2019-07-31 11:24:15,583 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] QueueImpl[name=sub86, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=5d09e339-b32d-11e9-b1ac-fa163e6757d7], temp=false]@2c21ad1e doing deliver. messageReferences=0 2019-07-31 11:24:22,596 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] QueueImpl[name=sub86, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=5d09e339-b32d-11e9-b1ac-fa163e6757d7], temp=false]@2c21ad1e doing deliver. messageReferences=2 2019-07-31 11:24:22,620 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] Queue Memory Size after depage on queue=sub86 is 4490706 with maxSize = 5242880. Depaged 2000 messages, pendingDelivery=0, intermediateMessageReferences= 2000, queueDelivering=990 2019-07-31 11:24:25,620 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] QueueImpl[name=sub86, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=5d09e339-b32d-11e9-b1ac-fa163e6757d7], temp=false]@2c21ad1e doing deliver. messageReferences=0 2019-07-31 11:24:33,095 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] QueueImpl[name=sub86, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=5d09e339-b32d-11e9-b1ac-fa163e6757d7], temp=false]@2c21ad1e doing deliver. messageReferences=2` `2019-07-31 11:20:34,082 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] Queue Memory Size after depage on queue=sub49 is 4473860 with maxSize = 5242880. Depaged 2000 messages, pendingDelivery=0, intermediateMessageReferences= 2000, queueDelivering=982 2019-07-31 11:20:34,161 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] QueueImpl[name=sub49, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=5d09e339-b32d-11e9-b1ac-fa163e6757d7], temp=false]@41a2d788 doing deliver. messageReferences=0 2019-07-31 11:20:44,535 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] QueueImpl[name=sub49, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=5d09e339-b32d-11e9-b1ac-fa163e6757d7], temp=false]@41a2d788 doing deliver. messageReferences=2 2019-07-31 11:20:44,802 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] Queue Memory Size after depage on queue=sub49 is 4473010 with maxSize = 5242880. Depaged 2000 messages, pendingDelivery=0, intermediateMessageReferences= 2000, queueDelivering=971 2019-07-31 11:20:44,999 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] QueueImpl[name=sub49, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=5d09e339-b32d-11e9-b1ac-fa163e6757d7], temp=false]@41a2d788 doing deliver. messageReferences=0 2019-07-31 11:20:55,230 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] QueueImpl[name=sub49, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=5d09e339-b32d-11e9-b1ac-fa163e6757d7], temp=false]@41a2d788 doing deliver. messageReferences=2` It is likely paged message is cleared when delivering a few seconds after depage causing opening/closing file to read message. After this commit, depage is immediately followed by deliver. The log was like this: `2019-08-02 16:35:11,317 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] Queue Memory Size after depage on queue=sub72 is 2227083 with maxSize = 5242880. Depaged 509 messages, pendingDelivery=491, intermediateMessageReferences= 509, queueDelivering=387 2019-08-02 16:35:11,317 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] QueueImpl[name=sub72, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=e0d3e34f-b4df-11e9-956a-fa163e6757d7], temp=false]@36c11804 doing deliver. messageReferences=491 2019-08-02 16:35:16,467 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] Queue Memory Size after depage on queue=sub72 is 2224399 with maxSize = 5242880. Depaged 1000 messages, pendingDelivery=0, intermediateMessageReferences= 1000, queueDelivering=268 2019-08-02 16:35:16,467 DEBUG [org.apache.activemq.artemis.core.server.impl.QueueImpl] QueueImpl[name=sub72, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=e0d3e34f-b4df-11e9-956a-fa163e6757d7], temp=false]@36c11804 doing deliver. mess
[GitHub] [activemq-artemis] wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers
wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers URL: https://github.com/apache/activemq-artemis/pull/2750#issuecomment-518139732 @franz1981 In our test consumers were falling behind producers all the time. I saw ~80GB page files left after test lasting 1 hour. I'm not sure whether it's related to this pr. Considering 10GB page data produced, it's possible the pages are constantly dropping in an out while consumers are cathing up, resulting in performance drop. Could you try this pr to check it? :) 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [activemq-artemis] wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers
wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers URL: https://github.com/apache/activemq-artemis/pull/2750#issuecomment-518556136 @franz1981 > And while catching up, the producers are not seriously decreasing their rate? This PR has helped in your tests? This PR helped to improve consumer throughput while entering into page mode with lots of subscribers. I didn't see the producers rate seriously decreased, although producers slowed down bcs consumers used extra io. 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [activemq-artemis] wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers
wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers URL: https://github.com/apache/activemq-artemis/pull/2750#issuecomment-521883667 @michaelandrepearce Can you wait a moment? When the browse cursor iterators(like the one created by QueueControl::browse, browse only consumer, etc) are closed, the page opened by them is not closed. I would push another commit to fix this. 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [activemq-artemis] wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers
wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers URL: https://github.com/apache/activemq-artemis/pull/2750#issuecomment-521921421 pushed commit to close page reader when cursor iterator is closed 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [activemq-artemis] wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers
wy96f commented on issue #2750: ARTEMIS-2399 Improve performance when there are a lot of subscribers URL: https://github.com/apache/activemq-artemis/pull/2750#issuecomment-521938303 @michaelandrepearce squashed commits and pushed. BTW, I added some code to avoid file leak in race conditions in PageSubscriptionImpl::internalGetNext() : ` serverMessage = ((PageReader) cache).getMessage(retPos, false, true); PageCache previousPageCache = pageReaders.putIfAbsent(retPos.getPageNr(), (PageReader) cache); if (previousPageCache != null && previousPageCache != cache) { // Maybe other cursor iterators have added page reader, we have to close this one to avoid file leak cache.close(); }` 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: us...@infra.apache.org With regards, Apache Git Services