Database Data Purge
The WorkFusion database stores a lot of information for each Business Process (BP) or task execution. Once the database has too much data, its performance degrades. It is recommended to purge the database to preserve space and maintain acceptable speed. Here are the steps you can use to purge unnecessary data from the database.
MySQL
UI Data Purge: Schedule Settings.
To reclaim unused database space to the OS, act as described in the instruction.
However, these actions are only useful if there is a lot of free space in the database table. To check that, use the following query:
SELECT table_schema, table_name, round(((data_length + index_length) )) AS Size_in_Bytes, data_free
FROM information_schema.TABLES
ORDER BY Size_in_Bytes DESC LIMIT 10;
That query returns the estimated table size and free space for the top ten tables (the difference from the actual table size could be up to 30%, but it is not important for our purposes). If data_free is greater than 30% of Size_in_bytes, run OPTIMIZE TABLE and expect that you will gain some space.
note
If data_free is less than 30%, don't bother to run OPTIMIZE TABLE as you will not get a significant table file size decrease. Instead, you can even get the table file size increase.
PostgreSQL
UI Data Purge: Data Store Purging
For indices, read the article.
MongoDB
The total combined size of all data in operation, plus a small overhead, has to be less than 32 MB. Otherwise, MongoDB will not start after reboot.
RPA Manager writes into MongoDB in the binary format. This data is used for analytics only, so there is no need to keep it for more than one month.
To purge MongoDB, follow the steps below:
Download the following script: mongo_cleanup.js
Update the file with a proper password and the optional
daysToDeletionparameter.Save it on the database host (the example uses the
toolsdirectory:/opt/workfusion/tools).Run it with the following syntax:
mongo --port 27016 /opt/workfusion/tools/mongo_cleanup.js
Consider including the script to crontab for scheduled execution. Make sure to back up the data folder before the first run.