I’m using EHCache to cache YouTube API requests with a ttl of 30 minutes. The JSON response of each API request is cached, and at peak times, I am getting 15K page views per 30 minutes, so at minimum, there will be 15K cache entries in the cache. However, many page views make multiple API requests, so it’s more likely there will be upwards of 40K-50K entries in the cache. I’m getting upwards of 350K page views per day, so needless to say, this cache collection is getting hit pretty hard.
What’s happening is that everything works great for several days and then Tomcat basically chokes and stops responding - using 100% of the CPU. If I disable caching altogether, I can run the server forever, so I know this issue is related to my EHCache settings.
I’m running Lucee 126.96.36.199 with EHCache 188.8.131.52.
The question is… what can I do to troubleshoot this?