473,799 Members | 3,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sleeping Thread - impact on web site

We are building a public web application that calls a web service on an
internal box. The web service runs for 5-10 minutes, does some heavy
processing, and writes to a database when it is complete. The current design
calls for having the web application's thread sleep for 10 seconds, then
check the database to see if the web service is complete. If the database
claims the web service has completed, it then displays the results from the
database.

There are a number of ways to solve this problem, but I'm wondering what the
true impact of having the thread sleep on overall performance and
availability of our production web server that hosts many other
applications. Obiviously the thread isn't doing anything, but it still is
tying up a thread. Is this a big deal? Is there a way to quantify or
measure its impact and/or determine how far it would scale?

Thanks in advance.

Mark
Feb 2 '07 #1
2 2615
Web Application threads are limited in quantity. I think by default there
are only 100 of them per processor.
If there are more calls than that ASP.NET throws "Server Busy" error.

So if you hanging those threads for 5-10 minutes you have pretty good
chances to run out of them very fast.
-----------------------------------------------------
I would recommend pulling. The client (browser) shows "Processing.... ." and
refreshes screen very second or so. As soon as database shows that request
was processed it redirects to normal page.

It's easy to do with Ajax method then client will not even see browser
refreshing.
George.


"Mark" <ma*********@no spam.nospamwrot e in message
news:u6******** ******@TK2MSFTN GP04.phx.gbl...
We are building a public web application that calls a web service on an
internal box. The web service runs for 5-10 minutes, does some heavy
processing, and writes to a database when it is complete. The current
design calls for having the web application's thread sleep for 10 seconds,
then check the database to see if the web service is complete. If the
database claims the web service has completed, it then displays the
results from the database.

There are a number of ways to solve this problem, but I'm wondering what
the true impact of having the thread sleep on overall performance and
availability of our production web server that hosts many other
applications. Obiviously the thread isn't doing anything, but it still is
tying up a thread. Is this a big deal? Is there a way to quantify or
measure its impact and/or determine how far it would scale?

Thanks in advance.

Mark

Feb 2 '07 #2
Very simply, a sleeping thread means it is tied up and unable to service
other requests, so yes there will certainly be an impact.
Have you looked into using the asynchronous versions of your WebMethods
(e.g. BeginXXX / EndXXX) ?
Peter

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


"Mark" wrote:
We are building a public web application that calls a web service on an
internal box. The web service runs for 5-10 minutes, does some heavy
processing, and writes to a database when it is complete. The current design
calls for having the web application's thread sleep for 10 seconds, then
check the database to see if the web service is complete. If the database
claims the web service has completed, it then displays the results from the
database.

There are a number of ways to solve this problem, but I'm wondering what the
true impact of having the thread sleep on overall performance and
availability of our production web server that hosts many other
applications. Obiviously the thread isn't doing anything, but it still is
tying up a thread. Is this a big deal? Is there a way to quantify or
measure its impact and/or determine how far it would scale?

Thanks in advance.

Mark
Feb 2 '07 #3

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

Similar topics

0
1359
by: D. Niemeyer | last post by:
Hello All, Currently we are running MySQL 4.0.17-nt on a Server 2003 machine. I am having a problem with connections hanging around in a sleep state, and building up over time. Eventually websites start returning a "No More Connections" error. Our websites are ASP.NET, and we are using the CoreLab MySQLDirect.NET component for the .NET interface. Our code opens and closes each connection explicitly using that API, but occasionally...
1
1711
by: COMfused | last post by:
I have a thread that has a delegate function which will be called when another process exits. This thread went to sleep, the process exits and is supposed to call the delegate, but it did not happen. When the thread wake up, the function is not called either. The question is, will a thread ignore all the callback when it is sleeping?
4
6597
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times. There is no consistency when it fails. Could anyone here shed some light on how to debug/resolve the issue. I guess IBM looked at the issue and were not able to pinpoint where the issue is. When the program hangs and when force the DB2...
16
2052
by: Alvin Bruney | last post by:
I'm observing that a sleeping thread changes to stopped after a while. Is that accepted framework behavior for web applications? My thread basically does some work, and sleeps for 60 minutes before calling itself recursively, which means it is supposed to run on the hour every hour. But it automatically stops after 2 hours. I only get 2 emails, 1 per hour and then nothing. When I examine the threadstate during run-time, it has changed...
4
3238
by: cmay | last post by:
Can someone give me some guidance on this? I am implementing a system where if a user fails the login, I am doing a thread.sleep(random number). If I returned the page right away, you could write a script to try many username/password combos per second. Using this, it will slow down the person by making them wait at least a few seconds for a bad username/password.
17
5673
by: Benny Raymond | last post by:
I have a thread that sleeps for 5 minutes once it's finished running a method and then it repeats itself if it's supposed to (bool = true). Prior to 2.0 I was able to resume the thread after marking the bool to false which would cause the thread to finish what it was doing and complete, or to wake up for it's sleep state and not loop back into itself anymore. How do we tell a thread to stop sleeping now that Thread.Resume is obsolete?
14
2121
by: OlafMeding | last post by:
Below are 2 files. The first is a Python program that isolates the problem within less than 1 hour (often just a few minutes). The second is a C++ program that shows that the Win32 Sleep() function works as expected (ran from Friday afternoon until Monday morning). Note, the Python programs hangs (stops responding) with hyper-threading turned on (a BIOS setting), but works as expected with hyper-threading turned off. This problem...
5
6457
by: many_years_after | last post by:
Hi, pythoners: There is a problem I couldn't dispose. I start a thread in the my program. The thread will do something before executing time.sleep(). When the user give a signal to the main thread (such as click the 'end' button or close the window), the thread should end it's running. But how to end the threading when it's sleeping? I set an flag to the thread, but it doesn't work. I also thought to put 'time.sleep()' to the main...
0
2794
by: TeenaRoz | last post by:
Hi, Can some one help me in finding out why this exception occurs when ever I try to load a particular JSP page? Oct 29, 2008 4:23:54 AM org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already (the eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and...
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9538
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10470
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10214
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9067
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2935
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.