简体   繁体   中英

tomcat 8.0.32 - Performance Tuning in Server.xml configuration in production server

Presently I have deployed my grails war file in tomcat 8.0, with ubuntu OS with 2 GB RAM.

I wish to know the configuration required to alter in below code like maxConnections and maxThread, etc, inorder to improve the performance.

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>

And also, I wish to know maximum number of concurrent users, where tomcat can handle.

I have read the tomcat documentation, which I could not able to understand most of the things.

Any help is appreciated.

"It depends" (TM)

The maximum number of connections that tomcat can access - just as the number of concurrent users - fully depends on what your application is doing: It might calculate fractal images for every single request, or it might just show static content. You know best what your application does, and you know what hardware your server has.

Some applications are CPU-heavy, others are limited by RAM, or DB performance or I/O. Measure yours. Then raise or lower the number or accepted connections according to your measures. Adjust the allocated memory. Tune your database. Add another network adapter. All these activities of course only, if your measures show that this fixes the bottleneck you found during debugging.

Bringing in the points from my comment: This is what it depends on (incomplete list) - even if you'd answer every single bullet point, it'll still be impossible to predict a number:

  • The nature of your application
  • Available memory (and use of virtual memory in the OS)
  • Processor speed
  • the JVM version you're using
  • Memory and Garbage Collector settings for your JVM
  • disc speed
  • Network connections: If all clients connect through very slow networks, they'll keep the connections open for longer
  • timing of your RAM chips
  • network latency
  • request answering time (duration of request handling - that's your application)
  • use of caches (eg by the application, but also CPU-caches)
  • what else is running on your computer
  • how many threads the OS allows tomcat to allocate
  • and many other items more.

There is no definitive answer to this question - at all. You will have to measure your installation yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM