>
"Repository Properties Reference" in EAServer System Administration Guide
Transaction Processing Model
If a component performs updates to a noncritical database (for example, logging usage statistics that are not considered as mission-critical data) you can choose Not Supported as the component's transaction attribute to eliminate the overhead of using two-phase commit.
"Transactional component attribute" in EAServer Programmer's Guide
Timeouts on method calls, instances, and transactions
By default, EAServer will wait indefinitely for component methods to complete, for instances to be released, and for open transactions to be completed.
If desired, you can set a maximum number of seconds that EAServer should wait for these events. You can set defaults at the server-level, and override the defaults at the component-level. When a specified maximum is reached, EAServer will returning an exception to the client.
Timeout Category
Server-level default
Component-level setting
Transactions
server.tx_timeout
component.tx_timeout
Instances
server.timeout
component.timeout
Methods
component.maxwait (*)
(All of the above properties are prefixed by com.sybase.jaguar.)
(*) Note: Network latency between client and server is not included in the measured method execution time. Although for C++ components running in an external process, the measured time does include interprocess communication latency.
"Component properties: Resources" in EAServer Programmer's Guide
Service Components
Category
Performance Considerations
More Information
Concurrency and Bind Thread Options
For best performance, enable the Concurrency option and disable the Bind Thread option.
- Concurrency allows multiple method invocations to occur simultaneously, which can decrease client response time. Also, if your component has a run() method that executes indefinitely, you must enable the Concurrency option or no clients will be able to invoke methods.
- Disabling the Bind Thread option allows EAServer to run the component on any available thread. (This option should only be enabled for ActiveX components and components that use thread-local storage.)
"Creating Service components" in EAServer Programmer's Guide
java">
Java Components
Follow these suggestions for all types of Java components and applications.
Category
Performance Considerations
More Information
Result sets and JDBC Statements
If you use the Java Connection Manager (jcm) classes, you must explicitly clean up java.sql.Statement objects to avoid memory leaks. Before releasing a connection back into the cache, call Statement.close() and set the Statement reference to null.
"Using Java Connection Manager classes" in EAServer Programmer's Guide
Java Performance Analysis
Several profiling tools are available to help identify bottlenecks, memory leaks, and other performance issues in a Java components, applications, and applets. Profiling can help you identify code that needs to be modified or removed for performance reasons.
Setting up OptimizeIt for Use with EAServer
Memory Management within Java Processes
Java 2 java.sun.com/developer/onlineTraining/Programming/JDCBook/perf3.html#os">Performance Analysis on Java Developer Connection
Log4j
Only set logging to verbose for debugging purposes, since it can potentially slow performance.
Java World article: log4j, a fast and flexible logging API for Java
EJBs
For EJBs, follow these suggestions in addition to the ones provided for Java components, and for components in general.
Category
Performance Considerations
More Information
Intercomponent Calls
The EJB 2.0 architecture introduces local interfaces for calls to an EJB component from within the same Java Virtual Machine. In EAServer, you can use local interfaces for intercomponent calls, and for component invocations made from Servlets and JSPs hosted by the same server as the component.
Using local interfaces can improve performance, but in coding you must be aware that parameters are passed by reference rather than by copy, so object instances passed through a local invocation can be shared by the client and component, and that the called component must be hosted in the same server process as the calling component since Local interfaces are not location transparent.
"About Enterprise JavaBeans components", "EJB local references" in EAServer Programmer's Guide
Load Options
The com.sybase.jaguar.component.load property tells the server when to call ejbLoad. It can be one of these values:
- BeforeInvoke: before calling each business method
- BeforeRemove: before calling ejbRemove
- AfterBegin: (default) at the beginning of a transaction. This option may provide the best performance.
"Repository Properties Reference" in EAServer System Administration Guide
Reduce ejbStore invocations
For best performance, set the Read Only property for all methods that do not modify data. As a result, he components ejbStore or ctsStore method is not invoked after the business method returns.
In addition, if you are updating multiple fields, call the entity bean from session bean with the transaction open, then do multiple sets in entity bean, so only one ejbStore will occur instead of being called for each set.
"Component-managed entity persistence" in EAServer Programmer's Guide
Entity object and query caching
EAServer supports object and query caching for EJB entity beans and entity components that use automatic persistence. Caching can improve performance by minimizing the number of database select queries required for load, finder, and select operations. Performance gains may range from 1.5 to 2 times faster for applications where most transactions are updates, and from 3 to 30 times faster for applications where most transactions are read-only.
Object Caching is off by default and can be turned on for all Components and their finder methods that use Automatic Persistence.
To further optimize performance, you can;
turn on Query Caching if there are Entity Beans that have finder and ejbSelect methods
set up database change notification so that updates and deletes do not invalidate the cache
use named caches to tailor the cache sizes for individual components or a group of components.
Object Caching is implemented in C++ by the CtsComponents/ObjectCache component.
If for any reason you want to change the operating characteristics of the ObjectCache component, you can implement the CtsComponents/ObjectCache interface and employ that as your object caching mechanism instead. Ideally, cache managers should be coded in C++ to avoid the overhead of Java garbage collection.
"Managing Persistent Component State" in the EAServer Programmer's Guide
Timestamps in Automatic persistence
For entity components that use automatic persistence, using timestamps for concurrency control yields the best performance in most cases.
In optimistic concurrency control, use of the timestamp reduces unnecessary database read operations for tables with many columns or large column values (such as Sybase text or image columns).
"Entity object and query caching", "Configure concurrency control" in EAServer Programmer's Guide
Entity Bean Relationships
EAServer uses relationship components to manage relationships between EJB 2.0 CMP entity beans. The tables represented by related components must be related in the database. To maintain the relationships, foreign keys offer better performance than 上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页 [SyBase]用Sybase EAServer建立电子影院售票系统 [SyBase]Index & Performance [SyBase]Optimizing SQL Anywhere performance over a WAN [ORACLE]ORACLE PERFORMANCE SQL TUNING [ORACLE]Oracle Tuning (Oracle 性能调整)的一些总结
|