Devaraj K created YARN-887: ------------------------------ Summary: WebAppProxyServlet should not create HttpClient object for each request Key: YARN-887 URL: https://issues.apache.org/jira/browse/YARN-887 Project: Hadoop YARN Issue Type: Bug Components: resourcemanager Affects Versions: 3.0.0, 2.1.0-beta Reporter: Devaraj K Assignee: Devaraj K
{code:xml} private static void proxyLink(HttpServletRequest req, HttpServletResponse resp, URI link, Cookie c, String proxyHost) throws IOException { org.apache.commons.httpclient.URI uri = new org.apache.commons.httpclient.URI(link.toString(), false); HttpClientParams params = new HttpClientParams(); params.setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); params.setBooleanParameter(HttpClientParams.ALLOW_CIRCULAR_REDIRECTS, true); HttpClient client = new HttpClient(params); {code} WebAppProxyServlet is creating HttpClient object for every request. If we have multiple Jobs running with many tasks, if we want to get the report/monitor these through web, webproxy server is opening many files and it is causing too many files open error. This can be avoided by having one HttpClient object with MultiThreadedHttpConnectionManager and use the same for all requests which avoids to open many files. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira