Tips for using prefetch with Apache Tomcat
The more forms you add to prefetch, the more time you must allow for a graceful shutdown of Tomcat. If Tomcat crashes or the server is shut down before Tomcat saves any open prefetch files, the prefetch restarts upon reboot, leading to slow response and a possible system crash if others try to use it while it is fetching again.
Remember these tips when using prefetch with Apache Tomcat:
- Increase the Tomcat shutdown time and thread stack sizes to enable the efficient serialization of your forms. This action gives Tomcat extra time to save prefetch files.
- Raise the maximum memory size of Tomcat (for example, 1024 MB).
- Flush the Tomcat cache. Restart Tomcat, and let it run. This action could take several hours to finish.
- Monitor the amount of memory actually needed and lower the number accordingly.
- Include only the front-end user facing forms in the prefetch.
- Include the user name that is the most common group combination in the prefetch file. Using the Admin user might not be appropriate as the users belonging to other groups triggers the HTML generation on the mid tier.
- Watch the Tomcat process to make sure you are not keeping the JVM busy with the memory swap. If possible, allocate the min and max as 2 GB so that the Tomcat process starts up with the full memory available.
Because the memory requirements depend on how many forms are being loaded, you must calculate the amount of memory needed based on the application stack and the usage of your deployment.