473,396 Members | 1,779 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,396 software developers and data experts.

Asynchronous Programming in ASP.NET

I recently read an MSDN article by Jeff Prosise titled, Scalable Apps
with Asynchronous Programming in ASP.NET
(http://msdn.microsoft.com/msdnmag/is...3/WickedCode/).

In the article, Jeff discusses scaling problems that some users
experience with ASP.NET applications. The problem, Jeff writes, isn't
that ASP.NET isn't capable of scaling; but has more to do with ASP.NET
applications that use threads inefficiently. In the article, Jeff
writes, "One solution is to increase the maximum size of the thread
pool, allowing more threads to be created." He later goes on to say,
"But increasing the thread count-or the server count-doesn't solve the
issue. It just provides temporary relief to what is in reality a design
problem-not in ASP.NET itself, but in the implementation of the actual
site."

This has become the topic of debate among other developers I know who do
not see issues with raising the number of threads in the thread pool.

What would happen if, for example, somebody were to raise the number of
available threads in the pool to something like 100 threads? What about
1,000? That should provide more than ample breathing room, but does it
have an adverse affect (besides, as Jeff writes, that it only provides
temporary relief)?

Could anybody please expand on that?

Thank you in advance,

--
Sean

website: http://senfo.blogspot.com
Apr 10 '07 #1
3 1508
Every thread that gets executed consumes resources. If you increase a
thread pool on a busys site which is maxing out at 100 threads to 1000
threads you need 10 times more processing power, 10 times more ram -
possibly ten times more worker processes per application depending on what
your app is actually doing and what each asynchronous request is actually
trying to complete. Each thread competes for resources, so you can end up
deadlocking your application. Jeff is likely implying that you cant simply
scale by adding threads and thats the end of it, you have to design scale in
and that may involve adding threads by adding physical servers into a load
balanced farm instead of overloading existing servers.
--
Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
"senfo" <en**********@yahoo.comI-WANT-NO-SPAMwrote in message
news:OL**************@TK2MSFTNGP06.phx.gbl...
>I recently read an MSDN article by Jeff Prosise titled, Scalable Apps with
Asynchronous Programming in ASP.NET
(http://msdn.microsoft.com/msdnmag/is...3/WickedCode/).

In the article, Jeff discusses scaling problems that some users experience
with ASP.NET applications. The problem, Jeff writes, isn't that ASP.NET
isn't capable of scaling; but has more to do with ASP.NET applications
that use threads inefficiently. In the article, Jeff writes, "One
solution is to increase the maximum size of the thread pool, allowing more
threads to be created." He later goes on to say, "But increasing the
thread count-or the server count-doesn't solve the issue. It just provides
temporary relief to what is in reality a design problem-not in ASP.NET
itself, but in the implementation of the actual site."

This has become the topic of debate among other developers I know who do
not see issues with raising the number of threads in the thread pool.

What would happen if, for example, somebody were to raise the number of
available threads in the pool to something like 100 threads? What about
1,000? That should provide more than ample breathing room, but does it
have an adverse affect (besides, as Jeff writes, that it only provides
temporary relief)?

Could anybody please expand on that?

Thank you in advance,

--
Sean

website: http://senfo.blogspot.com

Apr 10 '07 #2
"senfo" <en**********@yahoo.comI-WANT-NO-SPAMwrote in message
news:OL**************@TK2MSFTNGP06.phx.gbl...
>I recently read an MSDN article by Jeff Prosise titled, Scalable Apps with
Asynchronous Programming in ASP.NET
(http://msdn.microsoft.com/msdnmag/is...3/WickedCode/).

In the article, Jeff discusses scaling problems that some users experience
with ASP.NET applications. The problem, Jeff writes, isn't that ASP.NET
isn't capable of scaling; but has more to do with ASP.NET applications
that use threads inefficiently. In the article, Jeff writes, "One
solution is to increase the maximum size of the thread pool, allowing more
threads to be created." He later goes on to say, "But increasing the
thread count-or the server count-doesn't solve the issue. It just provides
temporary relief to what is in reality a design problem-not in ASP.NET
itself, but in the implementation of the actual site."

This has become the topic of debate among other developers I know who do
not see issues with raising the number of threads in the thread pool.

What would happen if, for example, somebody were to raise the number of
available threads in the pool to something like 100 threads? What about
1,000? That should provide more than ample breathing room, but does it
have an adverse affect (besides, as Jeff writes, that it only provides
temporary relief)?

Could anybody please expand on that?
To my mind, Jeff Prosise is correct here. You should first solve the
underlying problem, which is not correctly implementing asynchronous
programming in ASP.NET. Then, if you have to, increase the size of the
thread pool.

Otherwise, you're solving the wrong problem. Like adding hardware because
your software doesn't perform well.

John
Apr 10 '07 #3
In addition to what has been already recommended, one should know that the
ASP.NET framework with IIS is already optimized for maximum scalability, and
under normal conditions there is no need to monkey around with threadpool
settings. There are certain "tweaks" that you can find by reading the
whitepapers, but usually a lack of scale in an app is more due to developer
stupidity or not understanding what async pages and programming "buys you".

If you have operations in a page that can gain scale through
parallelization, async may help. Otherwise, you are ultimately still waiting
for everything until page processing can complete, which buys nothing.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"senfo" wrote:
I recently read an MSDN article by Jeff Prosise titled, Scalable Apps
with Asynchronous Programming in ASP.NET
(http://msdn.microsoft.com/msdnmag/is...3/WickedCode/).

In the article, Jeff discusses scaling problems that some users
experience with ASP.NET applications. The problem, Jeff writes, isn't
that ASP.NET isn't capable of scaling; but has more to do with ASP.NET
applications that use threads inefficiently. In the article, Jeff
writes, "One solution is to increase the maximum size of the thread
pool, allowing more threads to be created." He later goes on to say,
"But increasing the thread count-or the server count-doesn't solve the
issue. It just provides temporary relief to what is in reality a design
problem-not in ASP.NET itself, but in the implementation of the actual
site."

This has become the topic of debate among other developers I know who do
not see issues with raising the number of threads in the thread pool.

What would happen if, for example, somebody were to raise the number of
available threads in the pool to something like 100 threads? What about
1,000? That should provide more than ample breathing room, but does it
have an adverse affect (besides, as Jeff writes, that it only provides
temporary relief)?

Could anybody please expand on that?

Thank you in advance,

--
Sean

website: http://senfo.blogspot.com
Apr 10 '07 #4

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

Similar topics

6
by: ... | last post by:
Does anyone know a good tutorial on asynchronous programming in .net AsyncCallback And IASyncResult are driving me crazy. And the msdn documentation is not really helpful on this topic I...
4
by: Chris | last post by:
Hello, With asynchronous programming : Why does the callback-function (running in a worker thread) may not update the state of a control on the main-form ? The docs say that you must use a...
9
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am...
4
by: bernardpace | last post by:
Hi, I am trying to get more familiar with asynchronous programming. I was reading through the document found on the page: ...
1
by: Julian Hershel | last post by:
Reading about asynchronous programming (ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconasynchronousdesignpatterno verview.htm) I could not clarify some doubts. Hope you can help me. 1) Are...
1
by: org | last post by:
Hi, I'm developing a web service with should be used by an .NET CF2 client and an .NET 2.0 Windows client. I've tried to put all the connection logic into one class, which could be used in...
5
by: Ryan Liu | last post by:
Hi, I read Microsoft SDK, ms-help://MS.NETFrameworkSDKv1.1/cpguidenf/html/cpovrasynchronousprogramming overview.htm there are 4 ways to call EndInvoke: The code in this topic demonstrates...
3
by: =?Utf-8?B?bWs=?= | last post by:
Hi everyone, I need to refactor some of our processes using the asynchronous programming model. I have defined a couple of arrays of delegates to pipline the asynchronous invocations through...
2
by: =?Utf-8?B?U3JpcmFtIE1hbGxhanlvc3VsYQ==?= | last post by:
Hi, I was going through the article (http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/) regarding async programming in ASP.Net 2.0 but did not find much of an use with it. Actually...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.