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

Home Posts Topics Members FAQ

Making 10 POST requests from ASP.NET asynchronously

Hi all,

Is it possible to make 10 POST requests from ASP.NET asynchronously? I have
been working on this problem for a few days now, and I seem to keep running
up against IIS limitations. Basically here's the process as it works now
(synchronously) :

Person visits mywebsite.com and fills out a form
mywebsite.com POSTs one request to providerwebsite .com
mywebsite.com receives response
mywebsite.com POSTs a second request to providerwebsite .com
mywebsite.com receives response
....
mywebsite.com POSTs a tenth request to providerwebsite .com
mywebsite.com receives response

What I would like to happen is (asynchronously ):

Person visits mywebsite.com and fills out a form
mywebsite.com POSTs one request to providerwebsite .com
mywebsite.com POSTs a second request to providerwebsite .com
mywebsite.com receives a response to first request
....
mywebsite.com POSTs a tenth request to providerwebsite .com
mywebsite.com receives a response to ninth request
mywebsite.com receives a response to tenth request

The above is just an example - the responses should be able to arrive in any
order asynchronously. The problem is that each request can take up to 800
ms to respond, times 10 synchronous requests = 8 seconds... way too long...
The idea is that if I can send all ten requests asynchronously, the results
should start being returned much faster.

Is this even possible with ASP.NET and IIS?
Nov 14 '06 #1
14 2555
Have you looked up threading yet?

http://msdn2.microsoft.com/en-us/lib...hreadpool.aspx

http://msdn.microsoft.com/msdnmag/is...10/WickedCode/

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"Mike C#" <xy*@xyz.comwro te in message
news:y6******** *****@newsfe11. lga...
Hi all,

Is it possible to make 10 POST requests from ASP.NET asynchronously? I
have been working on this problem for a few days now, and I seem to keep
running up against IIS limitations. Basically here's the process as it
works now (synchronously) :

Person visits mywebsite.com and fills out a form
mywebsite.com POSTs one request to providerwebsite .com
mywebsite.com receives response
mywebsite.com POSTs a second request to providerwebsite .com
mywebsite.com receives response
...
mywebsite.com POSTs a tenth request to providerwebsite .com
mywebsite.com receives response

What I would like to happen is (asynchronously ):

Person visits mywebsite.com and fills out a form
mywebsite.com POSTs one request to providerwebsite .com
mywebsite.com POSTs a second request to providerwebsite .com
mywebsite.com receives a response to first request
...
mywebsite.com POSTs a tenth request to providerwebsite .com
mywebsite.com receives a response to ninth request
mywebsite.com receives a response to tenth request

The above is just an example - the responses should be able to arrive in
any order asynchronously. The problem is that each request can take up to
800 ms to respond, times 10 synchronous requests = 8 seconds... way too
long... The idea is that if I can send all ten requests asynchronously,
the results should start being returned much faster.

Is this even possible with ASP.NET and IIS?

Nov 14 '06 #2
If 2.0 you could also try the Async methods of the WebClient object...

AFAIK if those requests are not seen by the external server as belonging to
the same session (which is likely the case unless you do something special),
it should work. I don't think you'll have this limitation on your own server
(as your server act as a client to the external web site).

--
Patrice

"Mike C#" <xy*@xyz.coma écrit dans le message de news:
y6************* @newsfe11.lga.. .
Hi all,

Is it possible to make 10 POST requests from ASP.NET asynchronously? I
have been working on this problem for a few days now, and I seem to keep
running up against IIS limitations. Basically here's the process as it
works now (synchronously) :

Person visits mywebsite.com and fills out a form
mywebsite.com POSTs one request to providerwebsite .com
mywebsite.com receives response
mywebsite.com POSTs a second request to providerwebsite .com
mywebsite.com receives response
...
mywebsite.com POSTs a tenth request to providerwebsite .com
mywebsite.com receives response

What I would like to happen is (asynchronously ):

Person visits mywebsite.com and fills out a form
mywebsite.com POSTs one request to providerwebsite .com
mywebsite.com POSTs a second request to providerwebsite .com
mywebsite.com receives a response to first request
...
mywebsite.com POSTs a tenth request to providerwebsite .com
mywebsite.com receives a response to ninth request
mywebsite.com receives a response to tenth request

The above is just an example - the responses should be able to arrive in
any order asynchronously. The problem is that each request can take up to
800 ms to respond, times 10 synchronous requests = 8 seconds... way too
long... The idea is that if I can send all ten requests asynchronously,
the results should start being returned much faster.

Is this even possible with ASP.NET and IIS?

Nov 14 '06 #3
"Mike C#" <xy*@xyz.comwro te in message
news:y6******** *****@newsfe11. lga...
Hi all,

Is it possible to make 10 POST requests from ASP.NET asynchronously? I
have been working on this problem for a few days now, and I seem to keep
running up against IIS limitations. Basically here's the process as it
works now (synchronously) :
It is an IIS limit, as you say. It has nothing to do with ASP.NET.

