Site icon techieswiki

How to reduce the size of EMS data store files?

EMS store is configured as a file-based store, so it will have below file based Databases corresponding to each store.

DB Store
Meta.db $sys.meta
Async-msgs.db $sys.nonfailsafe
Sync-msgs.db $sys.failsafe

The reason for the store file size increase mainly depends upon pending messages on queues/topics. There is a bug in EMS where once the store size increases beyond a certain limit due to pending messages it is never able to reduce its size even after the messages have been consumed or purged.
Use the below command in EMS Server tool to check pending messages in store files.

syntax : show store [store_name]

show store $sys.failsafe.

This would give you message count stored in $sys.failsafe

Use COMPACT command to reduce the size of store files.

Syntax: compact [store type] [max time]

Store types:

asynchronous or async or a for asynchronous storage
synchronous or sync or s for synchronous storage
meta or m for meta storage

max time:
the upper limit in seconds on compaction time(0 for specifying no upper limit)

compact sync 5 /*this command will run for 5 sec*/

Output: Compaction complete. Old file size = 23 GB, new file size = 1.57 GB, 98% size reduction
NOTE: 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.

NOTE: Run this command in the EMS server when less amount of messages are there in queues/topics.

Exit mobile version