Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

IIS 6, old ISAPI filters

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  IIS 6.0 Application Configuration  
Author Message
Mark

External


Since: Apr 04, 2005
Posts: 22



(Msg. 1) Posted: Thu May 12, 2005 4:26 pm
Post subject: IIS 6, old ISAPI filters
Archived from groups: microsoft>public>inetserver>iis (more info?)

Hi...

Our ops guys want to upgrade all of our old W2K, IIS 5 servers to W2k3/IIS
6, and I'm wondering about the implications for a few old ISAPI filters we've
got.

The first trial box they set up had 2 worker threads set to cycle every
hour. They found that IIS was generating rather prodigious .hdmp files
(still trying to find a reader for those), and they think it's got something
to do with our ISAPI filters.

As I undersstand some of the MSDN documentation, how ISAPI filters are
executed has changed significantly along with the process model for IIS in
v6. Where ISAPIs used to run in the parent process, now they're run in the
worker threads.

Obviously, that has implications for isapi memory structures, configuration
and such - you'll have as many copies of the memory structures for the isapi
as you do worker threads, so there are a lot of implications there.

How about cleanup/shutdown/recycling? How is that handled? In our old
ISAPI, cleanup was done on PROCESS_DETACH from the dll (which presumably the
IIS 5 parent process was doing). We never saw any dumps coming out of that.

When you mix in worker thread recycling, is there any difference in how the
cleanup/shutdown happens? I'm wondering if something different in the
recycling process may be involved in the crash dumps we're seeing, as the
number of dumps is related to how often tehy set it to recycle.

Thanks
_mark

 >> Stay informed about: IIS 6, old ISAPI filters 
Back to top
Login to vote
Wei-Dong XU [MSFT]

External


Since: Feb 05, 2005
Posts: 100



(Msg. 2) Posted: Fri May 13, 2005 2:55 am
Post subject: RE: IIS 6, old ISAPI filters [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Mark,

"if something different in the recycling process may be involved in the
crash dumps we're seeing, as the number of dumps is related to how often
tehy set it to recycle."
Are these dumps generated by Drwatson or other debugging application? For
your scenario, it appears that the recycle of IIS 6.0 caused the
dump;generally speaking on this issue, we can use the Windows Debugging
tools to locate the root cause. I'd suggest you can follow this article on
the IIS debugging.
Troubleshooting IIS with a Debugger (IIS 6.0)
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/d
ff42d12-008d-40db-9233-4a1ad22e6053.mspx

Furthermoer, at Windows server 2003, IIS6.0 has one new kernel component
serving the http communication: http.sys. Each site process should work in
user mode. So this kernel mode component will need to pass the internet
request to the user mode sites. However, it can only direct the raw http
data to one user-mode process, which stops the support of IIS6.0 to the
ISAPI event SF_NOTIFY_READ_RAW_DATA. I'd suggest you can review the ISAPI
filter to see whether it handles this event. This kb article will
introduces more information for you on this:
311852 Information about ISAPI filters that register the
http://support.microsoft.com/?id=311852

And the site level filter loading time is different from before. The
fitlers configured at the site level will be loaded when the first request
comes. As one comparison, they are loaded into inteinfo.exe when it is set
at IIS5.0. This is because at IIS6.0 the site worker process may be shut
down when no internet request comes for a long time; then IIS can free the
resource for the system. And when a new request comes, IIS will start the
site worker process and load the site level filter to serve the internet
request.
317204 IIS 6.0: ISAPI Filter Loads After First Request to the Web Site
http://support.microsoft.com/?id=317204

For the new features of IIS6.0, this technet article will present them for
you.
Technical Overview of Internet Information Services (IIS) 6.0
http://www.microsoft.com/windowsserver2003/techinfo/overview/iis.mspx

Furthermore, this article will introduce the configuration regarding the
IIS 6.0 worker process: shutdown, recycle, pinging etc.
Configuring IIS 6.0 for Optimum Availability (IIS 6.0)
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/8
b432018-d284-4140-b2ea-f063ea0933a9.mspx

Please feel free to let me know if you have any question. My pleasure to be
of any assistance.

Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.

 >> Stay informed about: IIS 6, old ISAPI filters 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 3) Posted: Fri May 13, 2005 3:30 am
