You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Yogesh Sagar <yo...@gmail.com> on 2012/02/23 22:01:40 UTC
Performance Monitoring
Hello,
I am trying to do some performance monitoring on some of the endpoints. How
can I monitor performance in synapse? Is there a JMX support in Synapse? My
thoughts are to write a in mediator which will basically record the start
time etc etc and then wrote the out mediator which would measure
performance or gather statistics. Any ideas or pointers is very much
appreciated.
Thanks,
Yogesh
Re: Performance Monitoring
Posted by Ruwan Linton <ru...@gmail.com>.
On Tue, Feb 28, 2012 at 5:34 AM, Sadeep Jayasumana <ga...@gmail.com>wrote:
> Hi,
>
> On Mon, Feb 27, 2012 at 2:48 PM, Ruwan Linton <ruwan.linton@gmail.com
> >wrote:
>
> > >
> > > Synapse MessageContext (which is different from Axis2 MessageContext)
> is
> > > built for every request received by Synapse and remains until the
> > response
> > > for that message is sent back to the client.
> >
> >
> > True.
> >
> >
> > > This means that, when a single
> > > request to Synapse is considered, same message context is used for it's
> > in
> > > sequence and out sequence.
> > >
> >
> > Sadeep, it is not. Even though the life-cycle of the message context
> > created at the message reception lasts until the response to that message
> > is sent back to the caller, it doesn't mean that the same message context
> > is used for in and out mediation. The synapse message context used for
> the
> > out-sequence is *different* from the one used for the in-sequence but
> they
> > relates (like in the axis2 in and out message contexts). However we copy
> > certain things from the synapse in message context to the out message
> > context, like properties, and few context attributes.
> >
> > In effect, if you set a property on the in-sequence at synapse scope
> (which
> > is default) you will be able to retrieve the same on the out-sequence.
> > IIRC, even axis2 scope would be the same as we copy axis2 message context
> > properties, except for few (system used) properties and options.
> >
> >
> Thanks Ruwan for the clarification.
>
You're welcome.
Ruwan
>
>
> > Thanks,
> > Ruwan
> >
> > --
> > Ruwan Linton
> > Member, Apache Software Foundation; http://www.apache.org
> > Director of Engineering; http://adroitlogic.org
> >
> > phone: +94 11 282 7532
> > email: ruwan@adroitlogic.com; cell: +94 77 341 3097
> > blog: http://blog.ruwan.org
> > linkedin: http://www.linkedin.com/in/ruwanlinton
> > google: http://www.google.com/profiles/ruwan.linton
> > tweet: http://twitter.com/ruwanlinton
> >
>
>
>
> --
>
> Sadeep Jayasumana
>
> **
>
> Email: gayansadeep@gmail.com****
>
> Mobile: +61 4 1468 8521
>
--
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
Director of Engineering; http://adroitlogic.org
phone: +94 11 282 7532
email: ruwan@adroitlogic.com; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton
Re: Performance Monitoring
Posted by Sadeep Jayasumana <ga...@gmail.com>.
Hi,
On Mon, Feb 27, 2012 at 2:48 PM, Ruwan Linton <ru...@gmail.com>wrote:
> >
> > Synapse MessageContext (which is different from Axis2 MessageContext) is
> > built for every request received by Synapse and remains until the
> response
> > for that message is sent back to the client.
>
>
> True.
>
>
> > This means that, when a single
> > request to Synapse is considered, same message context is used for it's
> in
> > sequence and out sequence.
> >
>
> Sadeep, it is not. Even though the life-cycle of the message context
> created at the message reception lasts until the response to that message
> is sent back to the caller, it doesn't mean that the same message context
> is used for in and out mediation. The synapse message context used for the
> out-sequence is *different* from the one used for the in-sequence but they
> relates (like in the axis2 in and out message contexts). However we copy
> certain things from the synapse in message context to the out message
> context, like properties, and few context attributes.
>
> In effect, if you set a property on the in-sequence at synapse scope (which
> is default) you will be able to retrieve the same on the out-sequence.
> IIRC, even axis2 scope would be the same as we copy axis2 message context
> properties, except for few (system used) properties and options.
>
>
Thanks Ruwan for the clarification.
> Thanks,
> Ruwan
>
> --
> Ruwan Linton
> Member, Apache Software Foundation; http://www.apache.org
> Director of Engineering; http://adroitlogic.org
>
> phone: +94 11 282 7532
> email: ruwan@adroitlogic.com; cell: +94 77 341 3097
> blog: http://blog.ruwan.org
> linkedin: http://www.linkedin.com/in/ruwanlinton
> google: http://www.google.com/profiles/ruwan.linton
> tweet: http://twitter.com/ruwanlinton
>
--
Sadeep Jayasumana
**
Email: gayansadeep@gmail.com****
Mobile: +61 4 1468 8521
Re: Performance Monitoring
Posted by Sadeep Jayasumana <ga...@gmail.com>.
Hi,
On Tue, Feb 28, 2012 at 8:14 AM, Yogesh Sagar <yo...@gmail.com> wrote:
> Thanks for the help and valuable input. Now my next question is:
>
> Is there a support for remote JMX in Apache Synapse? Can I remotely
> management and monitor synapse using JMX?
>
I just tried it with Synapse 2.1.0. During startup, it displays the
following message.
INFO Axis2SynapseController Management using JMX available via:
service:jmx:rmi:///jndi/rmi://x.x.x.x:1099/synapse
You should be able to remotely monitor the Synapse instance using this URL
with the appropriate IP address.
Thanks,
Sadeep
Thanks,
> Yogesh
>
> On Sun, Feb 26, 2012 at 10:48 PM, Ruwan Linton <ruwan.linton@gmail.com
> >wrote:
>
> > >
> > > Synapse MessageContext (which is different from Axis2 MessageContext)
> is
> > > built for every request received by Synapse and remains until the
> > response
> > > for that message is sent back to the client.
> >
> >
> > True.
> >
> >
> > > This means that, when a single
> > > request to Synapse is considered, same message context is used for it's
> > in
> > > sequence and out sequence.
> > >
> >
> > Sadeep, it is not. Even though the life-cycle of the message context
> > created at the message reception lasts until the response to that message
> > is sent back to the caller, it doesn't mean that the same message context
> > is used for in and out mediation. The synapse message context used for
> the
> > out-sequence is *different* from the one used for the in-sequence but
> they
> > relates (like in the axis2 in and out message contexts). However we copy
> > certain things from the synapse in message context to the out message
> > context, like properties, and few context attributes.
> >
> > In effect, if you set a property on the in-sequence at synapse scope
> (which
> > is default) you will be able to retrieve the same on the out-sequence.
> > IIRC, even axis2 scope would be the same as we copy axis2 message context
> > properties, except for few (system used) properties and options.
> >
> > Thanks,
> > Ruwan
> >
> > --
> > Ruwan Linton
> > Member, Apache Software Foundation; http://www.apache.org
> > Director of Engineering; http://adroitlogic.org
> >
> > phone: +94 11 282 7532
> > email: ruwan@adroitlogic.com; cell: +94 77 341 3097
> > blog: http://blog.ruwan.org
> > linkedin: http://www.linkedin.com/in/ruwanlinton
> > google: http://www.google.com/profiles/ruwan.linton
> > tweet: http://twitter.com/ruwanlinton
> >
>
--
Sadeep Jayasumana
**
Email: gayansadeep@gmail.com****
Mobile: +61 4 1468 8521
Re: Performance Monitoring
Posted by Yogesh Sagar <yo...@gmail.com>.
Thanks for the help and valuable input. Now my next question is:
Is there a support for remote JMX in Apache Synapse? Can I remotely
management and monitor synapse using JMX?
Thanks,
Yogesh
On Sun, Feb 26, 2012 at 10:48 PM, Ruwan Linton <ru...@gmail.com>wrote:
> >
> > Synapse MessageContext (which is different from Axis2 MessageContext) is
> > built for every request received by Synapse and remains until the
> response
> > for that message is sent back to the client.
>
>
> True.
>
>
> > This means that, when a single
> > request to Synapse is considered, same message context is used for it's
> in
> > sequence and out sequence.
> >
>
> Sadeep, it is not. Even though the life-cycle of the message context
> created at the message reception lasts until the response to that message
> is sent back to the caller, it doesn't mean that the same message context
> is used for in and out mediation. The synapse message context used for the
> out-sequence is *different* from the one used for the in-sequence but they
> relates (like in the axis2 in and out message contexts). However we copy
> certain things from the synapse in message context to the out message
> context, like properties, and few context attributes.
>
> In effect, if you set a property on the in-sequence at synapse scope (which
> is default) you will be able to retrieve the same on the out-sequence.
> IIRC, even axis2 scope would be the same as we copy axis2 message context
> properties, except for few (system used) properties and options.
>
> Thanks,
> Ruwan
>
> --
> Ruwan Linton
> Member, Apache Software Foundation; http://www.apache.org
> Director of Engineering; http://adroitlogic.org
>
> phone: +94 11 282 7532
> email: ruwan@adroitlogic.com; cell: +94 77 341 3097
> blog: http://blog.ruwan.org
> linkedin: http://www.linkedin.com/in/ruwanlinton
> google: http://www.google.com/profiles/ruwan.linton
> tweet: http://twitter.com/ruwanlinton
>
Re: Performance Monitoring
Posted by Ruwan Linton <ru...@gmail.com>.
>
> Synapse MessageContext (which is different from Axis2 MessageContext) is
> built for every request received by Synapse and remains until the response
> for that message is sent back to the client.
True.
> This means that, when a single
> request to Synapse is considered, same message context is used for it's in
> sequence and out sequence.
>
Sadeep, it is not. Even though the life-cycle of the message context
created at the message reception lasts until the response to that message
is sent back to the caller, it doesn't mean that the same message context
is used for in and out mediation. The synapse message context used for the
out-sequence is *different* from the one used for the in-sequence but they
relates (like in the axis2 in and out message contexts). However we copy
certain things from the synapse in message context to the out message
context, like properties, and few context attributes.
In effect, if you set a property on the in-sequence at synapse scope (which
is default) you will be able to retrieve the same on the out-sequence.
IIRC, even axis2 scope would be the same as we copy axis2 message context
properties, except for few (system used) properties and options.
Thanks,
Ruwan
--
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
Director of Engineering; http://adroitlogic.org
phone: +94 11 282 7532
email: ruwan@adroitlogic.com; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton
Re: Performance Monitoring
Posted by Sadeep Jayasumana <ga...@gmail.com>.
Hi,
On Sat, Feb 25, 2012 at 2:25 AM, Yogesh Sagar <yo...@gmail.com> wrote:
> Thanks Sadeep. Basically, my intent is to create an MBean through Synapse.
> A mediator which would be an MBean and I can monitor it using JConsole and
> view the stats. I know in the synapse source there are few MBeans and I am
> trying to understand the design of those MBeans with regards to how the
> statistics are collected etc. I am trying to build something similar to
> ConnectionsViewMBean which would basically record how long it took for an
> endpoint to process the request and return the results back to client.
>
>
This kind of a calculation is already done within Synapse's NHTTP transport
code to calculate latency statistics (statistics exposed
with NHTTPLatencyView MBean).
Latency = Total time the message spent within the ESB = (t2 - t1) + (t4 -
t3)
Where,
t1 = request arrival time
t2 = request departure time
t3 = response arrival time
t4 = response departure time
For your purpose, I believe you need an MBean to expose the average (t3 -
t2). Since t3 and t2 are already recorded for latency calculation, writing
an MBean to expose the average (t3 - t2) should not be a complex task.
> Correct me if I wrong, is MessageContext shared between an input and output
> sequence? I believe MessageContext is built on every request and response.
>
Synapse MessageContext (which is different from Axis2 MessageContext) is
built for every request received by Synapse and remains until the response
for that message is sent back to the client. This means that, when a single
request to Synapse is considered, same message context is used for it's in
sequence and out sequence.
Thanks,
Sadeep
>
> Cheers,
> Yogesh
>
> On Thu, Feb 23, 2012 at 7:37 PM, Sadeep Jayasumana <gayansadeep@gmail.com
> >wrote:
>
> > Hi,
> >
> > Yes, Synapse does have JMX monitoring capabilities. Please refer to WSO2
> > ESB's monitoring guide [1] for more details. Since WSO2 ESB embeds
> Synapse,
> > this documentation should be applicable to Synapse as well.
> >
> > From all the statistics provided via JMX, for your usecase you might find
> > NHTTP latency statistics useful.
> >
> > [1]
> >
> http://wso2.org/project/esb/java/4.0.3/docs/monitoring.html#JMXMonitoring
> >
> > Thanks,
> > Sadeep
> >
> > On Fri, Feb 24, 2012 at 8:01 AM, Yogesh Sagar <yo...@gmail.com>
> > wrote:
> >
> > > Hello,
> > >
> > > I am trying to do some performance monitoring on some of the endpoints.
> > How
> > > can I monitor performance in synapse? Is there a JMX support in
> Synapse?
> > My
> > > thoughts are to write a in mediator which will basically record the
> start
> > > time etc etc and then wrote the out mediator which would measure
> > > performance or gather statistics. Any ideas or pointers is very much
> > > appreciated.
> > >
> > > Thanks,
> > > Yogesh
> > >
> >
> >
> >
> > --
> >
> > Sadeep Jayasumana
> >
> > **
> >
> > Email: gayansadeep@gmail.com****
> >
> > Mobile: +61 4 1468 8521
> >
>
--
Sadeep Jayasumana
**
Email: gayansadeep@gmail.com****
Mobile: +61 4 1468 8521
Re: Performance Monitoring
Posted by Yogesh Sagar <yo...@gmail.com>.
Thanks Sadeep. Basically, my intent is to create an MBean through Synapse.
A mediator which would be an MBean and I can monitor it using JConsole and
view the stats. I know in the synapse source there are few MBeans and I am
trying to understand the design of those MBeans with regards to how the
statistics are collected etc. I am trying to build something similar to
ConnectionsViewMBean which would basically record how long it took for an
endpoint to process the request and return the results back to client.
Correct me if I wrong, is MessageContext shared between an input and output
sequence? I believe MessageContext is built on every request and response.
Cheers,
Yogesh
On Thu, Feb 23, 2012 at 7:37 PM, Sadeep Jayasumana <ga...@gmail.com>wrote:
> Hi,
>
> Yes, Synapse does have JMX monitoring capabilities. Please refer to WSO2
> ESB's monitoring guide [1] for more details. Since WSO2 ESB embeds Synapse,
> this documentation should be applicable to Synapse as well.
>
> From all the statistics provided via JMX, for your usecase you might find
> NHTTP latency statistics useful.
>
> [1]
> http://wso2.org/project/esb/java/4.0.3/docs/monitoring.html#JMXMonitoring
>
> Thanks,
> Sadeep
>
> On Fri, Feb 24, 2012 at 8:01 AM, Yogesh Sagar <yo...@gmail.com>
> wrote:
>
> > Hello,
> >
> > I am trying to do some performance monitoring on some of the endpoints.
> How
> > can I monitor performance in synapse? Is there a JMX support in Synapse?
> My
> > thoughts are to write a in mediator which will basically record the start
> > time etc etc and then wrote the out mediator which would measure
> > performance or gather statistics. Any ideas or pointers is very much
> > appreciated.
> >
> > Thanks,
> > Yogesh
> >
>
>
>
> --
>
> Sadeep Jayasumana
>
> **
>
> Email: gayansadeep@gmail.com****
>
> Mobile: +61 4 1468 8521
>
Re: Performance Monitoring
Posted by Sadeep Jayasumana <ga...@gmail.com>.
Hi,
Yes, Synapse does have JMX monitoring capabilities. Please refer to WSO2
ESB's monitoring guide [1] for more details. Since WSO2 ESB embeds Synapse,
this documentation should be applicable to Synapse as well.
>From all the statistics provided via JMX, for your usecase you might find
NHTTP latency statistics useful.
[1]
http://wso2.org/project/esb/java/4.0.3/docs/monitoring.html#JMXMonitoring
Thanks,
Sadeep
On Fri, Feb 24, 2012 at 8:01 AM, Yogesh Sagar <yo...@gmail.com> wrote:
> Hello,
>
> I am trying to do some performance monitoring on some of the endpoints. How
> can I monitor performance in synapse? Is there a JMX support in Synapse? My
> thoughts are to write a in mediator which will basically record the start
> time etc etc and then wrote the out mediator which would measure
> performance or gather statistics. Any ideas or pointers is very much
> appreciated.
>
> Thanks,
> Yogesh
>
--
Sadeep Jayasumana
**
Email: gayansadeep@gmail.com****
Mobile: +61 4 1468 8521