100% CPU and Disk IO usage from Tyk Analytics

Imported Google Group message.
Sender:Marcelo.
Date:Tuesday, 17 November 2015 14:58:56 UTC.

Hi Marcelo,

Yes it will be the size of the DB causing the issue - you have two options: up the RAM on your DB so there’s more ehad room for the analytics to load or b) as you suggest, clean the DB up and kill off some old data.

Tyk can do this automatically, it will, by default set an expireAt value for each record - those values are usually set to like 100 years if no override is set, but you can override it using an Organisation object, assuming you are not using custom tokens:

https://tyk.io/v1.8/rest-api/organisation_quotas/

You will need to modify the object though to include a “data_expires”: numSeconds field.

You will also need to enable “enforce_org_data_age”: true in your tyk.conf

Finally, you will need to create an index in your MongoDB to expire the data:

Once all that is in place and you’ve restarted Tyk you should see data expiring as per the clock time set in expireAt - you’ll still need to manually get rid of some of the older stuff in your DB. It’s all timestamped through so you should be able to select and remove it quite easily.

Cheers,
Martin

  • show quoted text -