WSO2 APIM Metric DB size increasing

597 Views Asked by At

In our production installation, WSO2 APIM 2.0 has been running for past 2 months, we noticed the size of WSO2METRICS_DB h2 database size is constantly increasing. Is currently 1.2 GiB.

Upon checking the content, noticed all data has not been cleaned up since the day it was deployed.

sql> SELECT COUNT(*) FROM METRIC_GAUGE ;
COUNT(*)
2756204
(1 row, 1 ms)
sql> SELECT MIN(TIMESTAMP) FROM METRIC_GAUGE ;
MIN(TIMESTAMP)
1476859611002 (GMT: Wed, 19 Oct 2016 06:46:51.002 GMT)
(1 row, 3 ms)

sql> SELECT COUNT(*) FROM METRIC_METER ;
COUNT(*)
280292
(1 row, 0 ms)
sql> SELECT MIN(TIMESTAMP) FROM METRIC_METER ;
MIN(TIMESTAMP)
1476860091000 (GMT: Wed, 19 Oct 2016 06:54:51 GMT)
(1 row, 2 ms)


sql> SELECT COUNT(*) FROM METRIC_TIMER ;
COUNT(*)
1118983
(1 row, 1 ms)
sql> SELECT MIN(TIMESTAMP) FROM METRIC_TIMER ;
MIN(TIMESTAMP)
1476859611002 (GMT: Wed, 19 Oct 2016 06:46:51.002 GMT)
(1 row, 2 ms)

sql> SELECT COUNT(*) FROM METRIC_COUNTER ;
COUNT(*)
0
(1 row, 0 ms)

sql>  SELECT COUNT(*) FROM METRIC_HISTOGRAM ;
COUNT(*)
0
(1 row, 0 ms)

Can we safely delete old data by timestamp? (say older than a month).

Is there any clean-up task suppose to do this automatically in WSO2?

Thanks.

0

There are 0 best solutions below