• Oracle Tuxedo Advanced Performance Pack is a product option for Oracle Tuxedo 12c Release 1 (12.1.1). With this pack, Oracle Tuxedo applications can achieve significantly better application performance and improve application availability, especially when running with Oracle Database/RAC. Features in this pack can be run on the following platforms:
This feature can adjust the value of SPINCOUNT dynamically for the best use of CPU cycle.The Tuxedo bulletin board (BB) is a memory segment in which all the application configuration and dynamic processing information is held at run time. For some Tuxedo system operations (such as service name lookups and transactions), the BB must be locked for exclusive access: that is, it must be accessible by only one process. If a process or thread finds that the BB is locked by another process or thread, it retries, or spins on the lock for SPINCOUNT number of times (user level method via spin) before giving up and going to sleep on a waiting queue (system level method via system semaphore). Because sleeping is a costly operation, it is efficient to do some amount of spinning before sleeping.Because the value of the SPINCOUNT parameter is application- and system-dependent, the administrator had to tune the SPINCOUT to be a proper value manually by observing the application throughput under different values of SPINCOUNT.Self-Tuning Lock Mechanism takes the job of tuning automatically. It is designed to figure out a proper value of SPINCOUNT so that most requests to lock BB are completed by spinning instead of sleeping on a waiting queue.For more information about configuration, see Oracle Tuxedo Advanced Performance Pack Configuration.Oracle Tuxedo 12c Release 1 (12.1.1) significantly enhances performance of Tuxedo applications with use of shared memory queues instead of IPC Message Queues for inter process communication on the same Tuxedo node. With the use of shared memory queues, the sender and receiver processes can exchange pre-allocated messages in shared memory, thus eliminating the need to copy messages several times before message reaches its intended target and resulting in much better throughput and lower latency.For more information about configuration, see Oracle Tuxedo Advanced Performance Pack Configuration.For more information about configuration, see Oracle Tuxedo Advanced Performance Pack Configuration.For more information about configuration, see Oracle Tuxedo Advanced Performance Pack Configuration.This feature takes advantage of the read-only optimization of resource manager for XA. Given two phase commit scenario, Tuxedo reserves one transaction branch and prepares all other branches concurrently. If all other transaction branches are read-only, Tuxedo does one-phase commit on the reserved branch directly without sending the prepare request and writing TLOG; otherwise, Tuxedo does two-phase commit on the reserved branch.For more information about configuration, see Oracle Tuxedo Advanced Performance Pack Configuration.In previous releases, servers in the same participated group use the same transaction branch in a global transaction; if these serves connect to different instances on the same RAC, the transaction branch may fail and an XA error, XAER_AFFINITY, will be reported, meaning one branch cannot go through different instances. For this reason, Tuxedo groups can only use singleton RAC services. A DTP service (if the DTP option, -x in srvctl, is specified) or a service offered by only one instance could be a singleton RAC service.For more information about configuration, see Oracle Tuxedo Advanced Performance Pack Configuration.For more information about configuration, see Oracle Tuxedo Advanced Performance Pack Configuration.For more information about configuration, see Oracle Tuxedo Advanced Performance Pack Configuration.Fast Application Notification (FAN) is a facility provided by Oracle Database to allow database clients to know about changes in the state of the database. These notifications let an application respond proactively to events such as a planned outage of a RAC node or an imbalance in database load. Tuxedo provides support for FAN notifications by a new system server TMFAN that can monitor Oracle RAC instance and notify Tuxedo application server to establish a new Database connection in case of Database instance up or down.For more information about configuration, see Oracle Tuxedo Advanced Performance Pack Configuration.Based on FAN notification, Tuxedo TMFAN server can receive load balancing advisories that include the load information of each RAC instance. If the change in advised load exceeds the threshold specified in the TMFAN command line switches, then Tuxedo request will be routed to the Tuxedo application server that has a lower Database load.For more information about configuration, see Oracle Tuxedo Advanced Performance Pack Configuration.This section describes how to configure various features of Oracle Tuxedo Advanced Performance Pack.All of the features in this product are enabled if the OPTIONS parameter in RESOURES in UBBCONFIG is set to XPP. On Oracle Exalogic and Oracle SPARC platforms, the OPTIONS parameter must be set to EECS.The option SPINTUNING_FACTOR controls the tuning target. The default value is 100 which is good enough in most scenarios. It can be changed from 1 to 10000 if necessary. A value of 100 indicates that SPINCOUNT will stop tuning as long as less than 1 in 100 attempts to lock result in system level method to get the BB lock and there is sufficient idle CPU. If the number of lock attempts resulting in system level method is higher than 1 and there is sufficient idle CPU time, SPINCOUNT will be increased.SPINTUNING_MINIDLECPU: Specifies the CPU idle time.The negative impact of the user level method is the extra cost of the CPU. Too many reties of user level method will cost many CPU time. This option is used to limit the CPU used by the user level method. The Self-Tuning Lock Mechanism will not increase the SPINCOUNT when the limitation of SPINTUNING_MINIDLECPU is reached even if the tuning target is not met. On the contrary, the SPINCOUNT will be decreased when the limitation of SPINTUNING_MINIDLECPU is broken no matter the tuning target is met or not. For example, given the value of 20, the Self-Tuning Lock Mechanism will control the idle CPU time not less than %20 during the adjustment. The default value is 20.
• The Self-Tuning Lock Mechanism may adjust the SPINCOUNT at each scan unit but may need to adjust by several times to achieve the target.For more information, see UBBCONFIG(5) and UBBCONFIG(5) Additional Information, Example 2 Self-Tuning Lock Mechanism Configuration, in File Formats, Data Descriptions, MIBs, and System Processes Reference.You can also set the configuration via TM_MIB. For more information, see TM_MIB(5) in File Formats, Data Descriptions, MIBs, and System Processes Reference.Listing 1 shows a UBBCONFIG file example of enabling Self-Tuning Lock Mechanism.OPTIONS XPPListing 2 shows a UBBCONFIG file example of disabling Self-Tuning Lock Mechanism.OPTIONS XPP,NO_SPINTUNINGAnother optional attribute is provided in *RESOURCES section.For UNIX 32-bit platforms and Windows platforms, the numeric_value range is from 1 to 2000 inclusive. For all other platforms, the numeric_value range is from 1 to 96000 inclusive. If SHMQMAXMEM is not specified, a recommended minimum value will be used, which is good enough for almost all of the scenarios.Run tmloadcf -c to get recommended minimum value. For more information, refer to tmloadcf(1) in Oracle Tuxedo Command Reference.Listing 3 shows a UBBCONFIG file example of enabling Shared Memory Interprocess Communication.OPTIONS XPPListing 4 shows a UBBCONFIG file example of disabling Shared Memory Interprocess Communication.OPTIONS XPP,NO_SHMQOPTIONS XPPListing 6 shows a UBBCONFIG file example of enabling Partial One Phase Read-Only Optimization for RAC.Listing 7 shows a UBBCONFIG file example of disabling Partial One Phase Read-Only Optimization for RAC.You can also get/change the configuration via TM_MIB. For more information, see TM_MIB(5) in File Formats, Data Descriptions, MIBs, and System Processes Reference.Listing 8 shows a UBBCONFIG file example of enabling SGMB.OPTIONS XPPListing 9 shows a UBBCONFIG file example of disabling SGMB.You can also set this flag when Tuxedo application is inactive through T_DOMAIN class in TM_MIB. For more information, see TM_MIB(5) in File Formats, Data Descriptions, MIBs, and System Processes Reference.Listing 10 shows a UBBCONFIG file example of enabling Common XID.OPTIONS XPPYou can disable this feature by specifying the option NO_COMMONXID of RMOPTIONS in the UBBCONFIG file.Listing 11 shows a UBBCONFIG file example of disabling Common XID.You can also set this flag when Tuxedo application is inactive through T_DOMAIN class in TM_MIB. For more information, see TM_MIB(5) in File Formats, Data Descriptions, MIBs, and System Processes Reference.Listing 12 shows a UBBCONFIG file example of enabling XA Transaction Affinity.OPTIONS XPPYou can disable this feature by specifying the option NO_XAAFFINITY of RMOPTIONS in the UBBCONFIG file.Listing 13 shows a UBBCONFIG file example of disabling XA Transaction Affinity.You can also set this flag when Tuxedo application is inactive through T_DOMAIN class in TM_MIB. For more information, see TM_MIB(5) in File Formats, Data Descriptions, MIBs, and System Processes Reference.This feature is implemented using FAN technology. See FAN Integration to enable this technology.This feature is implemented using FAN technology. See FAN Integration to enable this technology.Listing 14 shows a UBBCONFIG file example of enabling FAN Integration.OPTIONS XPPListing 15 shows a UBBCONFIG file example of disabling FAN Integration.You can also set this flag when Tuxedo application is inactive through T_DOMAIN class in TM_MIB. For more information, see TM_MIB(5) in File Formats, Data Descriptions, MIBs, and System Processes Reference.To monitor FAN events, specify Tuxedo system server TMFAN in SERVERS section. For more information, see TMFAN(5) in File Formats, Data Descriptions, MIBs, and System Processes Reference.To support Oracle TAF (Transparent Application Failover) for Tuxedo XA server, threads=t must be included in OPENINFO in UBBCONFIG *GROUPS section.A proper SPINCOUNT indicates a server can hold the BB lock via user level method at most time. It can significantly improve the performance in the scenarios where BB lock conflict is heavy. The typical scenario is the transactional application using Tuxedo XA mechanism. So it is recommended to enable this feature on the Oracle Exalogic by default in a Tuxedo application unless the CPU is not enough.A process on a uniprocessor system should not spin. A SPINCOUNT value of 1 is appropriate for uniprocessors. On multiprocessors, the value of the SPINCOUNT parameter is application- and system-dependent. Self-Tuning Lock Mechanism can figure out the proper SPINCOUNT automatically.Not only more shared memory, but also extra semaphores are necessary if this features enabled. It is recommended to check the minimum IPC resources via tmloacf -c before using this feature.The default value is good enough for almost all scenarios. But, you need adjust the value of SHMQMAXMEM in UBBCONFIG if the message size is great than 32 Kbytes, the detail is as follow:
• Recommend_value: The value returned by tmloadcf -c
• Message_size: The buffer size for one message (Kbytes)In this release, there are two new MIB fields, TA_SHMQSTAT and TA_MSG_SHMQNUM, which are used to get the detailed information about shared memory usage. For more details about TA_SHMQSTAT and TA_MSG_SHMQNUM, see TM_MIB(5) in File Formats, Data Descriptions, MIBs, and System Processes Reference.It is a new flag of TPNOCOPY in tpcall() for using SHMQ message. A typical Tuxedo user case of zero-copy messaging:
1.
2. Client sends the request to server's request SHMQ by tpcall(), and waits for reply
4. Server use the same SHMMSG buffer for reply
5. Zero-copy messaging is an ideal circumstance, with the pre-condition that sender and receiver cannot access the shared buffer at the same time. In the real world, to guarantee safe memory access, sender needs to do one copy and send the copy instead of original SHMMSG. However, to gain advanced performance, new flag TPNOCOPY is provided for tpcall() to avoid the copy cost. If application chooses to use this flag, it must take the responsibility to make sure no access to the SHMMSG buffer after tpcall() fails, except for tpfree().When TPNOCOPY is set for tpcall() flags and the send buffer is SHMMSG buffer, no safe copy will be done during message sending. After tpcall() succeeds, sender application has full access of the send buffer as normal. But if tpcall() fails in any circumstance, sender application cannot access the send buffer any more. In this case the recommended action is tpfree() the buffer, and this is the only safe operation on the buffer.
• Tuxedo messages out from a server specified with BUFTYPECONVListing 16 UBB ConfigurationMODEL SHMOPTIONS XPP"mach1" LMID=L1GRP1 LMID=L1 GRPNO=10 TMSNAME="TMSORA1"GRP2 LMID=L1 GRPNO=20 TMSNAME="TMSORA2"server1 SRVGRP=GRP1 SRVID=10 MIN=2server2 SRVGRP=GRP2 SRVID=10 MIN=2GRP1 uses net service orcl.tux1 to connect to the resource manager. The orcl.tux1 is configured to database service tux1 which is supported by RAC instance1. GRP2 uses net service orcl.tux2 to connect to the resource manager. The orcl.tux2 is configured to database service tux2 which is supported by RAC instance2. The server1 offers Tuxedo service svc1. The server2 offers Tuxedo service svc2. The transactional business A depends on svc1 and svc2 so it will involve server1 and server2.Listing 17 UBB ConfigurationMODEL SHMOPTIONS XPP"mach1" LMID=L1GRP1 LMID=L1 GRPNO=10 TMSNAME="TMSORA1"GRP2 LMID=L1 GRPNO=20 TMSNAME="TMSORA2"server1 SRVGRP=GRP1 SRVID=10 MIN=4server2 SRVGRP=GRP2 SRVID=10 MIN=4GRP1 and GRP2 use the same net service orcl.tux3 to connect the resource manager; orcl.tux3 is configured to database service tux3, which both RAC instance1 and instance2 support. Server1 offers Tuxedo service svc1 and server2 offers Tuxedo service svc2. The transactional business A calls svc1 and then svc2, and so involves both server1 and server2. Because orcl.tux3 is non-singleton database service, server1 copies associate with either instance1 or instance2, so do server2 copies.Listing 18 UBB ConfigurationMODEL SHMOPTIONS XPP"mach1" LMID=L1GRP1 LMID=L1 GRPNO=10 TMSNAME="TMSORA1"GRP2 LMID=L1 GRPNO=20 TMSNAME="TMSORA2"server1 SRVGRP=GRP1 SRVID=10 MIN=2server2 SRVGRP=GRP2 SRVID=10 MIN=2In the above configuration, GRP1 and GRP2 use the same net service (orcl.tux1, which is configured to an Oracle Database) to connect resource manager. Server1 offers Tuxedo service svc1 and server2 offers Tuxedo service svc2. The transactional business A calls svc1 followed by svc2 so it will involve server1 and server2. When Common XID is enabled, all transactions of business A become one-phase commit.The typical UBB sample is the same as Listing 18, while the net service orcl.tux1 is configured to Oracle RAC instance1 through database service tux1. When Common XID is enabled, all transactions of business A become one-phase commit.Listing 19 UBB ConfigurationMODEL SHMOPTIONS XPP"mach1" LMID=L1GRP1 LMID=L1 GRPNO=10 TMSNAME="TMSORA1"GRP2 LMID=L1 GRPNO=20 TMSNAME="TMSORA2"GRP3 LMID=L1 GRPNO=30 TMSNAME="TMSORA3"server1 SRVGRP=GRP1 SRVID=10 MIN=2server2 SRVGRP=GRP2 SRVID=10 MIN=2server3 SRVGRP=GRP3 SRVID=10 MIN=2GRP1 and GRP2 use the same net service orcl.tux1 to connect the resource manager; orcl.tux1 is configured to database service tux1, which RAC instance1 supports. GRP3 uses net service orcl.tux2 to connect the resource manager; orcl.tux2 is configured to database service tux2, which RAC instance2 supports. Server1 offers Tuxedo service svc1; both server2 and server3 offer Tuxedo service svc2. The transactional business A calls svc1 and then svc2.In general, business A may involve server1 and server2, or server1 and server3, because of Tuxedo load balance. When Common XID is enabled, the transactions that involve server1 and server2 become one-phase commit; when XA Transaction Affinity feature is enabled, business A always involves server1 and server2 so that all transactions of the business A would be one-phase commit.Listing 20 UBB ConfigurationMODEL SHMOPTIONS XPP"mach1" LMID=L1GRP1 LMID=L1 GRPNO=10 TMSNAME="TMSORA1"GRP2 LMID=L1 GRPNO=20 TMSNAME="TMSORA2"GRP3 LMID=L1 GRPNO=30 TMSNAME="TMSORA3"server1 SRVGRP=GRP1 SRVID=10 MIN=2server2 SRVGRP=GRP2 SRVID=10 MIN=2server3 SRVGRP=GRP3 SRVID=10 MIN=2GRP1 and GRP2 use the same net service orcl.tux1 to connect the resource manager; orcl.tux1 is configured to database service tux1, which RAC instance1 supports. GRP3 uses net service orcl.tux2 to connect the resource manager; orcl.tux2 is configured to database service tux2, which RAC instance2 supports. Server1 offers Tuxedo service svc1; server2 offers Tuxedo service svc2; server3 offers Tuxedo service svc3. The transactional business B calls svc1, then svc2, and then svc3.The business B involves server1/GRP1, server2/GRP2, and server3/GRP3. When common XID is enabled, the prepare request to GRP2 is saved. Given that Read-Only Optimization is enabled as well, the prepare request to GRP1 is saved as well and one-phase commit is done on GRP1, avoiding TLOG writing.
• Multi-threaded servers do not provide instance information via MIB; however, common XID still performs well on server-dispatched threads.
• In two-phase commit scenarios, GWTDOMAIN is always involved to do prepare and/or commit.
• If the coordinator group is the group where GWTDOMAIN locates, common XID does not work.
•
• For more information about how to set up this feature with Oracle Database, see "Using Tuxedo with Oracle Real Application Clusters (RAC)" in Oracle Tuxedo Setting Up an Oracle Tuxedo Application.As long as XA Transaction Affinity is enabled, there is no need to use the rule of Oracle RAC routing specified by the environment variable TUXRACGROUPS, and this rule will be disabled.Besides UBBCONFIG, set Oracle Database properly for the following configurations:The ONS daemon configuration file is located in $ORACLE_HOME/opmn/conf/ons.config. This file tells the ONS daemon how to behave. Configuration information within ons.config is defined in simple name and value pairs.After configuring ONS, you can start it with onsctl command. Make sure that ONS daemon is running all the time.To monitor FAN event for the instance associated with the specific non-XA application server, $TUXDIR/lib/tuxociucb.so.1.0 should be deployed in $ORACLE_HOME/lib, and the name of this binary must be specified in ORA_OCI_UCBPKG environment variable.
• For OCI application, create OCI environment in OCI_THREADED mode.
• For Pro*C application, run pre-compilation with threads=yes and use EXEC SQL ENABLE THREADS before creating the first executable embedded SQL statement.-L option in servopts must be used for a non-XA server to indicate that the server will connect to the Oracle Database. Since the ECID is enabled when -L is specified, a new option -F is introduced into servopts to close ECID. The usage is -F noECID. The example is below.Listing 21 Example for -L Option
• If the customized server is going to use OCI to connect to Oracle Database, OCI_NO_UCB should not be set at OCI initialization time.
•
• For more information about how to set up this feature with Oracle Database, see "Using Tuxedo with Oracle Real Application Clusters (RAC)" in Oracle Tuxedo Setting Up an Oracle Tuxedo Application.Configure UBBCONFIG and Oracle Database the same as Failover/Failback across Database Instances, and set LBA (Load Balance Advisory) as follows.Based on Oracle Database load balance advisory, Tuxedo can distribute service request across Tuxedo application server that is connected to the same Oracle Database service. To enable LBA and publication of FAN load balancing events, the service-level goal for runtime connection load balancing must be specified in Oracle Database service definition. You can use -B option to specify the goal via srvctl when creating or modifying the service.See Recommendation for Non-XA Server for the recommendation.
• If the customized server is going to use OCI to connect to Oracle Database, OCI_NO_UCB should not be set at OCI initialization time.
•
• For more information about how to set up this feature with Oracle Database, see "Using Tuxedo with Oracle Real Application Clusters (RAC)" in Oracle Tuxedo Setting Up an Oracle Tuxedo Application.Oracle Tuxedo 12c Release 1 (12.1.1) Rolling Patch 073 or later is required.