Search code examples
asp.net-mvciisasp.net-coreasp.net-core-webapiwindows-server

I want my Windows server to cache web APIs (MVC/MVC CORE)


I have a few Web APIs running on Windows 2016 server.

State 1. This is what the memory usage on my server looks like when I didn't use the APIs for more than 25 mins. And it takes quite long to execute the first tasks at this point. enter image description here

State 2. While waiting for the APIs to complete initial tasks, This is what it looks like. enter image description here

As you see, APIs are probably getting loaded onto the Server's RAM.

State 3. After finishing the initial tasks, it seems like the APIs are fully loaded on the RAM and APIs react very quickly at this point. enter image description here But again, if I don't use the APIs for about 25+mins, it goes back to state 1. How can I make the server to keep the APIs in its memory for a longer time? I am hoping it to have the APIs loaded for at least 1 hour, and I used MVC and MVC CORE to build the APIs.

Thank you very much for your help.


Solution

  • I did not exactly know what the issue is, but thanks to @MarkFitzpatrick, I got a big hint from his reply. The problem had something to do with IIS configuration, and this is how I resolved it.

    https://learn.microsoft.com/en-us/iis/get-started/whats-new-in-iis-85/idle-worker-process-page-out-in-iis85