Here is the code I'm using to create my multithreaded httpclient object. I'm trying to have a 4 second timeout across the board so if nothing happens for 4 seconds to drop the requests. I'm seeing really long execution times on some requests like in the 300 second range. I can't seem to figure out why that's happening. Any ideas?
HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, 4000);
HttpConnectionParams.setSoTimeout(httpParams, 4000);
// set request params
httpParams.setParameter("http.protocol.cookie-policy", CookiePolicy.BROWSER_COMPATIBILITY);
httpParams.setParameter("http.useragent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
httpParams.setParameter("http.protocol.wait-for-continue", 4000);
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
ClientConnectionManager cm = new ThreadSafeClientConnManager(httpParams,schemeRegistry);
HttpClient httpClient = new DefaultHttpClient(cm, httpParams);