You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Anthony Biacco <ab...@handll.com> on 2016/05/26 20:19:15 UTC

minSpareThreads for AJP connector

I have this property set under 8.0.35, but it only hits the value I set
when i make that many requests.
Should it not allocate threads of the value I set on startup?

Thanks,

-Tony

Re: minSpareThreads for AJP connector

Posted by Anthony Biacco <ab...@handll.com>.
On Tue, May 31, 2016 at 11:44 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Anthony,
>
> On 5/27/16 3:54 PM, Anthony Biacco wrote:
> > On Fri, May 27, 2016 at 7:34 AM, Christopher Schultz <
> > chris@christopherschultz.net> wrote:
> >
> > Tony,
> >
> > On 5/26/16 4:22 PM, Anthony Biacco wrote:
> >>>> On Thu, May 26, 2016 at 2:19 PM, Anthony Biacco
> >>>> <ab...@handll.com> wrote:
> >>>>
> >>>>> I have this property set under 8.0.35, but it only hits the
> >>>>> value I set when i make that many requests. Should it not
> >>>>> allocate threads of the value I set on startup?
> >>>>>
> >>>>>
> >>>> btw, i'm using org.apache.coyote.ajp.AjpNioProtocol
> >
> > Can you post your complete Connector configuration?
> >
> >
> >> Sure..
> >
> >> <Connector port="8009"
> >> protocol="org.apache.coyote.ajp.AjpNioProtocol" maxThreads="400"
> >> backlog="25" maxPostSize="4194304" enableLookups="false"
> >> connectionTimeout="120000" keepAliveTimeout="10000"
> >> redirectPort="8443" acceptorThreadCount="2"
> >> pollerThreadCount="2" processorCache="400" minSpareThreads="25"
> >> useComet="false" />
>
> You should:
>
> 1. Use an <Executor> instead of specifying your threading config in
> <Connector>
> 2. Set prestartminSpareThreads="true" on your <Executor>
>
> I think you'll get the behavior you are expecting.
>
>
i'll try that out. thanks chris

-Tony


> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJXTc1tAAoJEBzwKT+lPKRYMpsQAIm5jmGuNFEbhQOLqQYWvquy
> WglEnM4QGsquyAU5Mfb5qsds9uu7f81c0CIw7M1fT76kvC8xC9aaTxAk8qSG+TTR
> FN+UiNr91IfyKHdq/qoOjxHbtISLhlE1IA7/Z3AQdtZ+Rvf3TioFULEVgZryt9Wo
> e1GioN5plkkYJlf4dxYpBXpfProuwsKDMsmISXAjPSZM8IzYggO2axBoKxIx2JHL
> /rkY6zZPhgaf6NWhEoFB0a/+Pfbug5eodPS93ph57BYxHOCCfGiRQ9kpua/k9rIh
> OKauwZefuSV2MxtMr40A6ckfMSkeW/4fq73JSvZFuGiTe7Yuij85lIPR9s7BCaON
> XH/tMJScecTcmREN5Ki+GMGfnssihlfUu78zw/DVFlIwkZQIoG7VqBUBVKJ6pboo
> AJjzZGkogskEK/ailaeRY/jITNfsGbxVHxE7qqhOaBOfWXRipxHeu4e08FFToLxv
> OWgUmcyB4bOzz8d3XXbl/NtIyY4wNl0SNywalW527r/uv86cUTtBBKEuMmJXVjt5
> Z7MLigAk5SvPaUtv2iP2ddmp1GTxcUXbjUJrpM20pKlyPum1bUysxX4I3mwdYNJ4
> EboTSZeiDq/eCbutoKb8Gk8yZ8c35/3utqmp88xNksmGrDxy17WplUf4tvcWhX/f
> Kb+DU9C1eBH78TNfhjKP
> =NNCM
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: minSpareThreads for AJP connector

