Endy Tjahjono
Endy Tjahjono

Reputation: 24500

IIS max worker process is set to 1, but spawns more?

Is it possible for IIS 6 to spawn more than one worker process even after I have set max number of worker process to one? If yes, under what condition? Maybe during application pool recycle?

I'm asking because I have been getting errors like The process cannot access the file 'mylogfile.txt' because it is being used by another process.

I suspect I got this error because there are more than one IIS worker running my ASP.NET MVC 3 app, and the apps try to write to the same log file at the same time. I'm pretty sure there are no other applications opening the log file. I'm also pretty sure the logging library (Essential Diagnostics) is able to handle multiple threads (not processes) trying to write log at the same time.

Is there a way to check this at the time it is happening?

Upvotes: 2

Views: 1059

Answers (1)

Furqan Hameedi
Furqan Hameedi

Reputation: 4400

Yes, the IIS Worker process can spawn more instances for any of the following reasons,

   1. During Application Pool recycles (as you mentioned).
   2. During web application restarts (by web.config, or IIS resets)
   3. By machine.config file configurations, if certain memory thresholds reaches(like no. of requests , CPU usage, memory usage , etc )

Upvotes: 3

Related Questions