Calling Web Api's with multiple databases at regular intervals using a scheduler in C#
I am working on Dot Net 5 application where I have multiple web api's with different databases. So when I make 1st request to any of the API, the response time is huge(6-7 sec, because the connection object is getting created & connection being established) but the subsequent requests are fast as the connection object already exist.
Now, to overcome this scenario I am trying to implement a scheduler which will ping all the web api's with some dummy request at regular interval say 3 seconds so that the response time is reduced. I am using ADOMD.net for the connection with the databases.
I tried searching a lot over the google but I couldn't find any proper sources to depict the above mentioned problem. Can you all please provide me some insights and the steps to proceed with this problem?? Some examples would also be appreciated.
Thanks in advance :).
@abhishek singh rana Could you please tell me where you hosted your web api application on the IIS or windows service or else? Could you please tell me which database you have used in your application? I think we need to figure our which part caused the first request latency. The server need to start the application and this part takes some long time and the application connect to the database takes so long time.
Sign in to comment