Trying to Run Multiple Http Requests in Parallel, But Being Limited by Windows (Registry)

Trying to run multiple HTTP requests in parallel, but being limited by Windows (registry)

It is matter of ServicePoint. Which provides connection management for HTTP connections.
The default maximum number of concurrent connections allowed by a ServicePoint object is 2.
So if you need to increase it you can use ServicePointManager.DefaultConnectionLimit property. Just check the link in MSDN there you can see a sample. And set the value you need.

Need to Run multiple HTTP Web Request in Parallel to a Web Service through another Web Service

Just a thought Guys , can I put it in the
protected void Application_Start(Object sender, EventArgs e){} ?

Or is there something else that calls the Application_Start().

is there anyway that I can determine the Starting Point of this WebService ? (From project properties or is it something default in WebServices ?)

Windows Phone, Multiple HTTP request parallel, how many?


How can I improve this to make multiple request in parallel?

You can do the parallel processing like below (untested). It uses SemaphoreSlim to throttle getDetails requests.

async Task ProcessPlanes()
{
const int MAX_REQUESTS = 50;

List<plane> planes = await planeService.getPlanes(); // Get all planes from web api

var semaphore = new SemaphoreSlim(MAX_REQUESTS);

Func<string, Task<Details>> getDetailsAsync = async (id) =>
{
await semaphore.WaitAsync();
try
{
var details = await planeService.getDetails(id);
drawDetails(details);
return details;
}
finally
{
semaphore.Release();
}
};

var tasks = planes.Select((plane) =>
getDetailsAsync(plane.id));

await Task.WhenAll(tasks.ToArray());
}

what is resonable number of request running parallel? The planes list
can be anything from 0 to 100 objects, typically max 20.

It largely dependents on the server, but I don't think there's an ultimate answer to this. For example, check this question:

A reasonable number of simultaneous, asynchronous ajax requests

As far as the WP8 client goes, I believe it can spawn 100 parallel requests without a problem.

Why won't my .net app make more than 10 concurrent WebClient requests?

You client is able to send arbitrarily many concurrent requests. Your server, though, is localhost. Client Windows OS's have a limitation on the number of concurrent requests in web applications (so that you have to buy a server license). This limit is 10. You can't do anything about it.

Btw, your app is using async IO so you don't need any threads (not even implicit thread-pool threads) while the IO is running. This is not your problem.

Is it possible to initiate multiple parallel http requests using EventMachine with Ruby 1.8

Have a look at em-http-request:

EM.run do
http1 = EventMachine::HttpRequest.new('http://example.com/1').get
http1.callback do
p http1.response
end
http2 = EventMachine::HttpRequest.new('http://example.com/2').get
http2.callback do
p http2.response
end
end

Spyne receiving multiple requests

You mean you can't get Spyne to be concurrent? That has nothing to do with Spyne, it's the transport's job to implement concurrency.

I assume you refer to the examples that use wsgiref, the reference WSGI implementation, which doesn't support concurrency. Good news is, Spyne can be and is being used as concurrently as any Python daemon can be.

You can use twisted in async mode with TwistedWebResource or in sync mode with WSGIApplication. You can find the relevant examples in examples/twisted directory in resource.py and wsgi.py respectively.

If twisted scares you (For some reason, it's got a totally baseless "not for the faint-hearted" kind of reputation) you can use cherrypy. I just put a cherrypy wsgi example in examples/cherry directory.

Executing multiple PHP scripts in parallel, and being notified when finished

You should investigate the pcntl_fork and related functions. This allows one master process to form a number of child processes and be notified of child exit status.

http://php.net/manual/en/function.pcntl-fork.php



Related Topics



Leave a reply



Submit