finsym / finsymapi

Repository to allow reporting of finsym API issues
0 stars 0 forks source link

Slow response time if long time since last call #2

Open finsym opened 6 years ago

finsym commented 6 years ago

The API seems to take a long time to respond to a request if a sufficiently long time has passed since the last request. It seems to need "warming up". Once warmed up, response times are okay.

finsym commented 6 years ago

This seems to be down to the POS tagger - could be that the data files are swapped out if they've not been used for a while and the delay is down to loading them into memory again.

finsym commented 6 years ago

Having done some tests, the issue is related to container reuse (or rather non-reuse) in AWS Lambda. This article (and the link to the Python code) showed that the problem with the long delay in performing the Parts-of-Speech analysis is due to cold container starts - which means reloading all the data files needed for POS tagging.

I've tried using cloudwatch pings to keep the container warm, as recommended elsewhere, but this doesn't seem to be working. Other alternatives include

Each of these will take a while to develop, sos we may have to live with poor response times for now.