Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More on worker process
Message
From
16/04/2011 02:55:10
 
 
To
15/04/2011 15:44:13
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01507537
Message ID:
01507567
Views:
35
>I have the application pool of the Web site set up to load four worker processes. We know that a Shared object is available to its worker process but not to another one as each worker process handles its own environment. So, for the same worker process, for all related hits, the shared object is available.
>
>Lets assume oApp is our shared object and available for a worker process. So, on the first hit of each of those four worker process instances, oApp is initialized. Then, on all related hits, no matter which worker process handles the hit, oApp is available at the worker process level handling the hit.
>
>Then, later on the application, I may have something that will trigger oApp to reload the data dictionary in memory. This is based on the Admin.DataDictionary field. When that field is updated, on the next hit, no matter which worker process it is, it knows that is has to reload the data dictionary back in memory as something changed in it. This happens very rarely. But, when it happens, the process is extremely fast.
>
>But, I have a problem with that. Here it is.
>
>I thought I had this impementation perfect but there is one more fine tuning I need to apply.
>
>Can the same worker process capable of handling two simultaneous hits or, when a hit is targeted at a worker process which is busy, it will go in a pending queue until the other hit completes? In order words, we know that the advantage of defining multiple worker processes is to gain on performance on the IIS server. So, if one worker process is handling a hit, the upcoming hit will be rerouted to another available worker process. But, if all worker processes are already busy, for the upcoming hit, can it be processed by a worker process while it processes another hit or it goes in pending queue for that same worker process until it is available to process the hit?
>
>The current scenario that I am trying to resolve is that when the data dictionary is being reloaded in memory, my NameObjectCollectionBase (oApp.Tables()) is cleared for a fraction of a second until the data dictionary is being reloaded back in it. But, very rarely, when this is happening, I may have an error in another hit for the same worker process complaining that a specific item in the NameObjectCollectionBase is not available. And, this is normal because it is being reconstructed in a simultaneous hit.
>
>If a worker process can only process one hit at a time, this would mean I should never get such an error as oApp would be re-initialized by one hit and its updated version available on the next hit in pending queue. But, I have some doubts about it. If I get that error, I would say it is because an instance of a worker process is capable of processing simultaneous hits. If that is true, in my data class, I would have to verify for the oApp.lInitialize flag before proceeding as this flag is set to False when the data dictionary is being reloaded in memory and set to True when it completes.
>
>Can someone confirm me that a worker process is able to handle simultaneous hits? If that is not the case, then I have a real mystery here.

I see you've discovered that each WP is multi-threaded. The simplest way of avoiding the dictionary rebuild problem might be to put a lock around it.....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform