dev@glassfish.java.net

Re: Why Monitoring/Management GrizzlyAdapter deploys on all http-listener (port)?

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 28 Aug 2009 17:35:28 -0400

Salut,

Rajeshwar Patil wrote:
> Jeanfrancois Arcand wrote:
>> Salut,
>>
>> Prashanth Abbagani wrote:
>>> Jeanfrancois,
>>>
>>> I need to understand this more. The monitoring level for http-service
>>> (under module-monitoring-levels) is turned off by default. So, there
>>> shouldn't be any overhead related to monitoring on Grizzly side.
>>
>> Not Grizzly, v3 in that case.
>>
>> Can you
>>> please give me more details for the following statement.
>>>
>>> /"We have observed some performance regressions recently at runtime
>>> and one reason is the fact that the Monitoring & Management support
>>> (implemented as GrizzlyAdapter) are *always* registered as
>>> startup. "/
>>
>> When v3 starts, the monitoring/management code register two
>> GrizzlyAdapter:
>>
>> * http://is.gd/2E99F
>>
>> implementation to the grizzly-kernel:
>>
>> org.glassfish.admin.rest.RestMonitoringAdapter
>> org.glassfish.admin.rest.RestManagementAdapter
>>
>> Those Adapter are needed to supports the REST management/monitoring
>> requests to <host>:<port>/management or /monitoring via http or a
>> (that's how it works right now).
>>
>> The issue is those two must not be registered to listen on port 8080,
>> 8181, etc., but only on port 4848:
>>
>> http://localhost:4848/management (works)
>> http://localhost:8080/management (must not works)
>>
>> The issue is if there is more than one GrizzlyAdapter deployed let's
>> say on port 8080, the request must be mapped against (1) The Container
>> and (2) Web Application. If the is a single grizzlyAdapter we don't
>> have to execute (1). So to keep the mapping operations as minimal as
>> possible, we try to only have a single GrizzlyAdapter on port
>> 8080,8181, etc by default --> it's the CoyoteAdapter, for servicing
>> Servlet/JSP.
>>
>> Another example is JRubyAdapter in the GF gems...it will also suffer
>> the same issue as there is two extra GrizzlyAdapter now, hence
>> operations (1) happens on all requests.
>>
>> So it's simple to fix on the monitoring/management code by registering
>> only to the admin port.
> Hello Jeanfrancois,
> Yes, we have to fix this.
> I do not see any method to provide port in
> org.glassfish.api.container.Adapter or com.sun.grizzly.tcp.Adapter. How
> do we provide these ports?

Great! So we need to register only on the admin port. Right now we don't
have any generic API for getting the port out of the Adapter, but I
would recommend we create a new interface which will return that
information like the Admin Adapter(s) are doing right now:

kernel/src/main/java/com/sun/enterprise/v3/services/impl/GrizzlyService.java:397

All you need to do is to create an interface for
getListenPort/getVirtualServer/getContextRoot/isRegistered.

and implement it using the RestAdapter base class.

Eventually all Admin Adapter should implements that interface so we
don't have to switch between AdminAdapter and AdminConsoleAdapter like
it does right now in GrizzlyService.

A+

-- Jeanfrancois



>
> Thanks
> Rajeshwar
>
>>
>> Hope that help.
>>
>> -- Jeanfrancois
>>
>>>
>>>
>>> thanks
>>> Prashanth
>>>
>>> Jeanfrancois Arcand wrote:
>>>> Hi,
>>>>
>>>> we recently observed a performance regression when
>>>> monitoring/management got enabled:
>>>>
>>>> * https://glassfish.dev.java.net/issues/show_bug.cgi?id=9286
>>>>
>>>> The problem is the GrizzlyAdapter used for implementing the features
>>>> are registered on port 8080, 8181, etc. Should they be only
>>>> registered on port 4848 like all the GrizzlyAdapter used by to
>>>> support admin? Why do they need to be available on all port?
>>>>
>>>> Thanks
>>>>
>>>> -- Jeanfrancois
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>