| < Day Day Up > |
Figure 4-3 shows the typical application flow for Web browser
Figure 4-3:
Application flow
Below we review the above figure:
A Web client
The request is routed to the Web server over the Internet.
The Web server immediately
The WebSphere plug-in examines the URL, verifies the list of host
A stream is created. A stream is a connection to the Web container. It is possible to maintain a connection (stream) over a number of requests. The Web container receives the request and, based on the URL, dispatches it to the proper servlet.
If the servlet class is not loaded, the dynamic class loader loads the servlet. Servlet init() , then doGet() or doPost() .
JNDI is now used for lookup of either datasources or EJBs required by the servlet.
Depending upon whether a datasource is specified or an EJB is
To the corresponding database, and get a connection from its connection pool in the case of a datasource
To the corresponding EJB container, which then instantiates the EJB, when an EJB is requested
If the EJB requested involves an SQL transaction, it will go back to the JNDI to look up the datasource.
The SQL statement will be executed and the data retrieved will be sent back:
To the servlet
To the EJB
Data beans are created and handed off to JSPs in the case of EJBs.
Servlet sends data to JSPs.
The JSP generates the HTML that is sent back through the WebSphere plug-in to the Web server.
The Web server sends the output page (output html) to the browser.
| < Day Day Up > |
| < Day Day Up > |
In Chapter 2, "Overview of WebSphere Application Server V5" on page 19, we have described that WebSphere Application Server provides support for the multi-
A variety of factors come into play when considering the appropriate topology. The selection criteria typically include a review of your requirements in the following factors:
Security
Performance
Throughput
Scalability
Availability
Maintainability
Session management
Performance involves minimizing the response time for a given transaction load. Although a number of factors relating to application design can affect performance, one or both of the following techniques are commonly used to improve the performance:
Vertical scaling
Involves creating additional application server processes on a single physical machine, providing for software/application server
Horizontal scaling
Involves creating additional application server processes on multiple physical machines to take advantage of the additional processing power available on each machine. This provides hardware fail-over support and allows an administrator to spread the cost of an implementation across multiple physical machines.
The starting scenario is the configuration where all components reside on the same machine, as shown in Figure 4-4. The Web server routes
Figure 4-4:
Single machine topology
Some reasons to use a single machine topology are:
Maintainability: Easy to install and maintain.
This configuration is most suitable as a startup configuration in order to evaluate and test the basic functionality of WebSphere and
Performance, security, and availability are not critical goals.
This may be the case for development, testing, and some intranet environments. We are limited to the resources of a single machine, which are shared by all components.
Low cost.
Consider the following when you use a single machine topology:
Performance: Components'
All components
Security: No isolation
There is no explicit layer of isolation between the components.
Availability: Single point of failure
This configuration is a single point of failure.
When compared to a configuration where the application server and the HTTP server are collocated on a single physical server, separation of the application server and the HTTP server can be utilized to provide varying degrees of improvement in:
Performance
Process isolation
Security
This configuration is
Figure 4-5:
Separating HTTP server
The WebSphere V5.0 HTTP plug-in allows the HTTP server to be physically separated from the application server. It uses an XML configuration file (plugin-cfg.xml) containing settings that describe how to handle and pass on requests to the WebSphere Application Server(s).
WebSphere Application Server
In the simple single machine configuration described in "Single machine topology" on page 90, the application database and WebSphere Application Server reside on the same machine. However, installing the DB2 UDB server on a different machine, creating a two-tier configuration (as illustrated in Figure 4-6), represents a good practice, with several advantages.
Figure 4-6:
Separating the DB2 server
Some reasons to separate the database server are:
Performance: Less competition for resources
If both the DB2 UDB and WebSphere Application server are placed on the same machine, then you have two programs: The application server and the DB2 UDB server, competing for increasingly
Performance: Differentiated tuning
By separating the servers, we can independently tune the machines that host the database server and the application server to achieve optimal performance for each other. The database server is typically
On many UNIX servers, installing the database involves modification of the OS kernel. This
Availability: Use of already established highly available database servers
Many organizations have invested in high-availability solutions for their database servers, reducing the possibility of the server being a single point of failure in a system.
Maintainability: Independent installation/re-configuration
Components can be re-configured, or even
Consider the following when using a remote database server:
Network access may limit performance
Depending upon the network hardware and remoteness of the database server, the network response time for communication between WebSphere Application Server and the database server may limit the performance of WebSphere. When collocated on the same server, network response is not an issue.
Architectural complexity
Hosting the database server on a separate machine introduces yet another box that must be administered,
Maintainability: Complexity of configuration
Remote database access requires more complex configuration, setting up
Cost
The cost of a separate machine for database server may not be justified for the environment in which the WebSphere Application Server will be installed.
Depending on how your application is architected, it can be advantageous to physically separate the application server where your servlets run from your EJB application servers. An example topology for this configuration is illustrated in Figure 4-7.
Figure 4-7:
Separated Web container and EJB container
Some reasons to separate the Web container and the EJB container are:
Performance: Less competition for resources
Performance gains can occur for applications consisting of business objects that are accessed
Security
When running in an environment where two firewalls are employed, you can provide the same level of security for Entity EJBs as is provided for application data.
Vertical scaling provides a straightforward mechanism for creating multiple instances of an application server, and hence multiple JVM processes. In the simplest case, one can create many application servers on a single machine, and this single machine also runs the HTTP server process. This configuration is illustrated in Figure 4-8.
Figure 4-8:
Vertical scaling
Some reasons to use vertical scaling are:
Performance: Better use of the CPU.
An instance of an application server runs in a single Java Virtual Machine (JVM) process. However, the inherent concurrency limitations of a JVM process may prevent it from fully
Availability: Fail-over support in a cluster.
A vertical scaling topology also provides process isolation and fail-over support within an application server cluster. If one application server instance goes offline, the requests can be redirected to other instances on the machine to process.
Throughput: WebSphere workload management.
Vertical scaling topologies can make use of the WebSphere Application Server workload management facility. The HTTP server plug-in distributes requests to the Web containers and the ORB distributes requests to EJB containers.
Maintainability: Easy-to-administer member application servers.
With the concept of
Maintainability: Vertical scalability can easily be combined with other topologies.
We can implement vertical scaling on more than one machine in the configuration. (IBM WebSphere Application Server Network Deployment V5.0 must be installed on each machine.) We can combine vertical scaling with the other topologies described in this chapter to boost performance and throughput. This assumes, of course, that sufficient CPU and memory are available on the machine.
Cost: Does not require additional machines.
Consider the following when using vertical scaling:
Availability: Machine still a single point of failure.
Single machine vertical scaling topologies have the drawback of introducing the host machine as a single point of failure in the system. However, this can be avoided by using horizontal scaling on multiple machines.
Performance: Scalability limited to a single machine. Scalability is limited to the resources available on a single machine.
Horizontal scaling exists when the
Figure 4-9:
Horizontal scaling with clusters
The WebSphere HTTP server plug-in distributes requests to cluster member application servers on the application server nodes.
Horizontal scaling using clusters has the following advantages:
Availability
Provides the increased throughput of vertical scaling topologies but also provides fail-over support. This topology allows handling of application server process failures and hardware failures without significant interruption to client service.
Throughput
Optimizes the distribution of client requests through mechanisms such as workload management or remote HTTP transport.
Horizontal scaling using clusters has the following disadvantages:
Maintainability: With the concept of cells and clusters in IBM WebSphere Application Server Network Deployment V5.0, it is easy to administer multiple application servers from a single point. However, there is more installation and maintenance associated with the additional machines.
Cost: More machines.
If the application maintains state between HTTP requests and we are using vertical or horizontal scaling, then we must consider using an appropriate strategy for session management.
Each application server runs in its own JVM process. To allow a fail-over from one application server to another without logging out users, we need to share the session data between multiple processes. There are two different ways of doing this in IBM WebSphere Application Server Network Deployment V5.
Provides replication of session data between the process memory of different application server JVMs. A Java Message Service (JMS) based publish/subscribe mechanism, called Data Replication Service (DRS), is used to provide assured session replication between the JVM processes. DRS is included with IBM WebSphere Application Server Network Deployment V5 and is automatically started when the JVM of a clustered (and properly configured) application server starts.
Session data is stored in a database shared by all application servers.
Memory-to-memory replication has the following advantages and disadvantages compared to database persistence:
Memory-to-memory replication is faster by virtue of the high performance messaging implementation used in WebSphere V5.
No separate database product is required. But normally you will use a database product anyway for your application, so this might not be an inhibitor.
If you have a memory constraint, using database session persistence rather than memory-to-memory replication might be the better solution. There are also several options to optimize memory-to-memory replication.
Persistent session should be enabled in some scenarios. Please refer to Chapter 8, "DB2 UDB V8 and WAS V5 integrated performance" on page 287, for more details.
These considerations for topology selection are not
|
Security |
Performance |
Throughput |
Maintainability |
Availability |
Session |
|
|---|---|---|---|---|---|---|
|
Single machine |
Little isolation between components |
Competition for machine resources. |
Limited to machine resources. |
Ease of installation and maintenance. |
Machine is single point of failure. |
|
|
Remote HTTP Server |
Allows for firewall/ DMZ |
Separation of loads. Performance usually better than local DB server. |
Independent tuning. |
Independent configuration and component replacement. More administrative overhead. Need copy of plugin-cfg.xml file. |
Introduces single point of failure. |
|
|
Separate DB2 UDB server |
Firewall can provide isolation |
Separation of loads. Performance usually better than local DB server. |
Independent tuning. Must consider network bottleneck. |
Use already established DBA procedures. Independent configuration. More administrative overhead. |
Introduces single point of failure. Use already established HA servers. |
|
|
Separate Web/EJB container |
More options for firewall |
Typically slower than single JVM. |
Clustering can improve throughput. |
More administrative overhead. |
Introduces single point of failure. |
|
|
Vertical scaling |
Improved throughput on large SMP servers. |
Limited to resources on a single machine. |
Easiest to maintain. |
Process isolation Process redundancy. |
May use session affinity. Memory-to -memory session replication. Persistent session database for session fail-over. |
|
|
Horizontal scaling |
Distribution of load. |
Distribution of connections. |
More to install/maintain. Code migrations to multiple nodes. |
Process and hardware redundancy. |
May use session affinity. Memory-to -memory session replication. Persistent session database for session fail-over. |
|
|
Add HTTP server |
Distribution of load. |
Distribution of connections. |
More to install/maintain. |
Best in general. |
Use load balancers. SSL session ID affinity when using SSL. |
|
|
One domain |
Ease of maintenance. |
|||||
|
Multiple domains |
Less lookups and interprocess communication. |
Harder to maintain than single domain. |
Process hardware and software redundancy. |
| < Day Day Up > |