You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by amit shah <am...@gmail.com> on 2013/03/07 15:59:49 UTC

Changing tomcat connection pool size through jmx

Hello,
        I use tomcat connection pool in my web application by using two
jars - tomcat-jdbc-7.0.34.jar and tomcat-juli-7.0.34.jar. I want to change
the connection pool size through jmx but I could not find any defined jmx
operation for doing that.
         I noticed that bug
50864<https://issues.apache.org/bugzilla/show_bug.cgi?id=50864>
specifies
that tomcat allows updating the connection pool size through jmx from
tomcat 7.0.28 onwards. I use 7.0.34 version for jars. Am I missing
something?

Thank you.

Re: Changing tomcat connection pool size through jmx

Posted by amit shah <am...@gmail.com>.
It indeed works. Thanks !


On Fri, Mar 8, 2013 at 6:40 PM, Daniel Mikusa <dm...@vmware.com> wrote:

> On Mar 7, 2013, at 10:11 PM, Amit wrote:
>
> > I tried setting the 'maxActive' attribute by double clicking it and
> modifying the value but the new value does not get set.
>
> What happens?  Do you get an error?  If so, what does it say?
>
> >
> > The bug 50864 was suppose to provide the flexibility to update the
> connection pool properties through JMX and this is what I was looking for.
> Shouldn't that be the case?
>
> Tested with Tomcat 7.0.37 and it works fine for me.
>
> Steps used to test:
>
> 1.) Configure Global Resource tag using H2 database
> 2.) Start Tomcat 7.0.37
> 3.) Connect using jvisualvm
> 4.) Go to MBeans tab
> 5.) Browse to tomcat.jdbc -> ConnectionPool -> "<pool-name>" ->
> org.apache.tomcat.jdbc.pool.DataSource.
> 6.) Double click "maxActive", change value, press enter.
> 7.) Value is saved.  Refreshing shows the new value.
>
> Dan
>
>
> >
> > thanks.
> >
> > On 08-Mar-2013, at 1:40 AM, Daniel Mikusa <dm...@vmware.com> wrote:
> >
> >> On Mar 7, 2013, at 12:32 PM, amit shah wrote:
> >>
> >>> I was looking at jmx since that would not need application server
> restart.
> >>>
> >>> I didn't understand what you meant by "Have you tried looking at /
> >>> modifying the attributes" ?
> >>
> >> When you look at an Mbean in jconsole or jvisualvm, you'll see a few
> different tabs but there should be one which lists Attributes (i.e. the
> values exposed through JMX) and one that lists Operations (i.e. functions
> exposed through JMX).
> >>
> >> Attributes list the properties of an mbean and some properties can be
> changed on the fly by double-clicking them and setting a new value.  I
> believe that's how you would adjust the connection pool properties.  Does
> that work for you?
> >>
> >> Dan
> >>
> >>
> >>>
> >>>
> >>> On Thu, Mar 7, 2013 at 9:50 PM, Daniel Mikusa <dm...@vmware.com>
> wrote:
> >>>
> >>>> On Mar 7, 2013, at 9:59 AM, amit shah wrote:
> >>>>
> >>>>> Hello,
> >>>>>     I use tomcat connection pool in my web application by using two
> >>>>> jars - tomcat-jdbc-7.0.34.jar and tomcat-juli-7.0.34.jar. I want to
> >>>> change
> >>>>> the connection pool size through jmx but I could not find any
> defined jmx
> >>>>> operation for doing that.
> >>>>
> >>>> Are you strictly looking at JMX operations?  Have you tried looking
> at /
> >>>> modifying the attributes?
> >>>>
> >>>> Dan
> >>>>
> >>>>>      I noticed that bug
> >>>>> 50864<https://issues.apache.org/bugzilla/show_bug.cgi?id=50864>
> >>>>> specifies
> >>>>> that tomcat allows updating the connection pool size through jmx from
> >>>>> tomcat 7.0.28 onwards. I use 7.0.34 version for jars. Am I missing
> >>>>> something?
> >>>>>
> >>>>> Thank you
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> 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
> >>
> >
> > ---------------------------------------------------------------------
> > 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
>
>

Re: Changing tomcat connection pool size through jmx

Posted by Daniel Mikusa <dm...@vmware.com>.
On Mar 7, 2013, at 10:11 PM, Amit wrote:

> I tried setting the 'maxActive' attribute by double clicking it and modifying the value but the new value does not get set.

What happens?  Do you get an error?  If so, what does it say?

> 
> The bug 50864 was suppose to provide the flexibility to update the connection pool properties through JMX and this is what I was looking for. Shouldn't that be the case?

Tested with Tomcat 7.0.37 and it works fine for me.

Steps used to test:

