Sun Microsystems 820434310 - Manuals
Sun Microsystems 820434310 – Manual in PDF format online.
Manuals:
Manual Sun Microsystems 820434310
Summary
Contents Preface ...................................................................................................................................................13 1 Overview of Enterprise Server Performance Tuning ..................................................................... 17 Process O...
Tuning Tips for Specific Types of EJB Components ............................................................... 42 JDBC and Database Access ......................................................................................................... 46 Tuning Message-Driven Beans .........................
Figures FIGURE 1–1 Java EE Application Model ....................................................................................... 20 7
Tables TABLE 1–1 Performance Tuning Roadmap ............................................................................... 17 TABLE 1–2 Factors That Affect Performance ............................................................................. 24 TABLE 3–1 Bean Type Pooling or Caching ..............
Examples EXAMPLE 4–1 Heap Configuration on Solaris ................................................................................ 89 EXAMPLE 4–2 Heap Configuration on Windows ........................................................................... 90 11
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 ...
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....
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...
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...
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...
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...
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...
■ 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...
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...
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...
▼ 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...
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...
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...
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...
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...
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...
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 ...
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...
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...
■ 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...
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...
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...
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...
... </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...
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...
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...
■ 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 ...
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 ...
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 ...
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...
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 ...
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...
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...
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...
■ 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...
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...
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...
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 ...
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...
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...
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...
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...
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, ...
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...
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...
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 ...
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...
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...
■ 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...
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...
++++++++++++++++++++++++++++++ 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...
▼ 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...
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...
■ “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 ...
■ 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...
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...
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...
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...
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...
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...
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...
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...
■ 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...
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 ...
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...
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...
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...
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...
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...
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...
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 ...
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...
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...
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...
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 ...
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...
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...
■ 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 ...
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...
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...
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...
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...
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 ...
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...
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...
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...
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...
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 ...
Sun Microsystems Manuals
-
Sun Microsystems B1600
Manual
-
Sun Microsystems 7
Manual
- Sun Microsystems V120 Manual
-
Sun Microsystems AC200
Manual
-
Sun Microsystems Sun Quad
Manual
- Sun Microsystems 60 Manual
-
Sun Microsystems SG-XPCIE1FC-EM8-Z
Manual
-
Sun Microsystems 10
Manual
-
Sun Microsystems 4000
Manual
-
Sun Microsystems 96257
Manual
-
Sun Microsystems T3
Manual
-
Sun Microsystems 819468310
Manual
-
Sun Microsystems 2000E
Manual
-
Sun Microsystems SPARCcenter 2000
Manual
-
Sun Microsystems X4140
Manual
-
Sun Microsystems X6250
Manual
- Sun Microsystems 2500 Manual
-
Sun Microsystems GigaSwift Ethernet Adapter
Manual
-
Sun Microsystems 805-7945-10
Manual
-
Sun Microsystems A5000
Manual