Posted by Anthony Biacco <ab...@handll.com>.
On Tue, May 31, 2016 at 11:44 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Anthony,
>
> On 5/27/16 3:54 PM, Anthony Biacco wrote:
> > On Fri, May 27, 2016 at 7:34 AM, Christopher Schultz <
> > chris@christopherschultz.net> wrote:
> >
> > Tony,
> >
> > On 5/26/16 4:22 PM, Anthony Biacco wrote:
> >>>> On Thu, May 26, 2016 at 2:19 PM, Anthony Biacco
> >>>> <ab...@handll.com> wrote:
> >>>>
> >>>>> I have this property set under 8.0.35, but it only hits the
> >>>>> value I set when i make that many requests. Should it not
> >>>>> allocate threads of the value I set on startup?
> >>>>>
> >>>>>
> >>>> btw, i'm using org.apache.coyote.ajp.AjpNioProtocol
> >
> > Can you post your complete Connector configuration?
> >
> >
> >> Sure..
> >
> >> <Connector port="8009"
> >> protocol="org.apache.coyote.ajp.AjpNioProtocol" maxThreads="400"
> >> backlog="25" maxPostSize="4194304" enableLookups="false"
> >> connectionTimeout="120000" keepAliveTimeout="10000"
> >> redirectPort="8443" acceptorThreadCount="2"
> >> pollerThreadCount="2" processorCache="400" minSpareThreads="25"
> >> useComet="false" />
>
> You should:
>
> 1. Use an <Executor> instead of specifying your threading config in
> <Connector>
> 2. Set prestartminSpareThreads="true" on your <Executor>
>
> I think you'll get the behavior you are expecting.
>
>
So this worked well, except now, under my consistent load, the threads in
the executor don't time out after their set idle time (maxIdleTime="60000").
If i run a load test, they do after the test finishes, so i'm assuming it's
FIFO based.
If it is, then my threads will likely never idle out. Maybe we should have
an option to make this LIFO?

-Tony




> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJXTc1tAAoJEBzwKT+lPKRYMpsQAIm5jmGuNFEbhQOLqQYWvquy
> WglEnM4QGsquyAU5Mfb5qsds9uu7f81c0CIw7M1fT76kvC8xC9aaTxAk8qSG+TTR
> FN+UiNr91IfyKHdq/qoOjxHbtISLhlE1IA7/Z3AQdtZ+Rvf3TioFULEVgZryt9Wo
> e1GioN5plkkYJlf4dxYpBXpfProuwsKDMsmISXAjPSZM8IzYggO2axBoKxIx2JHL
> /rkY6zZPhgaf6NWhEoFB0a/+Pfbug5eodPS93ph57BYxHOCCfGiRQ9kpua/k9rIh
> OKauwZefuSV2MxtMr40A6ckfMSkeW/4fq73JSvZFuGiTe7Yuij85lIPR9s7BCaON
> XH/tMJScecTcmREN5Ki+GMGfnssihlfUu78zw/DVFlIwkZQIoG7VqBUBVKJ6pboo
> AJjzZGkogskEK/ailaeRY/jITNfsGbxVHxE7qqhOaBOfWXRipxHeu4e08FFToLxv
> OWgUmcyB4bOzz8d3XXbl/NtIyY4wNl0SNywalW527r/uv86cUTtBBKEuMmJXVjt5
> Z7MLigAk5SvPaUtv2iP2ddmp1GTxcUXbjUJrpM20pKlyPum1bUysxX4I3mwdYNJ4
> EboTSZeiDq/eCbutoKb8Gk8yZ8c35/3utqmp88xNksmGrDxy17WplUf4tvcWhX/f
> Kb+DU9C1eBH78TNfhjKP
> =NNCM
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: minSpareThreads for AJP connector

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Anthony,

On 5/27/16 3:54 PM, Anthony Biacco wrote:
> On Fri, May 27, 2016 at 7:34 AM, Christopher Schultz < 
> chris@christopherschultz.net> wrote:
> 
> Tony,
> 
> On 5/26/16 4:22 PM, Anthony Biacco wrote:
>>>> On Thu, May 26, 2016 at 2:19 PM, Anthony Biacco 
>>>> <ab...@handll.com> wrote:
>>>> 
>>>>> I have this property set under 8.0.35, but it only hits the
>>>>> value I set when i make that many requests. Should it not
>>>>> allocate threads of the value I set on startup?
>>>>> 
>>>>> 
>>>> btw, i'm using org.apache.coyote.ajp.AjpNioProtocol
> 
> Can you post your complete Connector configuration?
> 
> 
>> Sure..
> 
>> <Connector port="8009" 
>> protocol="org.apache.coyote.ajp.AjpNioProtocol" maxThreads="400"
>> backlog="25" maxPostSize="4194304" enableLookups="false"
>> connectionTimeout="120000" keepAliveTimeout="10000" 
>> redirectPort="8443" acceptorThreadCount="2" 
>> pollerThreadCount="2" processorCache="400" minSpareThreads="25" 
>> useComet="false" />

