Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Server Unloading After Every Hit

$
0
0
Re: Server Unloading After Every Hit
Web Connection
Re: Server Unloading After Every Hit
Jan. 22, 2013
01:10 pm
3P50S9AKAShow this entire thread in new window
Gratar Image based on email address
From:Kirk Allen
To:Rick Strahl
Yeah, I don't get the dual loading either. And unfortunately I broke the cardinal rule of troubleshooting.... I changed several things at once so I'm not even sure how I fixed it.

It's stable now, and working as expected, so thanks!

Kirk



If you are using both isapi and .net handlers you will get two sets of com objects running one for each messaging mechanism. So, no you should never mix isapi and .net modules in your script maps - use one or the other.

That doesn't explain the dual loading on load server though... But it would definitely account for extra instances when running admin and app links.

+++ Rick ---


...And now it works!

So, I think I figured out part of the problem. In my web.config file I was using the ISAPI script mapping for my server, and the Managed Handler for the Admin (.wc) functions:

<handlers><addname="mi wc script map" path="*.mi" verb="*" modules="IsapiModule" scriptProcessor="d:\Merchinfo\bin\wc.dll" resourceType="Unspecified" /><addname="wc web connection handler" path="*.wc" verb="*" type="Westwind.WebConnection.WebConnectionHandler" resourceType="Unspecified" preCondition="integratedMode" /></handlers>


Is it possible that the two different methods weren't "talking" to each other? In other words, the Admin page never "saw" the servers started from a hit to the site (which invoked the ISAPI script mapping) and so would try to load it's own servers, and vice versa.


I changed the .wc to a script map and now it works:

<handlers><addname="mi admin script main" path="*.wc" verb="*" modules="IsapiModule" scriptProcessor="d:\merchinfo\bin\wc.dll" resourceType="Unspecified" /><addname="mi wc script map" path="*.mi" verb="*" modules="IsapiModule" scriptProcessor="d:\merchinfo\bin\wc.dll" resourceType="Unspecified" /></handlers>


So, is it safe to say that you can't use ISAPI script mapping and the managed handler in the same site?



Kirk,

I've seen the unload/reload behavior myself, and I think I know why that's happening. But I've never seen the unloading then reloading after the initial servers have been loaded...

The load/unload twice scenario happens because IIS effectively sends a 401 Authorization request server followed by an automatic logon request - resulting in two consecutive requests that actually succeed and go through the pipeline. Because Load first unloads, then reloads servers you see the servers flickering up and down as you describe. There's not much I can do about that unfortunately because the check atually goes through in the initial 401 authentication request and then fires again. I think this is made worse when you use Windows authentication - with basic authentication this problem is not as pronounced (although I've seen it happen there too).

In any case this double loading shouldn't really have any adverse effects - once the servers load up processing should be just fine... if your servers were running invisibly (ie. not using INTERACTIVE COM impersonation) you'd never know :-)

+++ Rick ---


No, I never called the DLL directly. I was referring to the Web Connection .Net Handler. I was trying to use that at first, and the weird loading and unloading was happening. Then I switched to the "old" ISAPI method of script maps, which appeared to work at first, but now even that's not working.

There must be some corruption, because now when I load the servers from the Admin page, they load, unload and then re-load. I then have 2 copies of my server running (which is what is specified in my web.config file). Then, on my first hit to the actual site both servers UNLOAD, then only one copy re-loads. So now there's only ONE server running. Then, on the next hit, a SECOND server loads and stays loaded. After that, I have two servers running, and the site works as expected.

Maybe my IIS is hosed?

Here's my web.config file, in case it helps.

