users@grizzly.java.net

Re: Performance Settings

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Tue, 27 Nov 2007 13:05:49 -0500

Alan Williamson wrote:
> Oleksiy Stashok wrote:
>> Pls. take a look here at Jeanfrancois'es blog [1]. Seems by default
>> compression is set to "off", so it needed to be switched "on".
>> [1]
>> http://weblogs.java.net/blog/jfarcand/archive/2006/06/enabling_http_c_1.html
>
>
> Great thank you. You are right, it is set to off out of the box. I
> added this, and GZip'ing did indeed burst into life.
>
>
> st.setCompression("on");
> st.setCompressionMinSize( 14000 );

Indeed :-)

>
>
> Although, i can't seem to get a handle to how much data was sent to the
> client when gziping. I thought this maybe may tell me, but it prints 0
> and -1 respectfully.
>
>
> public void afterService(Request arg0, Response res) throws Exception {
> System.out.println(
> "afterService: getBytesWritten=" + res.getBytesWritten() +
> "; getContentLength=" + res.getContentLength() );
> }
>
>
> I want to log how much data we are saving by GZIP'ing and the percentage
> of clients that actually received GZIP content. Very useful data this.

You can monitor a lot of data (but it reduce a little bit the
performance) by invoking:

st.enableMonitoring();

Grizzly will start collection a lot of information. You can grab the
statistic by doing:

st.getRequestGroupInfo().getXXX()

(the class is located under
grizzly-http/src/main/java/com/sun/grizzly/tcp/RequestGroupInfo.java

Let me know if that's not what you are looking at.

>
> Any advice gratefully received. I am loving this Grizzly so far, and
> while the documentation in the JavaDocs is thin on the ground, i am
> discovering that Jeanfrancois blog is the place to be!

Keep the question coming! We all know the docs is lacking, but we are
working hard to improve it!

Thanks!

- Jeanfrancois



>
> thanks
>
> a
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>