473,403 Members | 2,284 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,403 software developers and data experts.

Fetching URLs in Parallel

Hello,

How does an application like the Web Application Stress tool work? How does
it issue requests so fast without being blocked by slow executing ones?

What technique can I use to create an object that would fetch up to 10 URLs
in parallel and be able to timeout and terminate all the requests within 1.5
seconds?

This object would be used on the server side and would be called many times
per second.

Is there a component like this for sale?

Thanks,
Arsen
Nov 16 '05 #1
14 1592
Spawn new threads based on the number of virtual users. That way no thread
blocks another. On a single machine, you can still experience some slow down
compared to multiple machines, but you are still likely to spawn more
requests than real users. Hope this helps.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
"Arsen V." <ar***@community.nospam> wrote in message
news:OB**************@TK2MSFTNGP14.phx.gbl...
Hello,

How does an application like the Web Application Stress tool work? How
does
it issue requests so fast without being blocked by slow executing ones?

What technique can I use to create an object that would fetch up to 10
URLs
in parallel and be able to timeout and terminate all the requests within
1.5
seconds?

This object would be used on the server side and would be called many
times
per second.

Is there a component like this for sale?

Thanks,
Arsen

Nov 16 '05 #2
Hi,

But how to instantenuously kill threads that are blocking after the 1.5
timeout?

Thanks,
Arsen
Nov 16 '05 #3
Have another thread kill them, after the 1.5 timeout :]

Angel
O:]
"Arsen V." <ar***@community.nospam> wrote in message
news:#m**************@TK2MSFTNGP10.phx.gbl...
Hi,

But how to instantenuously kill threads that are blocking after the 1.5
timeout?

Thanks,
Arsen

Nov 16 '05 #4
Hi Angelos,

What is the sure way to "kill" a thread even if it is currently blocking?

I know that Abort() will simply tell the thread to start terminating, but it
may not happen instantly.

Thanks,
Arsen
Nov 16 '05 #5
If you are using the WebRequest class to fetch the URLs, then the
WebRequest class has a Timeout property.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 1 Nov 2004 21:57:11 -0600, "Arsen V." <ar***@community.nospam>
wrote:
Hi,

But how to instantenuously kill threads that are blocking after the 1.5
timeout?

Thanks,
Arsen


Nov 16 '05 #6
Hi Scott,

The WebRequest's timeout property is not "instantenuous". In other words,
even if I specify timeout of 1500 milliseconds, the requests can take a long
time - 5 seconds or longer. I think this has to do with gracefully
terminating everything related to the thread. I just want to drop it if it's
taking too long.

Thanks,
Arsen
"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:qn********************************@4ax.com...
If you are using the WebRequest class to fetch the URLs, then the
WebRequest class has a Timeout property.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 1 Nov 2004 21:57:11 -0600, "Arsen V." <ar***@community.nospam>
wrote:
Hi,

But how to instantenuously kill threads that are blocking after the 1.5
timeout?

Thanks,
Arsen

Nov 16 '05 #7
We had this problem in the .NET Terrarium. If you are lullygagging in
unmanaged code somewhere, then the thread won't abort. The only
sure fire way to make this work is to kill your thread using Win32 APIs.
I don't recommend this approach unless you really need, as in our case
we did. Instead think of models where you terminate the thread and set
some state related to the thread and let it go. It'll get cleaned up later.
If it returns after 5 seconds, then who cares, it won't affect your
application when it finally does die or completes.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Arsen V." <ar***@community.nospam> wrote in message
news:uk**************@TK2MSFTNGP14.phx.gbl...
Hi Scott,

The WebRequest's timeout property is not "instantenuous". In other words,
even if I specify timeout of 1500 milliseconds, the requests can take a long
time - 5 seconds or longer. I think this has to do with gracefully
terminating everything related to the thread. I just want to drop it if it's
taking too long.

Thanks,
Arsen
"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:qn********************************@4ax.com...
If you are using the WebRequest class to fetch the URLs, then the
WebRequest class has a Timeout property.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 1 Nov 2004 21:57:11 -0600, "Arsen V." <ar***@community.nospam>
wrote:
>Hi,
>
>But how to instantenuously kill threads that are blocking after the 1.5
>timeout?
>
>Thanks,
>Arsen
>


Nov 16 '05 #8
Hi Justin,

The problem is that this component would need to be called from an ASP.NET
application getting dozens of hits per second. It would be pretty bad to
have all these "orphaned" threads executing.

Is there some .NET component that allows to fetch URLs in parallel and
control the timeout in a very precise way?

If it would be just a Windows Forms apps, I would not worry that much about
letting threads run and terminate. However, since this is going to be high
volume component I think it would cause performance problems.

What do you think?

Thanks,
Arsen
Nov 16 '05 #9
Hi Arsen:

