Databases Reference
In-Depth Information
3.
Apply the same changes to web.xml of liferay-node-02 .
4.
Start both the Liferay Portal nodes.
By default, Tomcat's JSP engine runs in the development mode. In the development
mode, the JSP engine frequently polls the filesystem for changes. In the production
environment, the frequency of JSP file changes is very low. Hence, JSP engine's
development mode adds overhead on the server. We disabled the development
mode by setting it to false . By default, the Jasper JSP engine converts the JSP file
to the servlet in such a way that each line of JSP becomes a print statement. This
feature helps in debugging issues but affects the performance of the server. We
disabled this option by configuring the false value for the mappedFile parameter.
If text strings in JSP are generated as character arrays, it can improve the
performance. We enabled this by adding the genStrAsCharArray parameter.
Thread pool configuration
In Chapter 2 , Load Balancing and Clustering Best Practices , we learned about the AJP
connector of the Liferay Portal Tomcat server. We configured ports of the AJP
connector. We configured the Apache Web Server to connect with the Liferay Portal
Tomcat server using the AJP port. For every request, the Tomcat server creates a
worker thread. The Tomcat server maintains a pool of worker threads for better
performance. It is very important to configure this thread pool very carefully. If the
thread pool is configured with a limited number of threads, requests will be queued
up in a waiting state. If the thread pool is oversized, it will consume more server
resources and ultimately affect the performance of the system. It is recommended to
configure the initial thread pool configuration in the server.xml file as follows:
<Connector port="8019" maxHttpHeaderSize="8192"
maxThreads="50" minSpareThreads="50" maxSpareThreads="50"
enableLookups="false" acceptCount="100" redirectPort="8443"
protocol="AJP/1.3"
connectionTimeout="20000" disableUploadTimeout="true"
URIEncoding="UTF-8" />
In the preceding configuration, we have set the maximum number of threads in the
thread pool to 50 . This is the initial configuration and during the load test we need to
tune this value. We also configured the maximum allowed waiting requests if all the
worker threads are occupied by using the acceptCount attribute. We also configured
the connection timeout for worker threads.
Please refer to the following URL for more details on connector attributes:
http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html
 
Search WWH ::




Custom Search