tags:

views:

167

answers:

2

When trying to apply some heavy stress on a new web app, we were having trouble with our usual array of free tools (WAS, some other free ms tool (wcat?)), so i created a v. quick and dirty tool that would use a .net webrequest object, open up new threads, and continually hit a list urls from a file. On a single thread it produced a little load previously.

Then once i started trying to multi-thread it (once by trying a thread.start(), and then another time by calling beginrequestgets on the webrequest object), the requests did not hit the server (nothing in the iis logs, no increase in requests executing, requests/sec, etc)---unless Fiddler was on! With fiddler on, it works just as I'd expect.

I'm not especially interested in using this little application much more (will probably try to find another free web stress tool -- any recommendations?) but my main question is, why did my little app only provide stress when going through the proxy of Fiddler? Any ideas?

A: 

Could be a missing proxy setting in your app. Do you normally use a proxy server to connect to your servers that you're stressing?

Fiddler operates within the context of the logged-in user, including any proxy settings. But when coding your own WebClient/HttpWebRequest, the proxy is not automatically used-- you need to enable use of a proxy yourself, either in code or configuration.

Also could be a permissions problem, if your stressed servers (or your proxies) require authentication.

Here's some code to play around with to address both a missing proxy and lack of authentication. Note that the same code can be used against WebClient as HttpWebRequest:

WebClient wc  = new WebClient();
WebProxy wp = new WebProxy("http://myproxyserver:80/",true);
wp.UseDefaultCredentials = true;
wc.Proxy = wp;
wc.UseDefaultCredentials = true;

BTW, a tool I often use in weird situations like this is HttpWatch. It's expensive, but it is like fiddler but works as a browser plugin, meaning it will detect proxy issues and other problems which don't show up inside Fiddler. It also works nicely with HTTPS.

Justin Grant
I don't usually use a proxy server. And the application worked fine when it was single threaded.
BobC
Since Fiddler is a proxy server, clearly your app is picking up the logged-in user's proxy settings. Otherwise the app *wouldn't* work under Fiddler! :-) You may want to do some detective work in your app's configuration or code to figure out where proxy settings are being set, and experiment with different settings (e.g. UseDefaultCredentials) to see what's going on. Look at http://msdn.microsoft.com/en-us/library/fze2ytx2.aspx on MSDN for info about proxy detection and how to turn it off.
Justin Grant
A: 

You may take a look at Apache Bench. It is part of the Apache server software but ab.exe is completely standalone and you don't need to install the server. In the description it says that it is used to test the Apache Hypertext Transfer Protocol (HTTP) server but it works with any HTTP server. I've used it in multiple projects to perform stress testing and I can say that it is a great tool. As it allows posting data, it could be used to test web services as well.

Another alternative is WCAT from Microsoft.

Darin Dimitrov