There is no built in class to do this. Sometimes you just have to put
together a prototype and stress test it to see what works best in your
environment.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 3 Nov 2004 08:38:18 -0600, "Arsen V." <ar***@community.nospam>
wrote:
Hi Justin,

The problem is that this component would need to be called from an ASP.NET
application getting dozens of hits per second. It would be pretty bad to
have all these "orphaned" threads executing.

Is there some .NET component that allows to fetch URLs in parallel and
control the timeout in a very precise way?

If it would be just a Windows Forms apps, I would not worry that much about
letting threads run and terminate. However, since this is going to be high
volume component I think it would cause performance problems.

What do you think?

Thanks,
Arsen


Nov 16 '05 #10
I meant a thrid party component.
Nov 16 '05 #11
Hi Arsen,

I've noticed another duplicated thread in the donet.framework newsgroup,
I've posted my reply there and you may have a look there. Also, if you feel
it convenient that we contintue to discuss the problem in that thread,
please feel free to post there. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 16 '05 #12
Hi Steven,

The application must be a web ASP.NET app. It will be kind of a META-SEARCH.
It will connect to multiple sources in parallel and fetch results from each
source.

It cannot be a desktop app.

I was experimenting with using async socket communication and
ManualResetEvent with WaitAll(timeout) to guarantee a very precise timeout
control. However, I was hoping that there is a way to do this without using
sockets directly.

I also do not think that it is a good to spawn multiple threads from one
ASP.NET request. So what is the solution? Does ASYNC IO still span multiple
threads?

Thanks,
Arsen
Nov 16 '05 #13
"Arsen V." <ar***@community.nospam> wrote in message news:%2***************@TK2MSFTNGP12.phx.gbl...
I was experimenting with using async socket communication and
ManualResetEvent with WaitAll(timeout) to guarantee a very precise timeout
control. However, I was hoping that there is a way to do this without using
sockets directly.

Can't you do Async requests and accomplish the same thing with the HttpWebRequest?

I also do not think that it is a good to spawn multiple threads from one
ASP.NET request.


Why not?

--
Adam Clauss
ca*****@tamu.edu
Nov 16 '05 #14
Hi Arsen,

Thanks for your followup. Yes, of course the ASYNC APIS are based on
multi-thread internally , but the buildin apis have done much performance
optimization for us. Also, as Adam has suggested, you can consider the
WebRequest class's buildin Async request feature instead of manually build
sockets:

#Making Asynchronous Requests
http://msdn.microsoft.com/library/en...ngAsynchronous
Requests.asp?frame=true

In addition, since you're spaning multi-threads in asp.net web app to
stress test other web app, I'd recommed that you increase the
"minFreeThreads" or "minFreeLocalRequestFreeThreads" attributes setting in
the <httpRuntime> of the asp.net web app's web.config

#<httpRuntime> Element
http://msdn.microsoft.com/library/en...pRuntimeSectio
n.asp?frame=true

Also, the "maxWorkerThreads" and "maxIoThreads" in the <procesModel> ( in
machine.config for IIS5 or via Application Pool Setting in IIS6) should be
increased accordingly.

#<processModel> Element
http://msdn.microsoft.com/library/en...cessmodelsecti
on.asp?frame=true

Hope helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 16 '05 #15

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

Similar topics

6
by: Markus Franz | last post by:
Hi. How can I grab websites with a command-line python script? I want to start the script like this: ../script.py ---xxx--- http://www.address1.com http://www.address2.com...
2
by: Hans Deragon | last post by:
Greetings. I am performing: commands.getstatusoutput("rsync <params>"); rsync takes a long time and prints out a steady stream of lines showing which file it is currently working on.
10
by: Arsen V. | last post by:
Hello, Does anyone know if an object or how to create one, that will allow me to fetch up to 10 URLs (containing XML-feed data) in an extremelly fast server side fashion? If the request is...
3
by: paytam | last post by:
Hi all, Is it possible to write parallel programming in C? I mean for example a simple program like I have a clock on a program that show me current time and and at the same time another job like...
11
by: lovecreatesbeauty | last post by:
For example, line L1 and line L2 are two lines in two-dimensional space, the start-points and end-points can be described with following the `point_t' type. The start-points and end-points are:...
4
by: Soren | last post by:
Hi, I want to control some motors using the parallel port.. however, my laptop does not have any parallel ports (very few do). What I do have is a USB->Parallel converter... I thought about...
4
by: jorpheus | last post by:
OK, that sounds stupid. Anyway, I've been learning Python for some time now, and am currently having fun with the urllib and urllib2 modules, but have run into a problem(?) - is there any way to...
3
by: John | last post by:
I have a program that needs to run on a regular basis that looks at a queue table in my database. If there are items in the queue database I need to grab the data from the database and pass it to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.