2

I have a web app that allows you to paste a large number of urls in (anywhere from 2000 - 15000), it then visits each page to download the source and do some processing.

I've tried a couple methods, currently it uses ajax to send each url one at a time to a WebMethod which then uses ThreadPool.QueueUserWorkItem to push the request onto a queue and do the processing when it can so that many threads are running at the same time. This seems to cause problem (the Visual Studio web server dies occasionally which can't be good).

Just wondering if anyones done anything similar, knows a better way. I guess being able to throttle the number of concurrent threads somehow would help.

Thanks

1
  • Cassini is not meant to handle this kind of load. You should use it for what it is for. Commented Jan 13, 2012 at 21:08

2 Answers 2

2

Don't use the built in webserver. Use IIS proper

Sign up to request clarification or add additional context in comments.

2 Comments

I was going to change it (still will), but figured it's probably more to do with the amount of work it is doing in one go rather than the webserver?
My guess is it is the webserver .... check this out developer.com/net/… It is relatively easy to try setting it up with IIS7.5 Express and try it. Also what kind of processing is it doing? If you are doing multi-threading stuff perhaps you are running into deadlocks and such, not sure how much you know on that topic or precisely what you are doing so here's a link msdn.microsoft.com/en-us/magazine/cc163618.aspx
1

Along with using IIS as mentioned above, you might benefit from using asynchronous web requests. (See How to use HttpWebRequest (.NET) asynchronously? for more info.)

This will prevent the amount of blocking done on each thread, which should reduce the number of threads needed if your processing isn't too heavy.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.