WebReference.com - Chapter 16 of Java Servlets Developer's Guide, from Osborne/McGraw-Hill (4/4) | WebReference

WebReference.com - Chapter 16 of Java Servlets Developer's Guide, from Osborne/McGraw-Hill (4/4)

To page 1To page 2To page 3current page
[previous]

Java Servlets Developer's Guide

Tune Your Servlet Container

The servlet container you are using may also provide you with opportunities for optimization. Since there are numerous servlet containers, and they are all quite different in the way they are managed and configured, I will simply provide you with some general suggestions of areas that you might be able to tune:

In addition to these general suggestions I would advise you to read the documentation for the servlet container you are using for other tuning parameters.

Tune Your Virtual Machine

Perhaps one of the easiest ways to boost the performance of your servlet container is to tune the Virtual Machine. In most cases, you can increase the initial size of the heap. But be careful: Using a larger heap size decreases the frequency of garbage collection by the VM, but increases the time that the garbage collector takes when it does run. The heap size is controlled by the –mx option, but you should check the documentation for the particular VM you are using before attempting to modify the size of the heap.

Summary

In this chapter, we have focused on ways to ensure that your servlet performance is at a level that keeps your users happy. There are lots of common performance pitfalls when using Java, such as String concatenation or synchronization, that can have a negative impact on your application. Simply being aware of these pitfalls, and how to work around them, can help you to write efficient servlets.

Once you have written your servlets, there are also ways to boost performance by tuning the servlet container you are using, as well as the underlying Virtual Machine.


To page 1To page 2To page 3current page
[previous]

Created: July 31, 2002
Revised: July 31, 2002

URL: https://webreference.com/programming/java/servletsguide/4.html