I have a Shiny app which calls a light-weight ML model hosted in third party platform via API call and displays result in tabular format. The execution time of this API call is 30 second. We have deployed this app on Kubernetes using ShinyProxy.
After I execute the API call and get results back, I wait for 5-6 minutes without interacting with the Shiny app, leaving it idle. Nothing executing. Post that, I re-run the lightweight ML model API call and the app keeps on showing loading symbol for about 19-25 minutes and suddenly gives result successfully after.
I observed that after 6+minutes of inactivity on the RShiny website deployed with ShinyProxy, if we initiate an API call, while the website screen keeps on showing loading symbol for 20-25 minutes but the call never reaches the ML model.
Only after 20-25 mins the ML model is invoked and gives back the result in its usual time frame.
Shiny logs ----
Calling Algorithm. Request sent at - 2019-02-20 23:24 :38
Algorithm API call logs ----
2019-02-20 23:40 :52.403353 - Inside Algorithm Function, initiated the model
2019-02-20 23:40:52.742326 - Call has finished, returning results
Can anyone please help in how I can prevent the app from hanging/freezing or whatever is happening in those 20 mins? I would appreciate your help on this.