I have an application that spiders websites for information. It seems like after 20-45 minutes of creating HttpWebRequests a bunch of them return timeouts. One thing we do is attach a BindIPDelegate
anonymous function to give the request a specific IP since we round-robin through about 150 IPs.
I'm setting up the HttpWebRequest
object with the following settings..
- Setting User-Agent
- Setting Keep-Alive to false so that the IP isn't re-used
- Setting TimeOut to 60000 (60 seconds)
- Setting ReadWriteTimeout to 60000 (60 seconds)
- Setting Proxy to null
- Setting Accept to /
- Setting CookieContainer to new CookieContainer
- Setting Piplined to true
- Setting Automatic Decompression to Deflate & GZIP
The application is using .NET 4.0 and running on Windows Server 2008 R2.
This definitely seems like something application/TCP/.NET related because if I restart the application it runs fine again. Also it appears more or less like the ones timing out are just queued up waiting on a local port or something.
Any ideas?