Tuesday, November 24, 2015

EMS store files growing - EMS compact command usage

EMS store is configured as filebase store, So list of stores available for us as follows :


and their respective .db files are as follows :

These file sizes may increase and is mainly depends on pending messages on queues/topics.We can check the pending messages in your store files by using below command from EMS-Admin Tool.

tcp://localhost:7222> show store <store_name>
tcp://localhost:7222> show store $sys.nonfailsafe

Here purge or consume messages will reduce the store file size but for sometimes this store files size won't be decreased even after the messages has been consumed/purged.

We can reduce it by using EMS compact command. This we can run from EMS Admin Tool.

tcp://localhost:7222> compact a 5

Here 'a' is for async messages and 5 seconds is the time limit for which compact will run, use 's' for sync and 'm' for meta messages, depending on which store needs to compact.

NOTE :This could be better if we try it in dev or test servers before using in production.

Sample command output is as below :

tcp://localhost:7222> compact a 5
WARNING: Once started, it is not possible to interrupt the compaction and all other operations (creating new connections, sending and/or receiving messages, etc...) will be suspended during, at most, 5 seconds.
Are you sure (yes,no)? yes
Compaction complete. Old file size = 2.0 Kb, new file size = 1.5 Kb, 25% size reduction

Please leave a comment if it really helps you.

No comments:

Post a Comment

back to top