1.) Configure Global Resource tag using H2 database
2.) Start Tomcat 7.0.37
3.) Connect using jvisualvm
4.) Go to MBeans tab
5.) Browse to tomcat.jdbc -> ConnectionPool -> "<pool-name>" -> org.apache.tomcat.jdbc.pool.DataSource.
6.) Double click "maxActive", change value, press enter.
7.) Value is saved.  Refreshing shows the new value.

Dan


> 
> thanks.
> 
> On 08-Mar-2013, at 1:40 AM, Daniel Mikusa <dm...@vmware.com> wrote:
> 
>> On Mar 7, 2013, at 12:32 PM, amit shah wrote:
>> 
>>> I was looking at jmx since that would not need application server restart.
>>> 
>>> I didn't understand what you meant by "Have you tried looking at /
>>> modifying the attributes" ?
>> 
>> When you look at an Mbean in jconsole or jvisualvm, you'll see a few different tabs but there should be one which lists Attributes (i.e. the values exposed through JMX) and one that lists Operations (i.e. functions exposed through JMX).
>> 
>> Attributes list the properties of an mbean and some properties can be changed on the fly by double-clicking them and setting a new value.  I believe that's how you would adjust the connection pool properties.  Does that work for you?
>> 
>> Dan
>> 
>> 
>>> 
>>> 
>>> On Thu, Mar 7, 2013 at 9:50 PM, Daniel Mikusa <dm...@vmware.com> wrote:
>>> 
>>>> On Mar 7, 2013, at 9:59 AM, amit shah wrote:
>>>> 
>>>>> Hello,
>>>>>     I use tomcat connection pool in my web application by using two
>>>>> jars - tomcat-jdbc-7.0.34.jar and tomcat-juli-7.0.34.jar. I want to
>>>> change
>>>>> the connection pool size through jmx but I could not find any defined jmx
>>>>> operation for doing that.
>>>> 
>>>> Are you strictly looking at JMX operations?  Have you tried looking at /
>>>> modifying the attributes?
>>>> 
>>>> Dan
>>>> 
>>>>>      I noticed that bug
>>>>> 50864<https://issues.apache.org/bugzilla/show_bug.cgi?id=50864>
>>>>> specifies
>>>>> that tomcat allows updating the connection pool size through jmx from
>>>>> tomcat 7.0.28 onwards. I use 7.0.34 version for jars. Am I missing
>>>>> something?
>>>>> 
>>>>> Thank you
>>>> 
>>>> ---------------------------------------------------------------------
>>>> 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
>> 
> 
> ---------------------------------------------------------------------
> 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


Re: Changing tomcat connection pool size through jmx

Posted by amit shah <am...@gmail.com>.
That's the one I set in my code to configure the maximum pool size of the
connection pool. What is the attribute I should update to increase/decrease
the connection pool size? Also what all attributes are updatable?

Thanks


On Fri, Mar 8, 2013 at 2:50 PM, <pi...@pidster.com> wrote:

> On 8 Mar 2013, at 03:00, Amit <am...@gmail.com> wrote:
>
> > I tried setting the 'maxActive' attribute by double clicking it and
> modifying the value but the new value does not get set.
>
> That's the wrong attribute. That one is a read only attribute
> reporting the maximum number of connections that have been active at
> kne time. Try another one!
>
>
>
> > The bug 50864 was suppose to provide the flexibility to update the
> connection pool properties through JMX and this is what I was looking for.
> Shouldn't that be the case?
> >
> > thanks.
> >
> > On 08-Mar-2013, at 1:40 AM, Daniel Mikusa <dm...@vmware.com> wrote:
> >
> >> On Mar 7, 2013, at 12:32 PM, amit shah wrote:
> >>
> >>> I was looking at jmx since that would not need application server
> restart.
> >>>
> >>> I didn't understand what you meant by "Have you tried looking at /
> >>> modifying the attributes" ?
> >>
> >> When you look at an Mbean in jconsole or jvisualvm, you'll see a few
> different tabs but there should be one which lists Attributes (i.e. the
> values exposed through JMX) and one that lists Operations (i.e. functions
> exposed through JMX).
> >>
> >> Attributes list the properties of an mbean and some properties can be
> changed on the fly by double-clicking them and setting a new value.  I
> believe that's how you would adjust the connection pool properties.  Does
> that work for you?
> >>
> >> Dan
> >>
> >>
> >>>
> >>>
> >>> On Thu, Mar 7, 2013 at 9:50 PM, Daniel Mikusa <dm...@vmware.com>
> wrote:
> >>>
> >>>> On Mar 7, 2013, at 9:59 AM, amit shah wrote:
> >>>>
> >>>>> Hello,
> >>>>>     I use tomcat connection pool in my web application by using two
> >>>>> jars - tomcat-jdbc-7.0.34.jar and tomcat-juli-7.0.34.jar. I want to
> >>>> change
> >>>>> the connection pool size through jmx but I could not find any
> defined jmx
> >>>>> operation for doing that.
> >>>>
> >>>> Are you strictly looking at JMX operations?  Have you tried looking
> at /
> >>>> modifying the attributes?
> >>>>
> >>>> Dan
> >>>>
> >>>>>      I noticed that bug
> >>>>> 50864<https://issues.apache.org/bugzilla/show_bug.cgi?id=50864>
> >>>>> specifies
> >>>>> that tomcat allows updating the connection pool size through jmx from
> >>>>> tomcat 7.0.28 onwards. I use 7.0.34 version for jars. Am I missing
> >>>>> something?
> >>>>>
> >>>>> Thank you
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> 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
> >
> > ---------------------------------------------------------------------
> > 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
>
>