The only ASP.NET relation is that you probably aren't calling Dispose on
your proxy objects, so you're not closing the connections.

John
Nov 14 '06 #4
Thus wrote Mike C#,
Hi all,

Is it possible to make 10 POST requests from ASP.NET asynchronously?
I have been working on this problem for a few days now, and I seem to
keep running up against IIS limitations. Basically here's the process
as it works now (synchronously) :

Person visits mywebsite.com and fills out a form
mywebsite.com POSTs one request to providerwebsite .com
mywebsite.com receives response
mywebsite.com POSTs a second request to providerwebsite .com
mywebsite.com receives response
...
mywebsite.com POSTs a tenth request to providerwebsite .com
mywebsite.com receives response
What I would like to happen is (asynchronously ):

Person visits mywebsite.com and fills out a form
mywebsite.com POSTs one request to providerwebsite .com
mywebsite.com POSTs a second request to providerwebsite .com
mywebsite.com receives a response to first request
...
mywebsite.com POSTs a tenth request to providerwebsite .com
mywebsite.com receives a response to ninth request
mywebsite.com receives a response to tenth request
The above is just an example - the responses should be able to arrive
in any order asynchronously. The problem is that each request can
take up to 800 ms to respond, times 10 synchronous requests = 8
seconds... way too long... The idea is that if I can send all ten
requests asynchronously, the results should start being returned much
faster.
That is not likely -- the processing time for an individual request does
not improve by a client-side optimization. If resource contention comes into
play, it may even get worse. Yet, the overall processing time for the page
that kicks off those 10 requests should be reduced unless you have a severe
bottleneck in your system (such as a deadlock).
Is this even possible with ASP.NET and IIS?
The 10 connections limitation only applies for non-server Windows versions.
It is not an IIS issue per se.

For an asynchronous implementation of your web requests, look at asynchronous
pages, a feature introduced in ASP.NET 2.0: http://msdn.microsoft.com/msdnmag/is...10/WickedCode/

Cheers,
--
Joerg Jooss
ne********@joer gjooss.de
Nov 14 '06 #5

"John Timney (MVP)" <x_****@timney. eclipse.co.ukwr ote in message
news:fY******** ************@ec lipse.net.uk...
Have you looked up threading yet?
Not only did I look it up, I implemented it two different ways and both
times it crapped out with an error code 403, subcode 9.

Nov 15 '06 #6

"Patrice" <sc****@chez.co mwrote in message
news:em******** ********@TK2MSF TNGP04.phx.gbl. ..
If 2.0 you could also try the Async methods of the WebClient object...

AFAIK if those requests are not seen by the external server as belonging
to the same session (which is likely the case unless you do something
special), it should work. I don't think you'll have this limitation on
your own server (as your server act as a client to the external web site).
1.1. Error 403.9 after 4 async requests. Thanks.
Nov 15 '06 #7
Thus sayeth Joerg Jooss,
That is not likely -- the processing time for an individual request does
not improve by a client-side optimization. If resource contention comes
into play, it may even get worse. Yet, the overall processing time for the
page that kicks off those 10 requests should be reduced unless you have a
severe bottleneck in your system (such as a deadlock).
I'm not trying to reduce the processing time for individual requests. That
is a constant I have no control over, like the speed of light. I am trying
to reduce the load time of my page by making 10 requests asynchronously
instead of 1 request...wait. ..1 response...1 request...wait. ..etc.
synchronously.
>Is this even possible with ASP.NET and IIS?

The 10 connections limitation only applies for non-server Windows
versions. It is not an IIS issue per se.
I ran into this particular problem on Windows Server 2003. I'm told by a
co-worker that there are some limitations built into the HTTP standard which
may be the root of my problem. He also suggested there is some registry
setting to get around it, but he couldn't tell me where he found this
information, so I'll keep Googling it.
For an asynchronous implementation of your web requests, look at
asynchronous pages, a feature introduced in ASP.NET 2.0:
http://msdn.microsoft.com/msdnmag/is...10/WickedCode/
2.0 is not an option right now. Thanks.
Nov 16 '06 #8

"John Saunders" <john.saunder s at trizetto.comwro te in message
news:u9******** ******@TK2MSFTN GP03.phx.gbl...
"Mike C#" <xy*@xyz.comwro te in message
news:y6******** *****@newsfe11. lga...
>Hi all,

Is it possible to make 10 POST requests from ASP.NET asynchronously? I
have been working on this problem for a few days now, and I seem to keep
running up against IIS limitations. Basically here's the process as it
works now (synchronously) :

It is an IIS limit, as you say. It has nothing to do with ASP.NET.

The only ASP.NET relation is that you probably aren't calling Dispose on
your proxy objects, so you're not closing the connections.

