-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

McAfe,

On 5/26/2011 12:00 AM, McAfe wrote:
> And I've changed to following (the result did not improve or any better
> sign)
>     MaxClients           256
>
> [snip]
>
>     <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" 
>               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"/>

You're going to want MaxClients = maxThreads, so set maxThreads="256", here.

>     <Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" 
>       enableLookups="false" disableUploadTimeout="true"
>                connectionTimeout="20000" 
>                redirectPort="8443" />

Are you sure you're using mod_jk? HTTP/1.1 over port 8080 does not smell
like a mod_jk configuration.

> The scenario testing in Jmeter, before that in the tomcat I've 3 different
> webapps (The Jmeter testing have 3 HTTP request and each point to each
> webapps in the tomcat)
> 
> 1) Number of thread = 200 and ramp-up period=1
>    Result: Test 10 / Pass 10
> 2) Number of thread = 300 and ramp-up period=1
>    Overall result: Test 10 each test will get 3%~5% error (but the tomcat /
> apache still working)
>    * The error is java.net.ConnectException: Connection refused: connect

With 256 connections available and 300 trying to connect, it's not
surprising that you are getting errors at this stage.

> 3) Number of thread = 500 and ramp-up period=1
>    Overall result: Test 10 each test will get 20%~50% error (but the tomcat
> / apache still working)
>    * The error is java.net.ConnectException: Connection refused: connect

Same issue here: you just don't have enough connections on the server to
handle the load. This is what your clients will experience if you were
to experience this much load in production.

You have three options:

1. Increase the number of connections you allow. That's easy: just raise
   MaxClients and maxThreads. Note that if you run out of server
   resources (threads/processes, CPU time, memory, I/O throughput),
   this won't help at all.... you will have just hit a wall.

2. Increase the acceptCount on the <Connector> (if you are using Tomcat
   only) or ListenBacklog (if you are using Apache httpd). This will
   allow the OS's TCP stack to accept more connections and queue them
   while waiting for your webapp's connections to become free.
   Note that if you are handling sustained load, this also doesn't
   help at all, because your accept queue will always be full.

3. Improve your web application. Try consulting a profiler or, if you
   are heavily relying on a database, consult a DBA. You may just have
   to increase the number of connections that your /database/ can
   handle. If you want to serve 1000 simultaneous requests, but your
   DB connection pool only has 10 connections, then 990 of those
   requests will be sitting there waiting for the database to be
   available.

4. Improve your infrastructure. Buy more/better servers, use
   load-balancing, etc.

> My plan is to target Number of thread = 1000 and ramp-up period =1 (I no
> idea this can it be done) and the result is 100% if possible (so I can have
> the benchmarks)
> 
> In the same time I will look on database connection, thank you as yesterday
> you have giving the tips of IO part and worry when grab data from database
> it may delay.

Performance can be improved by looking at the types of queries you are
running, considering indexing, caching, etc. Only you know what can
benefit your application. I'm sure there are lots of folks on the list
(myself included) who would be happy to get paid to help you evaluate
your own webapp and make specific suggestions.

If it's not directly related to Tomcat (and in this case, it's almost
certainly not), interest on this list for completely free help is
somewhat limited. :)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3eWs4ACgkQ9CaO5/Lv0PBq1wCffNbOpYD7GJx8Oxr+OE0PQgNW
OXYAn3jJ4RxWzoez1GuVRF7Rm0QhG2u2
=LtaO
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to