IRPStackSize and Accessing Windows 7 Shares from Windows XP clients

I received a new Windows 7 workstation (replacing an older Windows 7 workstation) and started running into errors accessing my file shares from Windows XP machines.

I get various errors that seem to come and go (at some points it will work fine for hours). One is:

Not enough storage is available to process this command

I also see random failures to open files in applications that try to access lots of files from the share.

Microsoft publishes a cryptic knowledgebase article on the subject that suggests increasing IRPStackSize to fix the problem without any explanation as to why you would need to do so.

I found that increasing the IRPStackSize on both my workstation and the client XP machine seems to make the problems go away.

However, why do I need to do this? Why would one Win7 machine have this problem and another not? They are all on the same domain, so group policy pushes down the same settings to them, some of which I've manually verified. How do I know what the appropriate value is? Or should I just set to to the max of 50?


Solution 1:

This is what tipped me off:

"I also see random failures to open files in applications that try to access lots of files from the share."

Windows uses a layered I/O model, where drivers attach to each other and utilize the services of the underlying driver to perform their work. A layer of drivers that utilize each other's services are typically referred to as a, "driver stack."

You have too many filters in the particular stack (The number of requests each going through the layers of Antivirus, base filtering engine, ntfs, etc. etc.) so the default IRPStackSize isn't large enough. Increasing the default allows for all of the filters to have their own I/O stack location and everyone is happy. This is not a general Windows problem, but just a limitation of certain drivers in the system.

Consider hosting your heavily used file shares on a file server, and then read the 2008 R2 Tuning Guide, specifically the part about tuning file server performance: http://msdn.microsoft.com/en-us/windows/hardware/gg463392