On 12/03/2019 16:05, Supun Abeysinghe wrote: > Hi all, > > I am working on a project where the parameters of the tomcat server (e.g. > MaxThreads, MinSpareThreads, MaxSpareThreads etc.) for a given web > application is auto-tuned using a machine learning technique by looking at > the runtime characteristics (e.g. workload characteristics, current > performance etc.). As of my knowledge, the typical way of setting these > parameters is by changing the server.xml inside the {catalina-home}/conf > folder. In order to reconfigured/tuned values to get updated, we need to > restart the tomcat server. However, the project that I'm working on > requires the ability to change the parameters dynamically while the system > is running. > > I have looked into several approaches. One way is to use JMX and use the > setters to set the parameter values. I have tried setting the MaxThreads > parameter of the shared executor thread pool and it seems to be working > fine. Now I'm looking into using that approach and set it up in my source > code and access MBeans to change the parameters. > > I just wanted to know whether I'm going in the right direction. Also, is > there any other easier way of achieving what I want? I have gone through > prior work in this research area and seen many people have tuned tomcat > parameters in such a fashion. However, there seems to be no docs/articles > on this topic. Am I missing something here? Any feedback is highly > appreciated!
JMX is the right approach. Just keep in mind that changes to some parameters don't take effect until the component is restarted. You might want to consider using http://tomcat.apache.org/tomcat-9.0-doc/config/listeners.html#StoreConfig_Lifecycle_Listener_-_org.apache.catalina.storeconfig.StoreConfigLifecycleListener to persist any changes you make. The other thing to keep in mind is that most of the time is spent in application code so you normally get a bigger return for your investment if you focus on application tuning. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org