Bug 534339 (RHQ-1145)

Summary: Add logging to the agent comms layer to flag really big messages
Product: [Other] RHQ Project Reporter: Charles Crouch <ccrouch>
Component: Communications SubsystemAssignee: John Mazzitelli <mazz>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: hbrock
Target Milestone: ---Keywords: Task
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-1145
Whiteboard:
Fixed In Version: 1.2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Charles Crouch 2008-11-20 00:47:00 UTC
Coming out of RHQ-1131 it would be good to know if there are any other api's we are calling from the agent that could potentially ship a ton of data across the wire.

I guess JBossRemotingRemoteCommunicator would be the place to do this, either by serializing every Command we send out or doing something more fancy:

http://www.jroller.org/maxim/entry/again_about_determining_size_of
http://weblogs.java.net/blog/mister__m/archive/2007/01/measuring_the_s.html

Maybe there is even some JBoss remoting setting you could turn on to show you this.

Either way we would obviously want to only run with this enabled during our testing.

Comment 1 John Mazzitelli 2008-11-20 03:16:19 UTC
I can easily add this to my current command tracing facility:

http://support.rhq-project.org/display/RHQ/Design-DebuggingCommunications

I'll add some addition ideas on that page on how to log message sizes and perhaps log special messages when sizes exceed a certain amount.

Comment 2 John Mazzitelli 2008-11-20 05:11:21 UTC
adding two new system properties you can enable to trace sizes.  From that wiki:

rhq.trace-command-size-threshold : If set, this is the maximum size of commands that can flow into and out of the comm layer without generating a warning message in the log. If a command is larger than this value (defined in bytes), a WARN level message will be logged in logs/command-trace.log. If this is set, this also will generate ERROR level messages if the command is not serializable.

rhq.trace-command-response-size-threshold : If set, this is the maximum size of command responses that can flow into and out of the comm layer without generating a warning message in the log. If a command response is larger than this value (defined in bytes), a WARN level message will be logged in logs/command-trace.log. If this is set, this also will generate ERROR level messages if the response is not serializable.

If you want to see all sizes of all messages, just set those sys props to 0 (thus, no matter what size the message is, they will be over the threshold and thus be logged).  If you only want to see outgoing command sizes, just set the command-size-threshold prop and not the response one.

If you only want to see commands larger than 1M, set the command-size-threshold to 1000000.

Note you can set these either from agent command line (-D...) or from the agent prompt (setconfig) - see the wiki for more. Use setconfig to turn the size threshold logging on and off during agent run time (changing the prop values takes immediate effect).

Comment 3 John Mazzitelli 2008-11-20 05:13:01 UTC
svn rev 2041.

Comment 4 Red Hat Bugzilla 2009-11-10 20:24:53 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1145