John
I'm properly disposing of everything, so it falls back to IIS? Thanks.
Nov 16 '06 #9
It seems like a few of us are jumping to conclusions without actually
seeing how you are attempting to enqueue the calls for async
invocation.
Mike C# wrote:
Thus sayeth Joerg Jooss,
That is not likely -- the processing time for an individual request does
not improve by a client-side optimization. If resource contention comes
into play, it may even get worse. Yet, the overall processing time for the
page that kicks off those 10 requests should be reduced unless you have a
severe bottleneck in your system (such as a deadlock).

I'm not trying to reduce the processing time for individual requests. That
is a constant I have no control over, like the speed of light. I am trying
to reduce the load time of my page by making 10 requests asynchronously
instead of 1 request...wait. ..1 response...1 request...wait. ..etc.
synchronously.
Is this even possible with ASP.NET and IIS?
The 10 connections limitation only applies for non-server Windows
versions. It is not an IIS issue per se.

I ran into this particular problem on Windows Server 2003. I'm told by a
co-worker that there are some limitations built into the HTTP standard which
may be the root of my problem. He also suggested there is some registry
setting to get around it, but he couldn't tell me where he found this
information, so I'll keep Googling it.
For an asynchronous implementation of your web requests, look at
asynchronous pages, a feature introduced in ASP.NET 2.0:
http://msdn.microsoft.com/msdnmag/is...10/WickedCode/

2.0 is not an option right now. Thanks.
Nov 16 '06 #10

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

Similar topics

4
17742
by: Fuzzyman | last post by:
In a nutshell - the question I'm asking is, how do I make a socket conenction go via a proxy server ? All our internet traffic has to go through a proxy-server at location 'dav-serv:8080' and I need to make a socket connection through it. The reason (with code example) is as follows : I am hacking "Tiny HTTP Proxy" by SUZUKI Hisao to make an http proxy that modifies URLs. I haven't got very far - having started from zero knowledge of...
1
3807
by: Brad | last post by:
A long-time JScript/IE programmer friend of mine shared a technique with me recently that puzzles me. He has a series of functions that perform POSTs, with each function returning a dummy value. He has a dummy variable in the calling code to catch it. He said that by both returning and catching this dummy value, the POSTs perform synchronously, whereas if there were no values caught in the calling code, they would perform asychronously....
2
1359
by: Christopher Benson-Manica | last post by:
Is there a more crossbrowser-friendly means to make HTTP requests using script than the XML methods? I need to do this in IE 5.0, and it doesn't seem to have the ActiveX control that can make XML HTTP requests. I hope the answer will not be to roll my own HTTP protocol handler :) -- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
2
3124
by: Robert Oschler | last post by:
I am working on a PHP 4 app that interacts with an external authorization server. The external server does "third-party" authorization of users. So I do the following: 1) Each of my PHP scripts has an include file (require_once) that checks to see if the current user has recently been authorized. 2) If not, the user is "handed off" to the external server. I do this by building the necessary URL for authorization and using refresh to...
3
2277
by: Yong | last post by:
I get a general network error when I try to make asynchronously call ExecuteNonQuery on long sql statements that run in parallel. Here is the background info on what I'm trying to accomplish: I have a sql file with two long T-SQL batches, each of which contains about 50 thousand simple insert statments into 2 non-indexed tables. Batch 1 inserts into Table 1 and batch 2 inserts into Table 2, so they can run in parallel. I parse each...
34
3707
by: Asfand Yar Qazi | last post by:
Hi, I'm creating a library where several classes are intertwined rather tightly. I'm thinking of making them all use pimpls, so that these circular dependancies can be avoided easily, and I'm thinking of making all these pimpl class declarations public. Reasoning is that since only the code within the ..cc file will need to ever access them, why protect them in ways that would make access to them more difficult and obfuscated? What...
4
4604
by: rzimerman | last post by:
I'm hoping to write a program that will read any number of urls from stdin (1 per line), download them, and process them. So far my script (below) works well for small numbers of urls. However, it does not scale to more than 200 urls or so, because it issues HTTP requests for all of the urls simultaneously, and terminates after 25 seconds. Ideally, I'd like this script to download at most 50 pages in parallel, and to time out if and only...
14
10021
by: FMDeveloper | last post by:
Currently transitioning from a shared host to a dedicated server. The same code that works on the old server is not working on the dedicated server. It is a simple AJAX request like: <code> function createXMLHttpRequest() { if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) {
3
4478
by: Phillip B Oldham | last post by:
In my attempt to learn python in a weekend, I've fallen foul at line 10 of my second scripting attempt. Basically I'm writing a simple spider, but currently I'm unable to find any documentation on making HEAD requests using the urllib2 library to test whether a file exists on a remote webserver. I've checked the docs on urllib2 from docs.python.org, and unless I'm missing something there doesn't seem to be a way to do *any* request...
0
9546
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
10260
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10243
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
10030
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9078
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...
1
7570
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
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
4146
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
2941
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.