473,390 Members | 1,376 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

Using application context with multi worker process setting.


I'm using the Application_Start event at Global.asax.cs to invoke
thread that do some job.
I know that Application_Start event occurs when the very first request
to Web Application received.

- Setting worker process count
1. Start | Programs | Administrative Tools | Internet Information
Services
2. Right-click on the application pool, e.g. ‘DefaultAppPool’, and
select ‘Properties’
3. In performance tab you can change the worker process count

In case of 1 worker process it works fine. Only one thread runs.

But in case of multi process. The count of thread is same as the count
of processes.
I thought that the Application_Start event occurs in every process.

Is this behavior is natural or I've been using Application_Start in
wrong way?

Thank you.

Nov 18 '08 #1
1 3416
there are 3 thing to know:

appPools host web sites.
each appPool has 1 or more worker processes that process the requests
each worker process hosts an appdomain that runs the website code.

an appdomain has a thread pool. when a request comes a thread from the
pool is used. if its the first request for the appdomain the application
start event is run. during the processing of a request, the processing
thread can be returned to pool, and another used to complete the request
(thread agility). as each appdomain is seperate memory, application
start is run to allow initialization of this memory.

if you change a file in the website, the appdomain that represents the
site is shutdown (after completing all pending requests) and a new
appdomain is started at the next request and will fire application
start. if the request comes quick enough, both domain can run at the
same time. this is why if logged you can see both start events before
the first end event

if you set up 2 worker process per appPool, then an appdomain in each
worker process will be created for each website in the pool (at when the
sites are active) and an application start will be run in each worker
processes. in this case a recycle on a busy site can could have 4
appdomains each running your background thread at the same time.

-- bruce (sqlwork.com)

nicerun wrote:
I'm using the Application_Start event at Global.asax.cs to invoke
thread that do some job.
I know that Application_Start event occurs when the very first request
to Web Application received.

- Setting worker process count
1. Start | Programs | Administrative Tools | Internet Information
Services
2. Right-click on the application pool, e.g. ‘DefaultAppPool’, and
select ‘Properties’
3. In performance tab you can change the worker process count

In case of 1 worker process it works fine. Only one thread runs.

But in case of multi process. The count of thread is same as the count
of processes.
I thought that the Application_Start event occurs in every process.

Is this behavior is natural or I've been using Application_Start in
wrong way?

Thank you.
Nov 18 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: YRao | last post by:
I am going to create intranet application using Windows Authentication using C# asp.net I am having following problem: 1 setting windows Authentication, it will validate for all users, user...
9
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
3
by: CG | last post by:
I have a VS .NET 2003 web service project which references a Managed C++ assembly. The managed C++ assembly in turn uses some unmanaged code. Because of some restriction in the unmanaged...
3
by: Danny Miller | last post by:
Hi there, I've got a web app that uses impersonation and makes calls to a SQL Server backend. I'd like to be able to automate the setting of database security for the web app upon deployment....
4
by: Frank Walsh | last post by:
Hi, I'm experiencing a problem when my asp.net 1.1 application starts. It appears that when the application has not been used for 12 hours or so...I experience a much longer load time then if...
5
by: J-T | last post by:
I guess I'm a litte bit confused about app pool and worker process. In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process...
3
by: Joe Befumo | last post by:
This is my first attempt at multi-thread programming, and I'm encountering a program-logic problem that I can't quite put my finger on. The program is pretty simple. I'm trying to validate a...
6
by: Tom wilson | last post by:
I have an asp.net app running off of a W2003 server. It's being written in VS2003. I've encountered a problem where a database record is being updated with the wrong value intermittently. So I...
3
by: Nalaka | last post by:
Hi, Can you tell me what type a things in asp.net code can crash... "application pool". Any example would do.... I was under imresiion that code cannot crash the app pool. Any direction is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.