...
Info |
---|
Poorly Tuned InstancesIn this second scenario, we will run a JMeter test which execute 5000 requests against both Tomcat instances whereby we will not change the configuration of the AJP connector from the default values and where we have a maximum of 10 database connections in the pool to service database requests. We can view the AJP connector settings, database pool settings and JVM heap settings used below. 1) AJP Connector configuration
2) Database Pool Configuration
3) JVM SettingsWe have set the minimum and maximum heap size to 1GB respectively as below: export CATALINA_OPTS="-Xms1024m -Xmx1024m" 4) ResultsAlthough JMeter provides us with some useful performance statistics, we will use JConsole to monitor the performance of the test. We can observe below in Figures 2 and 3 that the maximum time to process a request out of 1878 requests processed by one of the Tomcat servers took 4858 milliseconds - whereby it took 373041 milliseconds to process 1878 requests. In Figure 3, we can find out metrics for each of the AJP threads used to process requests. We have provided an example of just one here whereby it took just 73 milliseconds to process the last request,whilst the maximum time to process any single request on this thread took 4744 milliseconds.
Optimized Tomcat InstancesIn this final test scenario, we will perform some basic tuning on both Tomcat instances to the AJP connector configuration in server.xml, the connection pool configuration described in context.xml and the JVM heap size allocated to each Tomcat instance. 1) AJP Connector configurationThe AJP connector configuration below is configured so that there are two threads allocated to accept new connections. This should be configured to the number of processors on the machine however two should be suffice here. We have also allocated 400 threads to process requests, the default value is 200. The "acceptCount" is set to 100 which denotes the maximum queue length to be used for incoming connections. The default value is 10. Lastly we have set the minimum threads to 20 so that there are always 20 threads running in the pool to service requests:
2) Database Pool ConfigurationWe have modified the maximum number of pooled connections to 200 so that there are ample connections in the pool to service requests.
3) JVM SettingsSince we have increased the maximum number of pooled connections and AJP connector thread thresholds above, we should increase the heap size appropriately. We have set the minimum and maximum heap size to 2GB respectively as below: export CATALINA_OPTS="-Xms2048m -Xmx2048m" 4) ResultsWe can observe from the JConsole Mbean metrics below there is a significant improvement in performance. The maximum time it took to process a request is 2048 milliseconds, and the overall processing time to handle 3464 requests is 206741 milliseconds. If we observe the result sin Figure 5 from an individual AJP thread, we can observe it took 46 milliseconds to process the last request whereby the maximum time it took to process a request on this thread is 1590 miliseconds. This particular thread has processed 141 requests whereby it took a total time of 5843 milliseconds to process these requests. Figure 4: GlobalRequestProcessor Mbean Attribute Values Figure 5: RequestProcessor Mbean Attribute Values For more details on Tomcat 8 connector parameters, please visit this this link at Apache -- source https://www.c2b2.co.uk/middleware-blog/tomcat-performance-monitoring-and-tuning.php |
Part 3 - Security and other deployment concerns
Thanks to Bradley Andersen for information from Magnolia Developers Unconference 2017
Info |
---|
Best practices for a secure Magnolia environment
--source https://documentation.magnolia-cms.com/display/DOCS/Security+best+practices |
TBC.
References
https://wiki.apache.org/tomcat/HowTo/FasterStartUp
...
https://www.c2b2.co.uk/middleware-blog/tomcat-performance-monitoring-and-tuning.php
https://documentation.magnolia-cms.com/display/DOCS/Security+best+practices