Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 97394200C36 for ; Fri, 10 Mar 2017 19:09:02 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 95BE9160B79; Fri, 10 Mar 2017 18:09:02 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3D366160B67 for ; Fri, 10 Mar 2017 19:09:01 +0100 (CET) Received: (qmail 69546 invoked by uid 500); 10 Mar 2017 18:08:59 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 69535 invoked by uid 99); 10 Mar 2017 18:08:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Mar 2017 18:08:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 61BFDC0376 for ; Fri, 10 Mar 2017 18:08:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.799 X-Spam-Level: * X-Spam-Status: No, score=1.799 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, SPF_HELO_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id XxxqZVG1kn-A for ; Fri, 10 Mar 2017 18:08:57 +0000 (UTC) Received: from mailbox.servedge.com (72.103.82.208.static.ipv4.dnsptr.net [208.82.103.72]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D1A725F252 for ; Fri, 10 Mar 2017 18:08:56 +0000 (UTC) Received: (qmail 32324 invoked by uid 513); 10 Mar 2017 12:08:47 -0600 Received: from pool-173-66-116-184.washdc.fios.verizon.net (HELO Christophers-iMac.local) (chris@christopherschultz.net@173.66.116.184) by mailbox.servedge.com with AES128-SHA encrypted SMTP; 10 Mar 2017 12:08:47 -0600 Subject: Re: JMX currentThreadsBusy less than connections/requests when use APR connector To: Tomcat Users List References: <1c290253-9188-cace-c174-4787e59c2c78@christopherschultz.net> From: Christopher Schultz Message-ID: <4fbc89ce-aa55-81b8-7617-acb511aaa951@christopherschultz.net> Date: Fri, 10 Mar 2017 13:08:47 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit archived-at: Fri, 10 Mar 2017 18:09:02 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Linbo, On 3/9/17 7:31 PM, linbo liao wrote: > 1、The load-generating vm has 2 cores. With only 2 cores, you can only actually do 2 things at once. Perhaps you need more load-generating computers. > 2、Can I use currentThreadsBusy to monitor the performance of Tomcat > using APR connector? Yes, you can use that with any connector. The threads are Java threads. Only the underlying file descriptors are being managed by APR versus Java's BIO/NIO/2 stream managers. - -chris > 2017-03-10 0:42 GMT+08:00 Christopher Schultz > : > > Linbo, > > On 3/8/17 8:13 PM, linbo liao wrote: >>>> Here is the Connector configuration: >>>> >>>> >>> protocol="org.apache.coyote.http11.Http11AprProtocol" >>>> maxHttpHeaderSize="8192" maxThreads="400" >>>> acceptorThreadCount="4" maxKeepAliveRequests="-1" >>>> enableLookups="false" disableUploadTimeout="true" >>>> connectionTimeout="20000" /> >>>> >>>> I use wrk, the currentThreadsBusy is higher than the value in >>>> ab testing, but most of time is less than 40. >>>> >>>> ./wrk -t100 -c 100 -d 10s http://10.211.55.4:8080/ > > I've never used wrk. How many CPU cores does your load-generating > computer have? > >>>> For APR connector, will it get one thread from the poll to >>>> deal with each request? > > For both NIO/2 and APR, you'll have one accepter thread (4 in your > case) and one poller thread for many (400 in your case) > request-processing threads. > > It's possible that your server is handling the requests fast > enough that they never pile-up enough to use more than 40 threads. > > Congratulations: you can handle the load you are putting on the > server. :) > > -chris > >>>> 2017-03-08 22:45 GMT+08:00 Christopher Schultz >>>> >>>> : >>>> >>>> Linbo, >>>> >>>> On 3/7/17 10:14 PM, linbo liao wrote: >>>>>>> I setup local environment to test Tomcat monitor. >>>>>>> >>>>>>> The Environment: >>>>>>> >>>>>>> Tomcat: 8.5.5 VM: Ubuntu 14.04.1 LTS HTTP PORT: 8080 >>>>>>> IP: 10.211.55.4 >>>>>>> >>>>>>> Tomcat use APR connector, I test the tomcat via ab >>>>>>> command, find JMX currentThreadsBusy < 10 all of the >>>>>>> time. >>>>>>> >>>>>>> ab -n 100000 -c 100 10.211.55.4:8080/ >>>>>>>> >>>>>>> >>>>>>> I tried to search the reason but without the result. >>>>>>> For BIO each thread to handle one connection, so >>>>>>> currentThreadsBusy can show the performance of tomcat. >>>>>>> >>>>>>> But for APR connector, what's the meaning of >>>>>>> currentThreadsBusy? >>>> >>>> Please post your configuration. >>>> >>>> It seems that ab isn't a very good load-generator for >>>> several reasons. But you should be able to get more than Java >>>> 10 threads working at a tim e. >>>> >>>> You are probably expecting ~100 threads busy at all times, >>>> right? >>>> >>>> -chris >>>>> >>>>> ------------------------------------------------------------------ - --- >>>>> >>>>> > >>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >>>>> For additional commands, e-mail: >>>>> users-help@tomcat.apache.org >>>>> >>>>> >>>> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >> For additional commands, e-mail: users-help@tomcat.apache.org >> >> > -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJYwuuvAAoJEBzwKT+lPKRYfCUP/1OEAoFvKMAY2Rmh9X0Gy+WN ZIfnZOOUnC3onnEpgCGxucxXzfkf9jGljhIIqr+mXYu1urbhpgUaoGXT8CS7S4bn SSE7GSQwaQ0dyqdzhc4F2/4LzMZ1J1u+Jakn/uQhlDv4eIrYMo4tNVGEaGdVA7jo hU6Auy4ATY5NW/0zeefnukq8fp+CyyMGPESJGsCDL5czVjZ8zXyHo/4Px2kGyryt 7GM/R+8RpapnrA3WFQs65MTMn7cQAbAZOSgvzUfCC6VQicn/rMuND07OgN7I4MUG soEpRDjwY/41ynEUL5wID6uHsWJ9KrRldybhSQzwpI3FVNPHDCe3hRxNWPN0eULT /u8fCK2jyswscRqfTuk1NKEQGJ4XQqMVo+Y0cJ9BAncUPA5OUN2zD/DLnIa06yLv OXs3HjyFgwwEN9wMBxQyMedam5BkcjzjD6A5zdIV0isHyROa3idVl3B8HYyslhk5 seLlCPOehr2MJsluzZjiciv4estnUf2Dm43aTc8c/1I12AMmLudAxkbGB5a4bkUt mb4LXpV+pPuQ/rdWrBAuyvfAXYvlgjKmcWrKltrpzFuTU+VLW8GC/1IsLwYlDcpW oilPZtfKEUp1hnsT8bKC1pywT3lX5MYT4acxbXcOAw1cSY+ocwPmum4J3NKBfcQP mR5U4hKAZ926OQYwC/f6 =E3ng -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org