[quoted text, click to view] kebalex@gmail.com wrote:
> [...]
> I'm designing the client app to make the requests and i'm thinking
> each
> request should be asynchronous but i'm not sure this is enough. I've
> got
> no experience of multi-threaded development so i'm not sure if this
> would help (making the requests over many threads).
I would use the async APIs available (either Socket or HttpWebRequest
class, using the Begin/EndXXX methods). These will use i/o completion
ports, which implicitly use a thread pool but which don't require you to
implement threading explicitly. Use of i/o completion ports is also
required for the most scalable i/o code.
Now, use of i/o completion ports (and in .NET, implicitly via the async
API) doesn't in and of itself guarantee scalability. There can be other
problems in the code that reduce performance. And conversely, depending
on the code it may not be necessary to use i/o completion ports in order
to achieve high bandwidth.
In particular, if you've got some well-defined small amount of data to
just send repeatedly on a variety of connections, it's possible you
could handle that just fine in a single thread. Network i/o is going to
be a LOT slower than your CPU bandwidth, and once you've completely
saturated your network connection, it doesn't matter how efficient the
rest of the code is, it can't go any faster.
That said:
[quoted text, click to view] > Also I'm concerned about bottlenecks. If the app I built was capable
> of making 100000 requests a minute (possibly at the same time if its
> multi-threaded) then would the network handle this load and also
> could
> the web service handle this many requests at once (i know the W3C
> recommends only 2 client connections at once so that could be an
> issue).
It seems to me that your concerns are valid, at least to some extent.
As far as the network traffic goes, that really just depends on your
network. If you're doing this testing over a LAN, there's probably no
problem. For that matter, if you're doing it over an Internet
connection and the requests are very small, there's probably no problem.
But sure, if you're sending 100K of something out in a minute, that
something needs to be small enough to fit in your network bandwidth.
Hopefully that's the case here, but you're not specific about the size
of the requests, so it's hard to answer with a specific yes or no. As a
rough estimate, I calculate that on a relatively slow connection
(128Kbps, early-adopter cable modem upload speed), you can only do 100K
8-byte items in 60 seconds. Even a 1Mbps upload speed only gets you to
64-byte requests.
So it all depends, on your network speed and the size of the requests
(and those calculations are just rough estimates...actual network
performance and overhead does vary).
As far as the web service itself, I would be concerned as to whether you
are actually measuring what you think you're measuring. Depending on
the implementation, it could handle 100K requests from the same client
better than it can handle 100K requests from thousands of clients. So
at the very least, you may want to make sure that your client is
configured so that it _looks_ like multiple clients, from the web
service's point of view.
This sort of testing _is_ done, of course. So it's certainly possible.
You just need to be aware of the requirements for achieving the server
load you're looking for.