users@glassfish.java.net

Re: Performance issues with AJAX

From: Gerald Holl <gerald_at_holl.co.at>
Date: Wed, 14 Nov 2007 17:13:32 +0100

Jeanfrancois Arcand wrote:
> Hi,
>
> Gerald Holl wrote:
>> Hello folks,
>>
>> Our app uses a lot of Ajax stuff, e. g. if a key is pressed in a text
>> field we're setting a changed flag in the bean.
>> If a user is typing something in the text field the CPU load is about
>> 20-30%. This is definitely too high, so I set some parameters in
>> domain.xml:
>> <http-listener acceptor-threads="2" address="0.0.0.0"
>> blocking-enabled="false" default-virtual-server="server"
>> enabled="true" family="inet" id="http-listener-2" port="443"
>> security-enabled="true" server-name="" xpowered-by="true">
>>
>> As far as I know "acceptor-threads" should be set to the number of
>> CPUs [1]. The Glassfish doc recommends something with 50 threads or so
>> [2]. I think that's wrong, please correct the documentation.
>
> I would leave it to 1. Does it make a difference?

Not really. CPU load doesn't differ if acceptor-threads is set to 1 or 2.

>>
>> <request-processing header-buffer-length-in-bytes="8192"
>> initial-thread-count="50" request-timeout-in-seconds="30"
>> thread-count="400" thread-increment="10"/>
>> <connection-pool max-pending-count="-1" queue-size-in-bytes="-1"
>> receive-buffer-size-in-bytes="4096" send-buffer-size-in-bytes="8192"/>
>>
>> The CPU load is still about 20-30%. On Tomcat the load was < 5%.
>> What parameters can I tune else? Or should I increase the thread-count?
>
> One thing (kind of unrelated) I would recommend you to look at to
> improve performance is the following:
>
> http://weblogs.java.net/blog/jfarcand/archive/2007/06/improving_ajax_1.html
>
> As for the CPU, Can you reduce the thread-count to 100, set the
> accpetor-thread to 1 and see if that help?

If I reduce the thread-count the CPU load increases. So I better set it
back to 400 or so again.


cheers,
Gerald