You should:

1. Use an <Executor> instead of specifying your threading config in
<Connector>
2. Set prestartminSpareThreads="true" on your <Executor>

I think you'll get the behavior you are expecting.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXTc1tAAoJEBzwKT+lPKRYMpsQAIm5jmGuNFEbhQOLqQYWvquy
WglEnM4QGsquyAU5Mfb5qsds9uu7f81c0CIw7M1fT76kvC8xC9aaTxAk8qSG+TTR
FN+UiNr91IfyKHdq/qoOjxHbtISLhlE1IA7/Z3AQdtZ+Rvf3TioFULEVgZryt9Wo
e1GioN5plkkYJlf4dxYpBXpfProuwsKDMsmISXAjPSZM8IzYggO2axBoKxIx2JHL
/rkY6zZPhgaf6NWhEoFB0a/+Pfbug5eodPS93ph57BYxHOCCfGiRQ9kpua/k9rIh
OKauwZefuSV2MxtMr40A6ckfMSkeW/4fq73JSvZFuGiTe7Yuij85lIPR9s7BCaON
XH/tMJScecTcmREN5Ki+GMGfnssihlfUu78zw/DVFlIwkZQIoG7VqBUBVKJ6pboo
AJjzZGkogskEK/ailaeRY/jITNfsGbxVHxE7qqhOaBOfWXRipxHeu4e08FFToLxv
OWgUmcyB4bOzz8d3XXbl/NtIyY4wNl0SNywalW527r/uv86cUTtBBKEuMmJXVjt5
Z7MLigAk5SvPaUtv2iP2ddmp1GTxcUXbjUJrpM20pKlyPum1bUysxX4I3mwdYNJ4
EboTSZeiDq/eCbutoKb8Gk8yZ8c35/3utqmp88xNksmGrDxy17WplUf4tvcWhX/f
Kb+DU9C1eBH78TNfhjKP
=NNCM
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: minSpareThreads for AJP connector

Posted by Anthony Biacco <ab...@handll.com>.
On Fri, May 27, 2016 at 7:34 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Tony,
>
> On 5/26/16 4:22 PM, Anthony Biacco wrote:
> > On Thu, May 26, 2016 at 2:19 PM, Anthony Biacco
> > <ab...@handll.com> wrote:
> >
> >> I have this property set under 8.0.35, but it only hits the value
> >> I set when i make that many requests. Should it not allocate
> >> threads of the value I set on startup?
> >>
> >>
> > btw, i'm using org.apache.coyote.ajp.AjpNioProtocol
>
> Can you post your complete Connector configuration?
>
>
Sure..

        <Connector port="8009"
protocol="org.apache.coyote.ajp.AjpNioProtocol"
                        maxThreads="400" backlog="25" maxPostSize="4194304"
                        enableLookups="false" connectionTimeout="120000"
keepAliveTimeout="10000"
                        redirectPort="8443" acceptorThreadCount="2"
pollerThreadCount="2"
                        processorCache="400" minSpareThreads="25"
                        useComet="false" />


> How are you testing (applying load)? How are you measuring the number
> of allocated threads?
>
>
1 request at a time with apache ab->apache->mod_proxy_ajp/balancer->tomcat,
then checking JMX
(get=Catalina:type=ThreadPool,name="ajp-nio-8009"&att=currentThreadCount)

it increases +1 with every request, then when i get to 25, it'll stay there
(that part is right).

is it maybe that tomcat won't open a thread without a connection
(mod_proxy_ajp) attached to it first??

If it helps, members in my mod_proxy_ajp config look like this:

BalancerMember ajp://app-01.local:8009 route=app-01 loadfactor=1 max=200
acquire=2000 connectiontimeout=1500ms disablereuse=off keepalive=off
ping=1500ms timeout=30
retry=60 ttl=120 flushpackets=on


-Tony



> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJXSEz3AAoJEBzwKT+lPKRYxlIQAJVil7ttuuOMkQm3TFqrTIej
> rKj2/rLyvo5x0UGE2POsWbAKNBq48eUPEOtSAJ1KvYmSaJ02q/nMDO/Uvf5aNIyA
> Ms2DJpn6L6uqM7GZO5dPXWtcNdughEOI2uMqFFJUBtNpjaBEeofNnv+LthGYzVjy
> 0MkZ2CLiSD54rrdTiZzCa7Q9bkc/y7sRzQN0G8ChKiYJumON2aYK+16iLH8XVHCs
> QFTe5I988mRnFP8c2r2G0gPVGxtBRdqXPPLIsJRUpxDmoYuo9/JGL0jI3GaCAX4H
> 4zrQqZmur5JfjqzsL8ehCGpQrEHzy8yseU8XhgLxZzWyUWWta04zwQn5noOUVEAf
> kcPQa72+RwNUd6i8446Pi8HdY+N1S3BFbjh/WQ8/jAk8AzzQtKye7UYBm3OxaHLw
> k+J+C+E7V4p+4GZDKR707+vE2q7//WEFYnor47WGwITxxRI+KP8z9jHkoBithdq1
> kMNlQyz/nsB4tIjRrTTSnp8N27HPFcFWdRL43m0dOnV+xCkwBs7F1aeUaQy9XonN
> 6hm67eIEx7nQ0BLnEziu9TO2fqRioOkFjuhnB2NURo+A6vebjwI9BLv3kJhAIpUu
> dmss7t+Ht8u5Nv+FTF/ntOm51MaNtp0HPjvGrjS1UJnD/seWef7sk8UPlB4EC3vb
> 56K0Na1fQVOzGYqtXcfg
> =sGAr
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: minSpareThreads for AJP connector

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Tony,

On 5/26/16 4:22 PM, Anthony Biacco wrote:
> On Thu, May 26, 2016 at 2:19 PM, Anthony Biacco
> <ab...@handll.com> wrote:
> 
>> I have this property set under 8.0.35, but it only hits the value
>> I set when i make that many requests. Should it not allocate
>> threads of the value I set on startup?
>> 
>> 
> btw, i'm using org.apache.coyote.ajp.AjpNioProtocol

Can you post your complete Connector configuration?

How are you testing (applying load)? How are you measuring the number
of allocated threads?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXSEz3AAoJEBzwKT+lPKRYxlIQAJVil7ttuuOMkQm3TFqrTIej
rKj2/rLyvo5x0UGE2POsWbAKNBq48eUPEOtSAJ1KvYmSaJ02q/nMDO/Uvf5aNIyA
Ms2DJpn6L6uqM7GZO5dPXWtcNdughEOI2uMqFFJUBtNpjaBEeofNnv+LthGYzVjy
0MkZ2CLiSD54rrdTiZzCa7Q9bkc/y7sRzQN0G8ChKiYJumON2aYK+16iLH8XVHCs
QFTe5I988mRnFP8c2r2G0gPVGxtBRdqXPPLIsJRUpxDmoYuo9/JGL0jI3GaCAX4H
4zrQqZmur5JfjqzsL8ehCGpQrEHzy8yseU8XhgLxZzWyUWWta04zwQn5noOUVEAf
kcPQa72+RwNUd6i8446Pi8HdY+N1S3BFbjh/WQ8/jAk8AzzQtKye7UYBm3OxaHLw
k+J+C+E7V4p+4GZDKR707+vE2q7//WEFYnor47WGwITxxRI+KP8z9jHkoBithdq1
kMNlQyz/nsB4tIjRrTTSnp8N27HPFcFWdRL43m0dOnV+xCkwBs7F1aeUaQy9XonN
6hm67eIEx7nQ0BLnEziu9TO2fqRioOkFjuhnB2NURo+A6vebjwI9BLv3kJhAIpUu
dmss7t+Ht8u5Nv+FTF/ntOm51MaNtp0HPjvGrjS1UJnD/seWef7sk8UPlB4EC3vb
56K0Na1fQVOzGYqtXcfg
=sGAr
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: minSpareThreads for AJP connector

Posted by Anthony Biacco <ab...@handll.com>.
On Thu, May 26, 2016 at 2:19 PM, Anthony Biacco <ab...@handll.com> wrote:

> I have this property set under 8.0.35, but it only hits the value I set
> when i make that many requests.
> Should it not allocate threads of the value I set on startup?
>
>
btw, i'm using org.apache.coyote.ajp.AjpNioProtocol


-Tony