Upul Bandara
Upul Bandara

Reputation: 5958

Can I Open Multiple Connections to a HTTP Server?

I’m writing a small software component in order to download resources from a web Server (IIS).

But it seems like that system's performance is not acceptable. Now I’m planning to increase the number of connection to the web server by spawning multiple threads.

My question is, can I improve performance by using multiple threads? More over dose web server allow me to spawning several simultaneous connections?

Thanks

Upul

Upvotes: 3

Views: 2531

Answers (2)

thomasrutter
thomasrutter

Reputation: 117363

All properly configured web servers should be able to handle multiple connections from the same source. This allows, for example, a browser to download two images from a page at once.

Some servers may place an upper limit on the number of concurrent connections it will accept from one client, but this will usually be a high number. Using up to 6 connections is normally safe.

As for whether it will actually improve performance, that depends on your situation. If you have a very fast connection to an internet backbone, and find that the speed you are getting from the remote server is not taking advantage of the speed of your connection, then in many situations multithreading can improve speed. If the speed is already maxing out the speed of your connection to the internet, or the connection of the remote server, then it can't do anything.

Upvotes: 3

Tushar Tarkas
Tushar Tarkas

Reputation: 1612

Web servers are do allow simultaneous connections. There should not be any problem in opening one's unless the application logic prevents opening multiple connections for same client. To further clarify my point, if you require login before downloading resources and your application does not allow multiple simultaneous logins, then you will get stuck there. There are applications which do not allow lot of connections from same source for security reasons.

Upvotes: 2

Related Questions