Web Application Checklist


The actual web application design and implementation play the most critical performance role for a high-performance web site. You cannot overcome a poor application with hardware tuning. Here is a checklist containing the critical do's and don'ts for the web application. Please refer to Chapters 2 and 3 for more information on each of these elements.

Servlets

Short code paths.

Each servlet returns a few basic page choices.

Multi-threaded model (don't implement SingleThreadModel ).

Acquire static resources at initialization (JNDI lookup for datasource, and so on).

Check for unnecessary "synchronized" statements.

Synchronization used only for small , rapidly executing sections of code.

Java Server Pages

Use JSPs for output. (Don't use servlets to create HTML or XML.)

Turn off reload interval (or at least make it infrequent).

Remove default HTTP session object creation ( <% page session= "false"%> ). [1]

[1] This assumes that automatic HTTP session creation is not required by your application.

Pre-compile or pre-click JSPs.

JavaBeans

Avoid the bean.instantiate() method.

Use a database to persist data.

XML/XSL

Use JSPs to generate XML.

Be aware of server cost for parsing XML.

Offload page assembly to client machine if possible.

Static Content

Use HTTP server.

Avoid file-serving servlet.

Logging

Support and use logging levels.

Reduce production logging.

Make logging runtime configurable.

Consider buffered writing.

Limit memory requirements of buffer.

Avoid the servlet.log() method.

Avoid the System.out.println() method.

HTTP Session

Keep session objects small.

Persist data that needs to be persisted (keep HTTP sessions small).

Reduce HTTP session timeout.

Support a logout function.

Keep HTTP session working set in memory.

Make HTTP session data serializable.

Avoid nontransferable data.

Enterprise JavaBeans

Use Stateless Session Beans as fa §ades (avoid direct servlet interaction with Entity Bean).

Avoid fine-grained EJB data models.

Mark methods as read-only.

Use local interfaces for co-located beans.

Use lowest acceptable transaction isolation level.

Consider scalability issues of Stateful Session Beans and Entity Beans.

Cache Bean content in custom finders .

Cache homes .

Remove unused Stateful Session Beans (avoid EJB passivation).

Web Services

Use UDDI with care.

Minimize SOAP data transfers.

Monitor changing web site usage patterns.

Database Connection

Use vendor-supplied database connection pool capabilities.

Return database connections to the pool quickly.

Close all connections.

Check exception paths to avoid connection leaks.

Object Pools

Create custom object pools if your application launches threads.

Use configurable limits.

Never wait indefinitely within pool (avoid freezing the web site).

Plan for back-end outages.

Be especially careful with asynchronous MOM access.

Set pool "hard maximums."

Set timeouts for retrieving connections.

Garbage Collection

Minimize garbage collection.

Check for memory leaks (especially from hash tables).

Minimize object creation.

Use StringBuffer objects for concatenation.

Use ResourceBundle or Singleton object for String literals.

Avoid dynamic allocation (use static final whenever possible).

Check for unused local variables .

Pool and reuse objects.



Performance Analysis for Java Web Sites
Performance Analysis for Javaв„ў Websites
ISBN: 0201844540
EAN: 2147483647
Year: 2001
Pages: 126

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net