Post subject: Re: IIS 6, old ISAPI filters [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > As I undersstand some of the MSDN documentation, how ISAPI filters
 > are executed has changed significantly along with the process model for
 > IIS in v6. Where ISAPIs used to run in the parent process, now they're
 > run in the worker threads.

No, we did not change it that significantly. The functionality of ISAPI
Filters interface has remained stable. What has changed is the underlying
process model and its implications on ISAPI Filters, and that is absolutely
expected. It is one reason we have an "IIS5 Compatibility Mode" -- to remove
the process model as a change and try to emulate IIS5 behavior wherever
possible.

 > When you mix in worker thread recycling, is there any difference in how
 > the cleanup/shutdown happens? I'm wondering if something different in
 > the recycling process may be involved in the crash dumps we're seeing,
 > as the number of dumps is related to how often tehy set it to recycle.

There's not much difference in how IIS6 presents the cleanup/shutdown to
ISAPI Filter for worker process recycling. IIS6 will make sure to unload the
ISAPI Filter DLL when it recycles, which eventually triggers your
PROCESS_DETACH entry point, etc. Not much problems with IIS6 here.

However, the mere fact that you are using IIS6 Application Pools means you
are introducing big differences to ISAPI Filters:
1. Multi-instance. It used to be that ISAPI Filter runs singleton instance
on the entire server. Now, it can run an instance inside different worker
processes. That global mutex is now more of a problem than a solution...

2. Recycling. It used to be that ISAPI Filter only starts up when the server
starts and cleans up when the server shuts down. This was a relatively rare
occurrence because you'd only do this once every several days/weeks.

Frequently, there are startup/shutdown bugs in ISAPI Filters that get
"covered up" because those events do not happen very often... but when you
recycle, they are now happening on the order of 24 times a day (instead of
once every several days), thus these filter startup/shutdown bugs are easily
exposed.

Recycling also introduces a possibility that two instances of same ISAPI
Filter DLL is in memory at the same time (via "overlapping recycle", where
the old w3wp.exe and filter DLL stays in memory until the new w3wp.exe and
filter DLL loads up). This is of course configurable, and the default is to
allow overlapping recycle.

3. Identity. It used to be that ISAPI Filter runs inside inetinfo.exe, which
runs as LocalSystem. By default in Worker Process Isolation Mode, it is
Network Service. Some filters depend on the identity to access various
resources, including Event Log and the file system.

A quick check would be to switch IIS6 into IIS5 Compatibility mode, which
would emulate IIS5 behavior by removing the multi-instance (filters all load
inside inetinfo.exe like before), there is no recycling, and the process
identity goes to LocalSystem.

If the filter runs fine in IIS5 Compatibility mode but fails in IIS6 Worker
Process Isolation mode, more than likely, there are some latent bugs in the
ISAPI Filter that are not uncovered until now, and you will have to
fix/address them in order to use IIS6 Application Pools.

--
//David
IIS
<a style='text-decoration: underline;' href="http://blogs.msdn.com/David.Wang" target="_blank">http://blogs.msdn.com/David.Wang</a>
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Mark" <mmodrall.DeleteThis@nospam.nospam> wrote in message
news:5D06B819-E32D-4AA9-B166-348C48869711@microsoft.com...
Hi...

Our ops guys want to upgrade all of our old W2K, IIS 5 servers to W2k3/IIS
6, and I'm wondering about the implications for a few old ISAPI filters
we've
got.

The first trial box they set up had 2 worker threads set to cycle every
hour. They found that IIS was generating rather prodigious .hdmp files
(still trying to find a reader for those), and they think it's got something
to do with our ISAPI filters.

As I undersstand some of the MSDN documentation, how ISAPI filters are
executed has changed significantly along with the process model for IIS in
v6. Where ISAPIs used to run in the parent process, now they're run in the
worker threads.

Obviously, that has implications for isapi memory structures, configuration
and such - you'll have as many copies of the memory structures for the isapi
as you do worker threads, so there are a lot of implications there.

How about cleanup/shutdown/recycling? How is that handled? In our old
ISAPI, cleanup was done on PROCESS_DETACH from the dll (which presumably the
IIS 5 parent process was doing). We never saw any dumps coming out of that.

When you mix in worker thread recycling, is there any difference in how the
cleanup/shutdown happens? I'm wondering if something different in the
recycling process may be involved in the crash dumps we're seeing, as the
number of dumps is related to how often tehy set it to recycle.

Thanks
_mark<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: IIS 6, old ISAPI filters 
Back to top
Login to vote
Mark

External


Since: Apr 04, 2005
Posts: 22



(Msg. 4) Posted: Fri May 13, 2005 3:21 pm
Post subject: Re: IIS 6, old ISAPI filters [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi David...

Thanks for responding...

"David Wang [Msft]" wrote:
 > Recycling also introduces a possibility that two instances of same ISAPI
 > Filter DLL is in memory at the same time (via "overlapping recycle", where
 > the old w3wp.exe and filter DLL stays in memory until the new w3wp.exe and
 > filter DLL loads up). This is of course configurable, and the default is to
 > allow overlapping recycle.

Presumably this could be a problem if there are any persistent (disk file,
mem sections, mutexes) vestiges that the dll would be creating/deleting on
dll attach/detach? Since the new process would have it's own memory space,
any memory structures wouldn't be impacted by overlapping the startup and
shutdown...

Thanks
_mark<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: IIS 6, old ISAPI filters 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 5) Posted: Fri May 13, 2005 7:58 pm
Post subject: Re: IIS 6, old ISAPI filters [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Yes, if the filter depended on being a singleton, common problems with
overlapping recycle include:
1. system-wide Mutex or other such resources, like Named-pipes, etc
2. application Log file handle

--
//David
IIS
<a style='text-decoration: underline;' href="http://blogs.msdn.com/David.Wang" target="_blank">http://blogs.msdn.com/David.Wang</a>
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Mark" <mmodrall DeleteThis @nospam.nospam> wrote in message
news:563CD461-F2C8-44DB-A934-73D1D3D66BD6@microsoft.com...
Hi David...

Thanks for responding...

"David Wang [Msft]" wrote:
 > Recycling also introduces a possibility that two instances of same ISAPI
 > Filter DLL is in memory at the same time (via "overlapping recycle", where
 > the old w3wp.exe and filter DLL stays in memory until the new w3wp.exe and
 > filter DLL loads up). This is of course configurable, and the default is
to
 > allow overlapping recycle.

Presumably this could be a problem if there are any persistent (disk file,
mem sections, mutexes) vestiges that the dll would be creating/deleting on
dll attach/detach? Since the new process would have it's own memory space,
any memory structures wouldn't be impacted by overlapping the startup and
shutdown...

Thanks
_mark<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: IIS 6, old ISAPI filters 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]