CA Layer 7 API Gateway OTK cleanup Job Extremely slow and latent
search cancel

CA Layer 7 API Gateway OTK cleanup Job Extremely slow and latent

book

Article ID: 393424

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

We notice all of a sudden our DB is not performing well with our OTK cleanup task. Nothing has changed on the db side, and when running similar DB queries local to clean up from oauth_token table its also slow outside of the gateway.

 

Environment

CA Layer7 Gateway 11.x 

CA OTK 4.6.x

Resolution

This seemed to occur as many tokens being issued were 1 time use and the database even with Indexs seemed to have enormous growth.

# mysql 

> use Oauth

> select count(*) from oauth_token;

------------------------------------------

This query was returning over 70 million rows. 
As most tokens were only 1 time use and did not need refresh tokens. Deciding to start fresh by truncating the table resolves the problem and its very speedy.

**** NOTE: Truncate table for oauth_token will remove all entries so its best to perform either a backup of the db or to do this with the assistance of support.