Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BCA11184F3 for ; Tue, 24 Nov 2015 21:03:31 +0000 (UTC) Received: (qmail 94699 invoked by uid 500); 24 Nov 2015 21:03:31 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 94658 invoked by uid 500); 24 Nov 2015 21:03:31 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 94642 invoked by uid 99); 24 Nov 2015 21:03:31 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Nov 2015 21:03:31 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id E4A482E3F05; Tue, 24 Nov 2015 21:03:29 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============1966694832423073971==" MIME-Version: 1.0 Subject: Re: Review Request 40668: Produce a Warning When Jetty Pool Size Is Too Low And Increase It From: "Nate Cole" To: "Alejandro Fernandez" , "Nate Cole" , "Sid Wagle" Cc: "Ambari" , "Jonathan Hurley" Date: Tue, 24 Nov 2015 21:03:29 -0000 Message-ID: <20151124210329.26797.63868@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Nate Cole" X-ReviewGroup: Ambari X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/40668/ X-Sender: "Nate Cole" References: <20151124203802.24387.88571@reviews.apache.org> In-Reply-To: <20151124203802.24387.88571@reviews.apache.org> Reply-To: "Nate Cole" X-ReviewRequest-Repository: ambari --===============1966694832423073971== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/40668/#review107841 ----------------------------------------------------------- Ship it! Ship It! - Nate Cole On Nov. 24, 2015, 3:38 p.m., Jonathan Hurley wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/40668/ > ----------------------------------------------------------- > > (Updated Nov. 24, 2015, 3:38 p.m.) > > > Review request for Ambari, Alejandro Fernandez, Nate Cole, and Sid Wagle. > > > Bugs: AMBARI-14050 > https://issues.apache.org/jira/browse/AMBARI-14050 > > > Repository: ambari > > > Description > ------- > > Ambari's default Jetty thread pool is configured at 25 threads. When deployed on a machine that has 48 "processors", Jetty's calculation for determining how many "Acceptor" and "Selector" threads to create never takes into account the core pool size. As a result, we get: > > - 12 "Acceptor" threads (these answer binds to port 8080) > - 12 "Selector" threads (these pick available threads to answer bindings) > - 1 free thread (these are the threads available to do stuff with) > > Notice that there's only 1 free thread. This means that Jetty effectively makes Ambari a single-threaded web application on larger systems! > > The "fix" is to increase the thread count in the {{ambari.properties}}, however nobody knows to do this since no warning is produced. > > I suggest: > > - Log a warning on server startup if we detect that the core pool size is less than 3/4 of the available processors on the system. > > - Automatically increase the core pool size to the min(100, double existing size) when the above is detected > > > Diffs > ----- > > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java 56034d9 > ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariServerTest.java 621010a > > Diff: https://reviews.apache.org/r/40668/diff/ > > > Testing > ------- > > mvn clean test > > (thread dumps with simulated Runtime.getRuntime() calls) > > > Thanks, > > Jonathan Hurley > > --===============1966694832423073971==--