iitsoftware / swiftmq-ce

SwiftMQ Community Edition
Apache License 2.0
16 stars 0 forks source link

Increasing Store Page Size slows startup #94

Closed andy-barlow closed 2 years ago

andy-barlow commented 2 years ago

CleanShot 2022-08-23 at 07 35 42

iitsoftware commented 2 years ago

Actually, this is a one-time slow down during resize. After that, it should start without delay. You can see it in the info.log.

andy-barlow commented 2 years ago

Hi Andreas

Sorry, I just created that as a placeholder - it’s unfinished at moment.

I’m seeing some significant slow down in normal startup; just trying to get some evidence and I’ll update the issue.

Andy Barlow - CTO - MBCS CITP CENG EUR ING Secure Digital Exchange Limited

@.*** t: +44 (0)208 064 0650 d: +44 (0)333 090 6159 m: +44 (0)7830 302 268 w: www.sdxmessaging.com

This message is confidential and may be legally privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system; you must not copy or disclose the contents of this message or any attachment to any other person. The information expressed in this email or facsimile is not given or endorsed by my firm or employer unless otherwise indicated by an authorised representative independent of this message.

For information about how Secure Digital Exchange processes UK and EU personal data that is subject to the requirements of applicable data protection laws, please see our Privacy Notice regarding the processing of UK and EU personal data about clients and other business contacts at https://www.sdxmessaging.com/privacy-policy.

Secure Digital Exchange Limited is a company registered in England and Wales. Company number: 05137996. Registered office address: Suite A, 6 Honduras Street, London, England, EC1Y 0TH. On 23 Aug 2022, 07:59 +0100, Andreas Mueller @.***>, wrote:

Actually, this is a one-time slow down during resize. After that, it should start without delay. You can see it in the info.log. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

andy-barlow commented 2 years ago

Hi Andreas

I’m seeing a consistent 15-minute startup after resizing the pages on our development router from 2048 to 65536: when the page size was set to 2048 it started in seconds.

We’re running GraalVM 22.2.0 with core and js.

Andy Barlow - CTO - MBCS CITP CENG EUR ING Secure Digital Exchange Limited

@.*** t: +44 (0)208 064 0650 d: +44 (0)333 090 6159 m: +44 (0)7830 302 268 w: www.sdxmessaging.com

This message is confidential and may be legally privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system; you must not copy or disclose the contents of this message or any attachment to any other person. The information expressed in this email or facsimile is not given or endorsed by my firm or employer unless otherwise indicated by an authorised representative independent of this message.

For information about how Secure Digital Exchange processes UK and EU personal data that is subject to the requirements of applicable data protection laws, please see our Privacy Notice regarding the processing of UK and EU personal data about clients and other business contacts at https://www.sdxmessaging.com/privacy-policy.

Secure Digital Exchange Limited is a company registered in England and Wales. Company number: 05137996. Registered office address: Suite A, 6 Honduras Street, London, England, EC1Y 0TH. On 23 Aug 2022, 08:11 +0100, Andy Barlow @.***>, wrote:

Hi Andreas

Sorry, I just created that as a placeholder - it’s unfinished at moment.

I’m seeing some significant slow down in normal startup; just trying to get some evidence and I’ll update the issue.

Andy Barlow - CTO - MBCS CITP CENG EUR ING Secure Digital Exchange Limited

@.*** t: +44 (0)208 064 0650 d: +44 (0)333 090 6159 m: +44 (0)7830 302 268 w: www.sdxmessaging.com

This message is confidential and may be legally privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system; you must not copy or disclose the contents of this message or any attachment to any other person. The information expressed in this email or facsimile is not given or endorsed by my firm or employer unless otherwise indicated by an authorised representative independent of this message.

For information about how Secure Digital Exchange processes UK and EU personal data that is subject to the requirements of applicable data protection laws, please see our Privacy Notice regarding the processing of UK and EU personal data about clients and other business contacts at https://www.sdxmessaging.com/privacy-policy.

Secure Digital Exchange Limited is a company registered in England and Wales. Company number: 05137996. Registered office address: Suite A, 6 Honduras Street, London, England, EC1Y 0TH. On 23 Aug 2022, 07:59 +0100, Andreas Mueller @.***>, wrote:

Actually, this is a one-time slow down during resize. After that, it should start without delay. You can see it in the info.log. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

iitsoftware commented 2 years ago

Resizing to a higher page size converts all pages to that size. The number of pages isn't reduced. That's why you will certainly have a big page.db. During startup, all free pages are collected. This takes the time.

Do this (all from Explorer):

andy-barlow commented 2 years ago

Hi Andreas

I did that but unfortunately, it made little if any difference.

I’m going to try setting a 16k value, and see what difference that makes.

Andy Barlow - CTO - MBCS CITP CENG EUR ING Secure Digital Exchange Limited

@.*** t: +44 (0)208 064 0650 d: +44 (0)333 090 6159 m: +44 (0)7830 302 268 w: www.sdxmessaging.com

This message is confidential and may be legally privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system; you must not copy or disclose the contents of this message or any attachment to any other person. The information expressed in this email or facsimile is not given or endorsed by my firm or employer unless otherwise indicated by an authorised representative independent of this message.

For information about how Secure Digital Exchange processes UK and EU personal data that is subject to the requirements of applicable data protection laws, please see our Privacy Notice regarding the processing of UK and EU personal data about clients and other business contacts at https://www.sdxmessaging.com/privacy-policy.

Secure Digital Exchange Limited is a company registered in England and Wales. Company number: 05137996. Registered office address: Suite A, 6 Honduras Street, London, England, EC1Y 0TH. On 23 Aug 2022, 09:57 +0100, Andreas Mueller @.***>, wrote:

Resizing to a higher page size converts all pages to that size. The number of pages isn't reduced. That's why you will certainly have a big page.db. During startup, all free pages are collected. This takes the time. Do this (all from Explorer):

• Enable Perform Compact on Startup (Store Swiftlet / Database) • Reboot (Router Node) • Disable Perform Compact on Startup • Reboot again -> should be faster

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

iitsoftware commented 2 years ago

Yes, that would be my next recommendation as it highly depends on the size of the disk buffers.

iitsoftware commented 2 years ago

You can limit what is set as page-size-recommended if you set the max page size (via Explorer) to 16384.

andy-barlow commented 2 years ago

Hi Andreas

Many thanks for your help’ you’ve hit the nail on the head, we’ve decided to set the page size to 16384.

We tested a few settings, and as the size of page.db got closer to the RAM given to the JVM we observe a very significant slow down on startup, which I imagine is to be expected.

For information, here are our numbers, roughly.

page-size start time 2048 5 seconds 16384 10 seconds 32768 20 seconds 65536 20 minutes 131072 gave up waiting

Again as you expect, the size of page.db doubled each time, beginning at 500Mb (for our development router, others will vary of course) ad growing to 35Gb by the time we got to 131072.

I wonder if it is worth the recommendation following the scan to reflect the fact that - depending on available disk and RAM - you may want to choose a lower setting?, and 16384 seems pretty sensible.

Andy Barlow - CTO - MBCS CITP CENG EUR ING Secure Digital Exchange Limited

@.*** t: +44 (0)208 064 0650 d: +44 (0)333 090 6159 m: +44 (0)7830 302 268 w: www.sdxmessaging.com

This message is confidential and may be legally privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system; you must not copy or disclose the contents of this message or any attachment to any other person. The information expressed in this email or facsimile is not given or endorsed by my firm or employer unless otherwise indicated by an authorised representative independent of this message.

For information about how Secure Digital Exchange processes UK and EU personal data that is subject to the requirements of applicable data protection laws, please see our Privacy Notice regarding the processing of UK and EU personal data about clients and other business contacts at https://www.sdxmessaging.com/privacy-policy.

Secure Digital Exchange Limited is a company registered in England and Wales. Company number: 05137996. Registered office address: Suite A, 6 Honduras Street, London, England, EC1Y 0TH. On 23 Aug 2022, 10:57 +0100, Andreas Mueller @.>, wrote: You can limit what is set as page-size-recommended if you set the max page size (via Explorer) to 16384. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

iitsoftware commented 2 years ago

For your case, 16K and 32K seem feasible to me but not more. I'll add some explanations to the docs.

iitsoftware commented 2 years ago

Docs updated:

https://docs.swiftmq.com/howto/boosting-persistent-store-performance