tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Delbecq <delbd+jaka...@oma.be>
Subject Re: WebApp really slow, Where do I start looking?
Date Fri, 01 Jun 2007 11:12:12 GMT
Queueing request will get you in same situation as if you put a big
synchronized block around all your code. You should reduce the size of
synchronized block to the smallest amount of time possible to limit
threads waiting (and as such avoid long working synchronized methods).
If possible, if an object is synchronized and takes time to work,
duplicate this object in each request instead of sharing one amongst all
users. Most of the time, your code won't need lots synchronized blocks
(for example, if data are stored on a db, use one separate connection
for each request instead of having an accessor object sharing connection
amongst users).

En l'instant précis du 01/06/07 12:25, Stéphane Hanser s'exprimait en
ces termes:
> You are right about synchronized blocks. I removed every synchronized
> instruction for tests purposes and it "unleashed the cpu" ;)
>
> It may be a problem with memory too. By disabling the cache of iBatis I
> noticed an overloading of the CPU, which is understandable considering the
> circumstance.
>
> However, removing some synchronized blocks will cause concurrent access
> issues when a user "mass clicks". Is it possible to configure tomcat to
> queue one's requests instead of executing the in parallel ?
>
> Thanks,
>
> Stéphane H.
>
> PS: thanks for the jmeter tip ;)
>
>
> -----Message d'origine-----
> De : David Delbecq [mailto:delbd+jakarta@oma.be] 
> Envoyé : vendredi 1 juin 2007 10:59
> À : Tomcat Users List
> Objet : Re: WebApp really slow, Where do I start looking?
>
> Considering CPU usage, it is not
> 1) a java memory problem, if java memory was full, garbage collector
> would start using lots of cpu
> 2) a time consuming java code.
>
> It might be one of following
> 1) synchronized blocks in your code, that would prevent 2 simultaneoous
> users from doing some operations.
> 2) use of SingleThreadModel, which has same effect as above
> 3) Network congestion, you server simply can't send the response to
> client due to a too small network pipe (80 requests / second resulting
> each in an about 20k response need a bandwidth of more than 12Mbits)
> 4) A too small physical memory on system. Eg you configure tomcat to use
> 1G memory but your server has only 512M available, resulting in memory
> pagination (swap) and sleeping of java process during pagination process
> (typically, on unix server, you will see a high % of CPU dedicated to
> system instead of idle when this happen)
>
>
> One way to test your server performance during heavy is to use apache
> jmeter.
>
>
> En l'instant précis du 01/06/07 10:48, Stéphane Hanser s'exprimait en
> ces termes:
>   
>> Hello,
>>
>> I've been working on my project for months now, it is my first WebApp
>> project. Yesterday, I deployed the project on my dedicated server and
>> a soon as I reached about 80 users, the webapp became really slow.
>> However, the cpu usage of the server was very low (never more than
>> 15-20%). I have no idea of what is the cause of this slowness (server
>> config, bad programming..).
>>
>> Can someone help me to diagnostic the problem? Where shoul I start
>> looking?
>>
>> thanks in advance,
>>
>> Stéphane H.
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message