.NET WebBrowser control under load testing

Hi,

I have written a library that takes a URL as an input and returns the HTML for the url. I have used the .NET webbrowser control inside a form to achieve the same. Now the problem is the .NET web browser control is not scaling up when the number of concurent user of the library increases. The response time (to get the HTML) increases drastically if a step load up to 500 users is applied.

Also note that i am launching the webbrowser control in a separate STA thread as soon as a request comes.

Are their any guidelines on how to use the webbrowser control so that it scales up well?

I will really appreciate any help regarding this.

Thanks,

Yash

[695 byte] By [YashPurohit] at [2007-12-23]
# 1

Hi,

if you're using WebBrowser control just to retrieve the web site's Html, why not use HttpWebRequest for this? Like:

HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
using (Stream
stream = request.GetResponse().GetResponseStream())
{
using (StreamReader reader = new StreamReader
(stream))
{
string
response = reader.ReadToEnd();
}
}

Andrej

AndrejTozon at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2
You

might be re-inventing the IIS wheel. It was heavily optimized to

handle a large number of concurrent requests. The original design

of the WebBrowser control had no such requirements...

nobugz at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 3

Sorry for getting late on this(Out of station),

I want to load the HTML in the browser control so that it gets rendered. This is a requirement and i cant do much here.

Thats why i am using a form as a container.

Problem still remains the same that the whole app is not scaling under high user load.

Thanks,

Yash

YashPurohit at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 4
By rendering you mean the page is using some javascript to change the content ?

If not then, webrequest should be able to handle it.

Since each web browser control is a new GUI window, it is resource hungry. I guess that is causing the slowdown. You are using threads to make the requests parallel right ?

ShishirChoudhary at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...