Page 3 - Contents; Preface
Contents Preface ...................................................................................................................................................13 1 Overview of Enterprise Server Performance Tuning ..................................................................... 17 Process O...
Page 4 - Tuning the Enterprise Server
Tuning Tips for Specific Types of EJB Components ............................................................... 42 JDBC and Database Access ......................................................................................................... 46 Tuning Message-Driven Beans .........................
Page 7 - Figures
Figures FIGURE 1–1 Java EE Application Model ....................................................................................... 20 7
Page 9 - Tables
Tables TABLE 1–1 Performance Tuning Roadmap ............................................................................... 17 TABLE 1–2 Factors That Affect Performance ............................................................................. 24 TABLE 3–1 Bean Type Pooling or Caching ..............
Page 11 - Examples
Examples EXAMPLE 4–1 Heap Configuration on Solaris ................................................................................ 89 EXAMPLE 4–2 Heap Configuration on Windows ........................................................................... 90 11
Page 13 - Sun GlassFish Enterprise Server Documentation Set
Preface The Performance Tuning Guide describes how to get the best performance with EnterpriseServer. This preface contains information about and conventions for the entire Sun GlassFish TM Enterprise Server documentation set. Sun GlassFish Enterprise Server Documentation Set TABLE P–1 Books in the ...
Page 15 - Symbol Conventions
Typographic Conventions The following table describes the typographic changes that are used in this book. TABLE P–3 Typographic Conventions Typeface Meaning Example AaBbCc123 The names of commands, files, anddirectories, and onscreen computeroutput Edit your .login file. Use ls -a to list all files....
Page 16 - Third-Party Web Site References; Sun Welcomes Your Comments
TABLE P–4 Symbol Conventions (Continued) Symbol Description Example Meaning → Indicates menu itemselection in a graphical userinterface. File → New → Templates From the File menu, choose New.From the New submenu, chooseTemplates. Documentation, Support, and Training The Sun web site provides informa...
Page 17 - Process Overview
Overview of Enterprise Server PerformanceTuning You can significantly improve performance of the Sun GlassFish Enterprise Server and ofapplications deployed to it by adjusting a few deployment and server configuration settings.However, it is important to understand the environment and performance go...
Page 18 - Performance Tuning Sequence; Tune your application, described in
TABLE 1–1 Performance Tuning Roadmap (Continued) Step Description of Task Location of Instructions 3 Installation: If you are using HADB for sessionpersistence, ensure that the HADB software isinstalled. Installation Guide 4 Deployment: Install and run your applications.Familiarize yourself with how...
Page 19 - Application Architecture
Understanding Operational Requirements Before you begin to deploy and tune your application on the Application Server, it is importantto clearly define the operational environment. The operational environment is determined byhigh-level constraints and requirements such as: ■ “Application Architectur...
Page 21 - Security Requirements; User Authentication and Authorization; Encryption
Security Requirements Most business applications require security. This section discusses security considerations anddecisions. User Authentication and Authorization Application users must be authenticated. The Application Server provides three differentchoices for user authentication: file-based, L...
Page 22 - Hardware Resources
■ What is the nature of the applications with respect to security? Do they encrypt all or only apart of the application inputs and output? What percentage of the information needs to besecurely transmitted? ■ Are the applications going to be deployed on an application server that is directly connect...
Page 23 - Administration
Administration A single Application Server installation on a server can encompass multiple instances. A groupof one or more instances that are administered by a single Administration Server is called a domain . Grouping server instances into domains permits different people to independently administ...
Page 24 - Capacity Planning
TABLE 1–2 Factors That Affect Performance Concept In practice Measurement Value sources User Load Concurrentsessions atpeak load Transactions Per Minute (TPM) Web Interactions Per Second(WIPS) (Max. number of concurrent users) * (expected response time) /(time between clicks) Example: (100 users * 2...
Page 25 - To Determine Capacity; Determine performance on a single CPU.; User Expectations
▼ To Determine Capacity Determine performance on a single CPU. First determine the largest load that a single processor can sustain. You can obtain this figure bymeasuring the performance of the application on a single-processor machine. Either leveragethe performance numbers of an existing applicat...
Page 27 - Tuning Your Application; Java Programming Guidelines; Avoid Serialization and Deserialization; Use StringBuffer to Concatenate Strings
Tuning Your Application This chapter provides information on tuning applications for maximum performance. Acomplete guide to writing high performance Java and Java EE applications is beyond the scopeof this document. This chapter discusses the following topics: ■ “Java Programming Guidelines” on pag...
Page 28 - Assign null to Variables That Are No Longer Needed; Declare Constants as static final; Avoid Finalizers
String str = " testing " ; str = str + " abc " ; The compiler translates this code as: String str = " testing " ; StringBuffer tmp = new StringBuffer(str); tmp.append( " abc " ); str = tmp.toString(); Therefore, copying is inherently expensive and overusing it can red...
Page 29 - Declare Method Arguments final; Synchronize Only When Necessary
Declare Method Arguments final Declare method arguments final if they are not modified in the method. In general, declare all variables final if they are not modified after being initialized or set to some value. Synchronize Only When Necessary Do not synchronize code blocks or methods unless synchr...
Page 30 - Suggested Coding Practices; General Guidelines
Suggested Coding Practices This section provides some tips on coding practices that improve servlet and JSP applicationperformance. General Guidelines Follow these general guidelines to increase performance of the presentation tier: ■ Minimize Java synchronization in servlets. ■ Don’t use the single...
Page 31 - Configuration and Deployment Tips; Optimize SSL; Disable Security Manager
Configuration and Deployment Tips Follow these configuration tips to improve performance. These tips are intended for productionenvironments, not development environments. ■ To improve class loading time, avoid having excessive directories in the server CLASSPATH . Put application-related classes in...
Page 32 - Goals; Increased speed; Decreased memory consumption; Improved functional properties; Monitoring EJB Components
EJB Performance Tuning The Enterprise Server’s high-performance EJB container has numerous parameters that affectperformance. Individual EJB components also have parameters that affect performance. Thevalue of individual EJB component’s parameter overrides the value of the same parameter forthe EJB ...
Page 34 - Monitoring Individual EJB Components
collection is happening too frequently, and the pool size is growing, but the cache hit rate issmall, then the pool-idle-timeout-in-seconds can be reduced to destroy the instances. Note – Specifying a max-pool-size of zero (0) means that the pool is unbounded. The pooled beans remain in memory unles...
Page 35 - Use High Performance Beans; Use Caching; Cache EJB references; Cache home interfaces
To find the possible objects (applications, modules, beans, and methods) and object attributesthat can be monitored, use the Admin Console. For more information, see Chapter 18, “Monitoring Components and Services,” in Sun GlassFish Enterprise Server 2.1 Administration Guide . Alternatively, use the...
Page 36 - Cache EJB resources; Use the Appropriate Stubs; Remove Unneeded Stateful Session Beans; Using Local and Remote Interfaces
■ Cache EJB resources : Use setSessionContext() or ejbCreate() to cache bean resources. This is again an example of using bean lifecycle methods to perform application actions onlyonce where possible. Remember to release acquired resources in the ejbRemove() method. Use the Appropriate Stubs The stu...
Page 37 - Prefer Local Interfaces
Prefer Local Interfaces An EJB component can have remote and local interfaces. Clients not located in the sameapplication server instance as the bean (remote clients) use the remote interface to access thebean. Calls to the remote interface require marshalling arguments, transportation of themarshal...
Page 38 - Improving Performance of EJB Transactions
semantics. See “Value Added Features” in Sun GlassFish Enterprise Server 2.1 Developer’s Guide for more details about the pass-by-reference flag. To specify that an EJB component will use pass by reference semantics, use the following tag inthe sun-ejb-jar.xml deployment descriptor: <pass-by-refe...
Page 39 - Using Special Techniques; Version Consistency
source are going to be involved in a transaction. If a database participates in some distributedtransactions, but mostly in local or single database transactions, it is advisable to register twoseparate JDBC resources and use the appropriate resource in the application. Configure JDBC Resources as O...
Page 41 - Request Partitioning; To enable request partitioning; Add the additional threadpool IDs to the Application Server’s ORB.
... </cmp-field-mapping> <consistency> <check-version-of-accessed-instances> <column-name>OrderTable.VC_VERSION_NUMBER</column-name> </check-version-of-accessed-instances> </consistency> </entity-mapping> In addition, you must establish a trigger on th...
Page 42 - Tuning Tips for Specific Types of EJB Components; Entity Beans
For example, enable threadpools named priority-1 and priority-2 to the <orb> element as follows: <orb max-connections= " 1024 " message-fragment-size= " 1024 " use-thread-pool-ids= " thread-pool-1,priority-1,priority-2 " > Include the threadpool ID in the use-thre...
Page 43 - Checkpoint only when needed; Stateless Session Beans
to the steady load of users), beans would be frequently passivated and activated, causing anegative impact on the response times, due to CPU intensive serialization and deserialization aswell as disk I/O. Another important variable for tuning is cache-idle-timeout-in-seconds where at periodic interv...
Page 44 - Refresh period
■ Database rows represented by the bean do not change. ■ The application can tolerate using out-of-date values for the bean. For example, an application might use a read-only bean to represent a list of best-seller books.Although the list might change occasionally in the database (say, from another ...
Page 46 - JDBC and Database Access; Use JDBC Directly
Pre-fetching generally improves performance because it reduces the number of databaseaccesses. However, if the business logic often uses Orders without referencing their OrderLines,then this can have a performance penalty, that is, the system has spent the effort to pre-fetch theOrderLines that are ...
Page 47 - Tuning Message-Driven Beans; Tune the Message-Driven Bean’s Pool Size
Reduce the database transaction isolation level when appropriate. Reduced isolation levelsreduce work in the database tier, and could lead to better application performance. However,this must be done after carefully analyzing the database table usage patterns. Set the database transaction isolation ...
Page 49 - Deployment Settings
Tuning the Enterprise Server This chapter describes some ways to tune the Enterprise Server for optimum performance,including the following topics: ■ “Deployment Settings” on page 49 ■ “Logger Settings” on page 50 ■ “Web Container Settings” on page 51 ■ “EJB Container Settings” on page 53 ■ “Java Me...
Page 51 - Session Properties: Session Timeout
General Settings In general, writing to the system log slows down performance slightly; and increased disk access(increasing the log level, decreasing the file rotation limit or time limit) also slows down theapplication. Also, make sure that any custom log handler doesn’t log to a slow device like ...
Page 52 - Manager Properties: Reap Interval; Disable Dynamic JSP Reloading
Manager Properties: Reap Interval Modifying the reap interval can improve performance, but setting it without considering thenature of your sessions and business logic can cause data inconsistency, especially fortime-based persistence-frequency. For example, if you set the reap interval to 60 second...
Page 53 - Monitoring the EJB Container; Tuning the EJB Container; Overview of EJB Pooling and Caching
EJB Container Settings The EJB Container has many settings that affect performance. As with other areas, use monitorthe EJB Container to track its execution and performance. Monitoring the EJB Container Monitoring the EJB container is disabled by default. Enable monitoring with the AdminConsole unde...
Page 54 - Tuning the EJB Pool; EJB Pool Settings; Initial and Minimum Pool Size
Note – If you develop and deploy your EJB components using Sun Java Studio, then you need to edit the individual bean descriptor settings for bean pool and bean cache. These settings mightnot be suitable for production-level deployment. Tuning the EJB Pool A bean in the pool represents the pooled st...
Page 55 - Pool Idle Timeout; Tuning the EJB Cache; EJB Cache Settings
■ Pool Idle Timeout : the maximum time that a stateless session bean, entity bean, or message-driven bean is allowed to be idle in the pool. After this time, the bean is destroyed ifthe bean in case is a stateless session bean or a message driver bean. This is a hint to server.The default value is 6...
Page 56 - Pool and Cache Settings for Individual EJB Components
Max Cache Size Maximum number of beans in the cache. Make this setting greater than one. The default value is 512. Avalue of zero indicates the cache is unbounded, which means the size of the cache is governed by CacheIdle Timeout and Cache Resize Quantity. The corresponding EJB deployment descripto...
Page 57 - Commit Option; Determining the best commit option
TABLE 3–2 EJB Cache and Pool Settings (Continued) Cache Settings Pool Settings Type ofBean cache-resize-quantity max- cache-size cache-idle-timeout-in-seconds removal-timeout- in-seconds victim-selection-policy refresh-period-in-seconds steady-pool-size pool-resize-quantity max-pool-size pool-idle-t...
Page 58 - Transaction Service Settings; Monitoring the Transaction Service; Viewing Monitoring Information
than cache misses, then option B is an appropriate choice. You might still have to change the max-cache-size and cache-resize-quantity to get the best result. If the cache hits are too low and cache misses are very high, then the application is not reusingthe bean instances and hence increasing the ...
Page 59 - Tuning the Transaction Service; Disable Distributed Transaction Logging
asadmin get -m serverInstance.transaction-service.* The following statistics are gathered on the transaction service: ■ total-tx-completed Completed transactions. ■ total-tx-rolled-back Total rolled back transactions. ■ total-tx-inflight Total inflight (active) transactions. ■ isFrozen Whether trans...
Page 60 - Keypoint Interval; Monitoring the HTTP Service
Recover On Restart (Automatic Recovery) To set the Recover on Restart attribute with the Admin Console, go to Configurations > config-name > Transaction Service. Click the Recover check box to set it to true (checked, the default) or false (un-checked). You can also set automatic recovery with...
Page 61 - Enabled
With asadmin , use the following command to list the monitoring parameters available: list --user admin --port 4848 -m server-instance-name .http-service.* where server-instance-name is the name of the server instance. Use the following command to get the values: get --user admin --port 4848 -m serv...
Page 64 - Access Log; Request Processing
Connection Queue ■ Total Connections Queued: Total connections queued is the total number of times aconnection has been queued. This includes newly accepted connections and connectionsfrom the keep-alive system. ■ Average Queuing Delay: Average queueing delay is the average amount of time a connecti...
Page 66 - Buffer Length; Keep Alive; Max Connections
Buffer Length The size (in bytes) of the buffer used by each of the request processing threads for reading therequest data from the client. Adjust the value based on the actual request size and observe the impact on performance. Inmost cases the default should suffice. If the request size is large, ...
Page 67 - Time Out; HTTP Protocol; DNS Lookup Enabled; HTTP File Cache
Time Out Time Out determines the maximum time (in seconds) that the server holds open an HTTP keepalive connection. A client can keep a connection to the server open so that multiple requests toone server can be serviced by a single network connection. Since the number of openconnections that the se...
Page 69 - Tuning HTTP Listener Settings; Network Address
Tuning HTTP Listener Settings Change HTTP listener settings in the Admin Console under Configurations > config-name > HTTP Service > HTTP Listeners > listener-name . Network Address For machines with only one network interface card (NIC), set the network address to the IPaddress of the m...
Page 70 - Overview; How a Client Connects to the ORB; Monitoring the ORB
ORB Settings The Enterprise Server includes a high performance and scalable CORBA Object Request Broker(ORB). The ORB is the foundation of the EJB Container on the server. Overview The ORB is primarily used by EJB components via: ■ RMI/IIOP path from an application client (or rich client) using the ...
Page 71 - Connection Statistics; Tuning the ORB
set serverInstance.iiop-service.orb.system.monitoringEnabled=true reconfig serverInstance Connection Statistics The following statistics are gathered on ORB connections: ■ total-inbound-connections Total inbound connections to ORB. ■ total-outbound-connections Total outbound connections from ORB. Us...
Page 72 - Tunable ORB Parameters
TABLE 3–3 Tunable ORB Settings (Continued) RMI/ IIOP from ORB to Enterprise Server communicationinfrastructure, threadpool steady-thread-pool-size, max-thread-pool-size,idle-thread-timeout-in-seconds RMI/ IIOP from a vendor ORB parts of communicationinfrastructure, threadpool steady-thread-pool-size...
Page 73 - Client ORB Properties; Controlling connections between client and server ORB
■ Minimum Pool Size: The minimum number of threads in the ORB thread pool. Set to theaverage number of threads needed at a steady (RMI/ IIOP) load. ■ Maximum Pool Size: The maximum number of threads in the ORB thread pool. ■ Idle Timeout: Number of seconds to wait before removing an idle thread from...
Page 74 - Load Balancing; Thread Pool Sizing
Load Balancing For information on how to configure RMI/IIOP for multiple application server instances in acluster, Chapter 9, “RMI-IIOP Load Balancing and Failover,” in Sun GlassFish Enterprise Server 2.1 High Availability Administration Guide . When tuning the client ORB for load-balancing and conn...
Page 75 - Improving ORB Performance with Java Serialization
++++++++++++++++++++++++++++++ Message(Thread[ORB Client-side Reader, conn to 192.18.80.118:1050,5,main]): createFromStream: type is 4 < MessageBase(Thread[ORB Client-side Reader, conn to 192.18.80.118:1050,5,main]): Message GIOP version: 1.2 MessageBase(Thread[ORB Client-side Reader, conn to 192...
Page 76 - To Enable Java Serialization; Using JSG for Application Clients
▼ To Enable Java Serialization You must set this property on all servers that you want to use JSG. In the tree component, expand the Configurations node. Expand the desired node. Select the JVM Settings node In the JVM Settings page, choose the JVM Options tab. Click Add JVM Option, and enter the fo...
Page 77 - JDBC Connection Pool Settings; Monitoring JDBC Connection Pools; Tuning JDBC Connection Pools
is not offered in a Unix/Linux user interface. However, it is possible to edit the OS-scheduledthread pools and add new thread pools, if needed, using the Admin Console. Resources ■ “JDBC Connection Pool Settings” on page 77 ■ “Connector Connection Pool Settings” on page 80 JDBC Connection Pool Sett...
Page 78 - Pool Size Settings; Timeout Settings; Max Wait Time
■ “Timeout Settings” on page 78 ■ “Isolation Level Settings” on page 79 ■ “Connection Validation Settings” on page 79 Pool Size Settings The following settings control the size of the connection pool: Initial andMimimum PoolSize Size of the pool when created, and its minimum allowable size. Maximum ...
Page 79 - Idle Timeout; Isolation Level Settings; Transaction Isolation Level; Connection Validation Settings
■ Idle Timeout : Maximum time in seconds that a connection can remain idle in the pool. After this time, the pool can close this connection. This property does not controlconnection timeouts on the database server. Keep this timeout shorter than the database server timeout (if such timeouts are conf...
Page 80 - Connector Connection Pool Settings; Transaction Support
ConnectionValidationRequired If true, the pool validates connections (checks to find out if they are usable) before providing them to anapplication. If possible, keep the default value, false. Requiring connection validation forces the server to apply thevalidation algorithm every time the pool retu...
Page 83 - Tuning the Java Runtime System; Java Virtual Machine Settings
Tuning the Java Runtime System This chapter discusses the following topics: ■ “Java Virtual Machine Settings” on page 83 ■ “Managing Memory and Garbage Collection” on page 84 ■ “Further Information” on page 91 Java Virtual Machine Settings J2SE 5.0 provides two implementations of the HotSpot Java vi...
Page 84 - Tuning the Garbage Collector
Managing Memory and Garbage Collection The efficiency of any application depends on how well memory and garbage collection aremanaged. The following sections provide information on optimizing memory and allocationfunctions: ■ “Goals” on page 32 ■ “Tracing Garbage Collection” on page 86 ■ “Other Garb...
Page 85 - Make sure that the system is not using 100 percent of its CPU.; Additional Information
When the new generation fills up, it triggers a minor collection in which the surviving objectsare moved to the old generation. When the old generation fills up, it triggers a major collectionwhich involves the entire object heap. Both HotSpot and Solaris JDK use thread local object allocation pools...
Page 86 - Tracing Garbage Collection; Other Garbage Collector Settings
Tracing Garbage Collection The two primary measures of garbage collection performance are throughput and pauses . Throughput is the percentage of the total time spent on other activities apart from GC. Pausesare times when an application appears unresponsive due to GC. Two other considerations are f...
Page 87 - Tuning the Java Heap; Guidelines for Java Heap Sizing
Although applications can explicitly invoke GC with the System.gc() method, doing so is a bad idea since this forces major collections, and inhibits scalability on large systems. It is best todisable explicit GC by using the flag -XX:+DisableExplicitGC . The Enterprise Server uses RMI in the Adminis...
Page 88 - Heap Tuning Parameters
memory structures. The difference between the maximum address space and the total of thosevalues is the amount of memory that can be allocated to the heap. You can improve performance by increasing your heap size or using a different garbagecollector. In general, for long-running server applications...
Page 89 - Survivor Ratio Sizing; Rebasing DLLs on Windows
■ Decide the total amount of memory you can afford for the JVM. Accordingly, graph yourown performance metric against young generation sizes to find the best setting. ■ Make plenty of memory available to the young generation. The default is calculated from NewRatio and the -Xmx setting. ■ Larger ede...
Page 90 - To rebase the Application Server’s DLLs; Make; the default directory.; utility to make sure the DLLs were rebased correctly.; Restart the Application Server.; Heap Configuration on Windows
To prevent load address collisions, set preferred base addresses with the rebase utilty that comeswith Visual Studio and the Platform SDK. Use the rebase utility to reassign the base addresses ofthe Application Server DLLs to prevent relocations at load time and increase the availableprocess memory ...
Page 93 - Tuning the Operating System and Platform; Server Scaling; Processors
Tuning the Operating System and Platform This chapter discusses tuning the operating system (OS) for optimum performance. It discussesthe following topics: ■ “Server Scaling” on page 93 ■ “Solaris 10 Platform-Specific Tuning Information” on page 95 ■ “Tuning for the Solaris OS” on page 95 ■ “Linux C...
Page 95 - Solaris 10 Platform-Specific Tuning Information; Tuning Parameters
Solaris 10 Platform-Specific Tuning Information Solaris TM Dynamic Tracing (DTrace) is a comprehensive dynamic tracing framework for the Solaris Operating System (OS). You can use the DTrace Toolkit to monitor the system. TheDTrace Toolkit is available through the OpenSolaris TM project from the DTr...
Page 96 - Sizing the Connection Hash Table
TABLE 5–1 Tuning Parameters for Solaris (Continued) Parameter Scope Default Tuned Value Comments tcp_conn_req_max_q ndd /dev/tcp 128 1024 tcp_conn_req_max_q0 ndd /dev/tcp 1024 4096 tcp_ip_abort_interval ndd /dev/tcp 480000 60000 tcp_keepalive_interval ndd /dev/tcp 7200000 900000 For high traffic web...
Page 97 - File Descriptor Setting
File Descriptor Setting On the Solaris OS, setting the maximum number of open files property using ulimit has the biggest impact on efforts to support the maximum number of RMI/IIOP clients. To increase the hard limit, add the following command to /etc/system and reboot it once: set rlim_fd_max = 81...
Page 99 - File Descriptors; IP Stack Settings
Some of the values depend on the system resources available. After making any changes to /etc/system , reboot the machines. File Descriptors Add (or edit) the following lines in the /etc/system file: set rlim_fd_max=65536 set rlim_fd_cur=65536 set sq_max_size=0 set tcp:tcp_conn_hash_size=8192 set au...
Page 101 - Virtual Memory
cputime unlimited filesize unlimited datasize unlimited stacksize 8192 kbytes coredumpsize 0 kbytes memoryuse unlimited descriptors 1024 memorylocked unlimited maxproc 8146 openfiles 1024 The openfiles and descriptors show a limit of 1024. To increase the limit to 65535 for all users, edit /etc/secu...
Page 102 - Network Interface; To tune disk I/O performance for non SCSI disks; Check the speed again using the; To tune the TCP/IP settings; Add the following entry to
Network Interface To ensure that the network interface is operating in full duplex mode, add the following entryinto /etc/rc.local : mii-tool -F 100baseTx-FD eth0 where eth0 is the name of the network interface card (NIC). Disk I/O Settings ▼ To tune disk I/O performance for non SCSI disks Test the ...
Page 103 - Add the following to; Add the following as the last entry in; Tuning Operating System and TCP Settings
Add the following to /etc/sysctl.conf # Disables packet forwarding net.ipv4.ip_forward = 0 # Enables source route verification net.ipv4.conf.default.rp_filter = 1 # Disables the magic-sysrq key kernel.sysrq = 0 net.ipv4.ip_local_port_range = 1204 65000 net.core.rmem_max = 262140 net.core.rmem_defaul...
Page 105 - Disk Configuration; Network Configuration; Start Options
Disk Configuration If HTTP access is logged, follow these guidelines for the disk: ■ Write access logs on faster disks or attached storage. ■ If running multiple instances, move the logs for each instance onto separate disks as muchas possible. ■ Enable the disk read/write cache. Note that if you en...
Page 107 - Tuning for High-Availability; Tuning HADB; Disk Use; Calculating HADB Data Device Size
Tuning for High-Availability This chapter discusses the following topics: ■ “Tuning HADB” on page 107 ■ “Tuning the Enterprise Server for High-Availability” on page 116 ■ “Configuring the Load Balancer” on page 120 Tuning HADB The Application Server uses the high-availability database (HADB) to stor...
Page 108 - Tuning Data Device Size
If the database runs out of device space, the HADB returns error codes 4593 or 4592 to theEnterprise Server. Note – See Sun Java System Application Server Error Message Reference for more information on these error messages. HADB also writes these error messages to history files. In this case, HADB ...
Page 109 - Placing HADB files on Physical Disks; Memory Allocation
Note – hadbm does not add data devices to a running database instance. Placing HADB files on Physical Disks For best performance, data devices should be allocated on separate physical disks. This applies ifthere are nodes with more than one data device, or if there are multiple nodes on the same hos...
Page 110 - Performance; DataBufferPoolSize; hadbm deviceinfo
Performance For best performance, all HADB processes ( clu_xxx_srv ) must fit in physical memory. They should not be paged or swapped. The same applies for shared memory segments in use. You can configure the size of some of the shared memory segments. If these segments are toosmall, performance suf...
Page 111 - Tuning DataBufferPoolSize; LogBufferSize
■ FreeSize: free size in MB. ■ Usage: percent used. Use the hadbm resourceinfo command to monitor resource usage, for example the following command displays data buffer pool information: %hadbm resourceinfo --databuf NodeNo Avail Free Access Misses Copy-on-write 0 32 0 205910260 8342738 400330 1 32 ...
Page 112 - Tuning LogBufferSize; InternalLogbufferSize
The log records remain in the buffer until they are processed locally and shipped to the mirrornode. The log records are kept until the outcome (commit or abort) of the transaction is certain.If the HADB node runs low on tuple log, the user transactions are delayed, and possibly timedout. Tuning Log...
Page 113 - Tuning InternalLogbufferSize; NumberOfLocks
Large BLOBs necessarily allocate many disk blocks, and thus create a high load on the nodeinternal log. This is normally not a problem, since each entry in the nilog is small. Tuning InternalLogbufferSize Begin with the default value. Look out for HIGH LOAD informational messages in the history file...
Page 114 - Calculating the number of locks; Summary; Tuning NumberOfLocks
Calculating the number of locks To calculate the number of locks needed, estimate the following parameters: ■ Number of concurrent users that request session data to be stored in HADB (one sessionrecord per user) ■ Maximum size of the BLOB session ■ Persistence scope (max session data size in case o...
Page 115 - Timeouts; JDBC connection pool timeouts; Load Balancer timeouts
For example, the output displayed by this command might look something like this: Node No. Avail Free Waits 0 50000 50000 na 1 50000 50000 na ■ Avail: Number of locks available. ■ Free: Number of locks in use. ■ Waits: Number of transactions that have waited for a lock.“na” (not applicable) if all l...
Page 116 - HADB timeouts; Operating System Configuration
For more information on configuring the load balancer plug-in, see “Configuring the HTTP Load Balancer” in Sun GlassFish Enterprise Server 2.1 High Availability Administration Guide . HADB timeouts The sql_client time out value may affect performance. Operating System Configuration If the number of ...
Page 117 - Tuning Session Persistence Frequency
Tuning Session Persistence Frequency The Enterprise Server provides HTTP session persistence and failover by writing session data toHADB. You can control the frequency at which the server writes to HADB by specifying thepersistence frequency. Specify the persistence frequency in the Admin Console un...
Page 118 - Session Persistence Scope; session; Session Size
Session Persistence Scope You can specify the scope of the persistence in addition to persistence frequency on the samepage in the Admin Console where you specify persistence frequency, Configurations > config-name > Availability Service (Web Container Availability). For detailed description o...
Page 119 - Checkpointing Stateful Session Beans
It is important to pay attention while determining the HTTP session size. If you are creatinglarge HTTP session objects, calculate the HADB nodes as discussed in “Tuning HADB” on page 107 . Checkpointing Stateful Session Beans Checkpointing saves a stateful session bean (SFSB) state to the HADB so t...
Page 120 - Enabling the Health Checker; url
For optimal performance, use a pool with eight to 16 connections per node. For example, if youhave four nodes configured, then the steady-pool size must be set to 32 and the maximum poolsize must be 64. Adjust the Idle Timeout and Pool Resize Quantity values based on monitoringstatistics. For the be...
Page 123 - Index
Index A Acceptor Threads, 69access log, 64AddrLookups, 62application architecture, 19scalability, 24tuning, 27 arrays, 27authentication, 21authorization, 21automatic recovery, 60Average Queuing Delay, 64 B B commit option, 57bandwidth, 94benchmarking, tuning Solaris for, 104best practices, 27Buffer ...