Re: Changing tomcat connection pool size through jmx

Posted by pi...@pidster.com.
On 8 Mar 2013, at 03:00, Amit <am...@gmail.com> wrote:

> I tried setting the 'maxActive' attribute by double clicking it and modifying the value but the new value does not get set.

That's the wrong attribute. That one is a read only attribute
reporting the maximum number of connections that have been active at
kne time. Try another one!



> The bug 50864 was suppose to provide the flexibility to update the connection pool properties through JMX and this is what I was looking for. Shouldn't that be the case?
>
> thanks.
>
> On 08-Mar-2013, at 1:40 AM, Daniel Mikusa <dm...@vmware.com> wrote:
>
>> On Mar 7, 2013, at 12:32 PM, amit shah wrote:
>>
>>> I was looking at jmx since that would not need application server restart.
>>>
>>> I didn't understand what you meant by "Have you tried looking at /
>>> modifying the attributes" ?
>>
>> When you look at an Mbean in jconsole or jvisualvm, you'll see a few different tabs but there should be one which lists Attributes (i.e. the values exposed through JMX) and one that lists Operations (i.e. functions exposed through JMX).
>>
>> Attributes list the properties of an mbean and some properties can be changed on the fly by double-clicking them and setting a new value.  I believe that's how you would adjust the connection pool properties.  Does that work for you?
>>
>> Dan
>>
>>
>>>
>>>
>>> On Thu, Mar 7, 2013 at 9:50 PM, Daniel Mikusa <dm...@vmware.com> wrote:
>>>
>>>> On Mar 7, 2013, at 9:59 AM, amit shah wrote:
>>>>
>>>>> Hello,
>>>>>     I use tomcat connection pool in my web application by using two
>>>>> jars - tomcat-jdbc-7.0.34.jar and tomcat-juli-7.0.34.jar. I want to
>>>> change
>>>>> the connection pool size through jmx but I could not find any defined jmx
>>>>> operation for doing that.
>>>>
>>>> Are you strictly looking at JMX operations?  Have you tried looking at /
>>>> modifying the attributes?
>>>>
>>>> Dan
>>>>
>>>>>      I noticed that bug
>>>>> 50864<https://issues.apache.org/bugzilla/show_bug.cgi?id=50864>
>>>>> specifies
>>>>> that tomcat allows updating the connection pool size through jmx from
>>>>> tomcat 7.0.28 onwards. I use 7.0.34 version for jars. Am I missing
>>>>> something?
>>>>>
>>>>> Thank you
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>
> ---------------------------------------------------------------------
> 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


Re: Changing tomcat connection pool size through jmx

Posted by Amit <am...@gmail.com>.
I tried setting the 'maxActive' attribute by double clicking it and modifying the value but the new value does not get set.

The bug 50864 was suppose to provide the flexibility to update the connection pool properties through JMX and this is what I was looking for. Shouldn't that be the case?

thanks.

On 08-Mar-2013, at 1:40 AM, Daniel Mikusa <dm...@vmware.com> wrote:

