Search code examples
iisfastcgi

Why would the App Pool memory use be high for FastCGI


I wrote a FastCGI server application which seems to work great. The end user tells me that they usually have about 10-12 instances of my exe running using 11-32MB memory. That is perfectly reasonable for what it is doing.

The issue is that w3wp.exe memory usage has a wide range, as high as 500MB.

I'm wondering what causes this high memory use. My only guess is that it is incoming data that hasn't been passed to my app and outgoing data that is in process of being sent to the client app.

If this turns out to be normal, is their a way to get it to release memory? Would having more than one worker process be a good idea?


Solution

  • You can use the IIS Application pool recycle option to recycle the IIS w3wp.exe process and reduce any memory leak. You can recycle the process at regular intervals, at specific times, After a number of requests , based on virtual memory usage , private memory usage etc. In your case you can set virtual memory/private memory usage recycling threshold to 200 MB and try.

    The setting can be set from IIS manager-> Application Pools->Recycling Setting

    Below is the Link with more details

    https://learn.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/add/recycling/

    Recycle settings