<?xmlversion="1.0" encoding="UTF-8"?><configuration><configSections><sectionname="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /><sectionname="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /></configSections><system.webServer><handlers><addname="mi wc script map" path="*.mi" verb="*" modules="IsapiModule" scriptProcessor="d:\Merchinfo\bin\wc.dll" resourceType="Unspecified" /><addname="wc web connection handler" path="*.wc" verb="*" type="Westwind.WebConnection.WebConnectionHandler" resourceType="Unspecified" preCondition="integratedMode" /></handlers><defaultDocument><files><clear /><addvalue="index.html" /><addvalue="Default.htm" /><addvalue="Default.asp" /><addvalue="index.htm" /><addvalue="iisstart.htm" /><addvalue="default.aspx" /></files></defaultDocument></system.webServer><webConnectionConfiguration><addkey="Timeout" value="60" /><addkey="PostBufferLimit" value="0" /><addkey="TempPath" value="c:\temp\wc\" /><addkey="TempFilePrefix" value="WC_" /><addkey="MessagingMechanism" value="Com" /><addkey="UseCustomManifestLoading" value="False" /><addkey="AdminAccount" value="ANY" /><addkey="AuthenticationMode" value="Default" /><addkey="AdminPage" value="~/admin/admin.asp" /><addkey="ExeFile" value="d:\merchinfo\bin\merchinfo.exe" /><addkey="UpdateFile" value="d:\temp\wc\merchinfo.exe" /><addkey="LogDetail" value="True" /><addkey="ValidateRequest" value="False" /><addkey="ComServerProgId" value="merchinfo.merchinfoServer" /><addkey="ServerCount" value="2" /><addkey="AutoStartServers" value="False" /><addkey="ComServerLoadingMode" value="RoundRobin" /><addkey="PassAspNetContext" value="False" /><addkey="MessageDisplayFooter" value="Page generated by Web Connection IIS Connector Module" /></webConnectionConfiguration><webConnectionErrorPages><addkey="Exception" value="" /><addkey="OleError" value="" /><addkey="Timeout" value="" /><addkey="NoOutput" value="" /><addkey="Busy" value="" /><addkey="Maintenance" value="" /><addkey="InvalidRequestId" value="" /><addkey="TranmitFileFailure" value="" /><addkey="PostBufferSize" value="" /></webConnectionErrorPages></configuration>

Thanks!


Hi Kirk,

When you say handler mapping - what were you doing before? You were calling the DLL directly? If that's the case - yes that's not recommended on IIS 7 because .dll is not allowed in the bin folder by default and restricted. But if it worked at all I'm not sure why it would have forced reloading of servers - functionally the code executing is identical unless IIS is doing something strange.

We strongly recommend script map use (ie. NOT using wc.dll calls) for a variety of reasons. It's fairly straight forward to switch to scriptmaps if nothing else than switching all wc.dll urls to wc.wc wholesale. So if that works that's the best solution anyway.


+++ Rick ---



I checked and the COM server is SingleUse, and I was able to keep it alive by instantiating from VFP. I'm at a loss...

Just for fun, I re-defined the handler mappings and used script maps instead of the Handler, and now it works. The servers load and stay loaded. So it looks like a problem with the Handler or my configuration of it.

Does that help diagnose? The site is up and running, but I really wanted to get away from script maps and use the new Handler, so any help would be great!

Thanks,
Kirk


Are you sure your COM server is compiled as SingleUse not MultiUse in the COM properties of the project?

Otherwise I'm not sure. Make sure you can instantiate the server from FoxPro or VBScript as shown in the manual and that it does stay alive as long as you hold a reference to it. I don't see why that wouldn't happen but it always helps to confirm.

+++ Rick ---


Hello.
I'm in the process of migrating an application from 4.xx to 5.65 and from Win2003 to Win2008, and I've run into a snag. I have the app running in COM mode, but on each hit the servers load and then unload. So, in other words, there are no servers loaded, a hit comes in, the servers load (I have 2 copies running), they process the hit, and then they unload. This happens on every hit.

And, I don't think it's a problem with my COM exe specifically, because the same weird behavior happens when i try to load the servers from the admin console. I click "Load Servers", The servers load, then they unload, and then they load and stay loaded (until the next hit).

I've searched this site and the help file and can't find any reference to a problem like this...

Here's my setup info:

Windows 2008, 32-bit
Web Connection 5.65
Managed Handler


Thanks!
Kirk











Viewing all articles
Browse latest Browse all 10393

Trending Articles