> On Mar 7, 2013, at 12:32 PM, amit shah wrote:
> 
>> I was looking at jmx since that would not need application server restart.
>> 
>> I didn't understand what you meant by "Have you tried looking at /
>> modifying the attributes" ?
> 
> When you look at an Mbean in jconsole or jvisualvm, you'll see a few different tabs but there should be one which lists Attributes (i.e. the values exposed through JMX) and one that lists Operations (i.e. functions exposed through JMX).
> 
> Attributes list the properties of an mbean and some properties can be changed on the fly by double-clicking them and setting a new value.  I believe that's how you would adjust the connection pool properties.  Does that work for you?
> 
> Dan
> 
> 
>> 
>> 
>> On Thu, Mar 7, 2013 at 9:50 PM, Daniel Mikusa <dm...@vmware.com> wrote:
>> 
>>> On Mar 7, 2013, at 9:59 AM, amit shah wrote:
>>> 
>>>> Hello,
>>>>      I use tomcat connection pool in my web application by using two
>>>> jars - tomcat-jdbc-7.0.34.jar and tomcat-juli-7.0.34.jar. I want to
>>> change
>>>> the connection pool size through jmx but I could not find any defined jmx
>>>> operation for doing that.
>>> 
>>> Are you strictly looking at JMX operations?  Have you tried looking at /
>>> modifying the attributes?
>>> 
>>> Dan
>>> 
>>>>       I noticed that bug
>>>> 50864<https://issues.apache.org/bugzilla/show_bug.cgi?id=50864>
>>>> specifies
>>>> that tomcat allows updating the connection pool size through jmx from
>>>> tomcat 7.0.28 onwards. I use 7.0.34 version for jars. Am I missing
>>>> something?
>>>> 
>>>> Thank you
>>> 
>>> ---------------------------------------------------------------------
>>> 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
> 

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


Re: Changing tomcat connection pool size through jmx

Posted by Daniel Mikusa <dm...@vmware.com>.
On Mar 7, 2013, at 12:32 PM, amit shah wrote:

> I was looking at jmx since that would not need application server restart.
> 
> I didn't understand what you meant by "Have you tried looking at /
> modifying the attributes" ?

When you look at an Mbean in jconsole or jvisualvm, you'll see a few different tabs but there should be one which lists Attributes (i.e. the values exposed through JMX) and one that lists Operations (i.e. functions exposed through JMX).

Attributes list the properties of an mbean and some properties can be changed on the fly by double-clicking them and setting a new value.  I believe that's how you would adjust the connection pool properties.  Does that work for you?

Dan


> 
> 
> On Thu, Mar 7, 2013 at 9:50 PM, Daniel Mikusa <dm...@vmware.com> wrote:
> 
>> On Mar 7, 2013, at 9:59 AM, amit shah wrote:
>> 
>>> Hello,
>>>       I use tomcat connection pool in my web application by using two
>>> jars - tomcat-jdbc-7.0.34.jar and tomcat-juli-7.0.34.jar. I want to
>> change
>>> the connection pool size through jmx but I could not find any defined jmx
>>> operation for doing that.
>> 
>> Are you strictly looking at JMX operations?  Have you tried looking at /
>> modifying the attributes?
>> 
>> Dan
>> 
>>>        I noticed that bug
>>> 50864<https://issues.apache.org/bugzilla/show_bug.cgi?id=50864>
>>> specifies
>>> that tomcat allows updating the connection pool size through jmx from
>>> tomcat 7.0.28 onwards. I use 7.0.34 version for jars. Am I missing
>>> something?
>>> 
>>> Thank you
>> 
>> ---------------------------------------------------------------------
>> 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


Re: Changing tomcat connection pool size through jmx

Posted by amit shah <am...@gmail.com>.
I was looking at jmx since that would not need application server restart.

I didn't understand what you meant by "Have you tried looking at /
modifying the attributes" ?


On Thu, Mar 7, 2013 at 9:50 PM, Daniel Mikusa <dm...@vmware.com> wrote:

> On Mar 7, 2013, at 9:59 AM, amit shah wrote:
>
> > Hello,
> >        I use tomcat connection pool in my web application by using two
> > jars - tomcat-jdbc-7.0.34.jar and tomcat-juli-7.0.34.jar. I want to
> change
> > the connection pool size through jmx but I could not find any defined jmx
> > operation for doing that.
>
> Are you strictly looking at JMX operations?  Have you tried looking at /
> modifying the attributes?
>
> Dan
>
> >         I noticed that bug
> > 50864<https://issues.apache.org/bugzilla/show_bug.cgi?id=50864>
> > specifies
> > that tomcat allows updating the connection pool size through jmx from
> > tomcat 7.0.28 onwards. I use 7.0.34 version for jars. Am I missing
> > something?
> >
> > Thank you
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Changing tomcat connection pool size through jmx

Posted by Daniel Mikusa <dm...@vmware.com>.
On Mar 7, 2013, at 9:59 AM, amit shah wrote:

> Hello,
>        I use tomcat connection pool in my web application by using two
> jars - tomcat-jdbc-7.0.34.jar and tomcat-juli-7.0.34.jar. I want to change
> the connection pool size through jmx but I could not find any defined jmx
> operation for doing that.

Are you strictly looking at JMX operations?  Have you tried looking at / modifying the attributes?  

Dan

>         I noticed that bug
> 50864<https://issues.apache.org/bugzilla/show_bug.cgi?id=50864>
> specifies
> that tomcat allows updating the connection pool size through jmx from
> tomcat 7.0.28 onwards. I use 7.0.34 version for jars. Am I missing
> something?
> 
> Thank you

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