• Non ci sono risultati.

This section describes the system resources required by Spike, how and why to use Spike optimization flags, and the various ways to run Spike.

Setting System Resources

Table F–1 lists the system resources required to run Spike.

To set the value of these subsystem attributes in the /etc/sysconfigtab file, add the following lines:

proc:

max-per-proc-address-space = 0x40000000 max-per-proc-data-size = 0x40000000 vm:

vm-maxvas = 0x40000000

Set the limits in your shell environment to the highest values. For the C shell, run the following command:

% limit datasize unlimited

% limit memoryuse unlimited

% limit vmemoryuse unlimited

Spike can run out of virtual memory if the stacksize limit is set too high. To avoid this problem, run the following C shell command:

% limit stacksize 8192

Note: If you have a version of Spike earlier than V5.2: (510 USG) GEM: 48C5K LIBMLD: 2.4 DATE: Sep 28 2003, then contact HP for a patch kit.

Note: Oracle does not support versions of the Oracle executable optimized using the spike command. If you encounter a problem in an Oracle Database binary that has been optimized using Spike, then reproduce the problem with the original unoptimized binary. If the problem persists, then contact Oracle Support Services.

Table F–1 System Resource Requirements for Spike

Resource Minimum Value

Physical memory 1024 MB

max-per-proc-address-space subsystem attribute value 1024 MB max-per-proc-data-space subsystem attribute value 1024 MB

vm-maxvas subsystem attribute value 1024 MB

Spike Optimization Tool

F-12 Oracle Database Administrator’s Reference

Checking Optimization Flags

Spike provides a large number of optimization flags. However, you cannot use all spike command optimizations with Oracle Database. The following Spike optimization flags are certified to run with Oracle Database:

-arch, -controlOpt, -fb, -feedback, -map, -nosplit, -nochain, -noporder, -noaggressiveAlign, -o, optThresh, -splitThresh, -symbols_live, -tune, -v, -V When you run Spike, it places a copy of the optimization flags in the image header comment section of the binary that you are optimizing. Oracle Database checks Spike optimizations used on itself at the beginning of instance startup. If Oracle Database detects an optimization not known to work for Oracle Database binary, or if the binary had been previously optimized with OM (the predecessor to Spike from HP), then the instance startup fails with an ORA-4940 error message. If the instance startup fails, then check the alert log file for more information.

Running Spike

Use one of the following methods to optimize an executable using Spike:

Static spiking

Running Spike with feedback

Static spiking requires only a few set-up steps and yields approximately half the performance benefit possible compared to running Spike with feedback.

Running Spike with feedback includes all the optimizations of static spiking plus additional optimizations that are workload-related. Running spike with feedback provides the best possible performance benefit, however, it requires considerably more effort than static spiking.

For both running Spike with feedback and static spiking, Oracle recommends running the spiked Oracle binary in a test environment before moving it to a production environment.

Static Spiking

Static spiking performs optimizations that are not specific to your workload, such as manipulating the global pointer (gp) register and taking advantage of the CPU architecture. In a test environment, roughly half of the performance optimization gain possible from Spike was through static spiking. Furthermore, static spiking is

relatively straight-forward and simple. The combination of simplicity and performance gain makes static spiking worth the effort.

Perform the following steps to use static spiking:

1. Shut down the database.

2. Spike the oracle image by entering the following command:

$ spike oracle -o oracle.spike -symbols_live

3. Save the original image and create a symbolic link to the spiked image by entering the following commands:

$ mv oracle oracle.orig

$ ln -s oracle.spike oracle

Note: Oracle Database requires that you use the Spike -symbols_

live optimization flag.

Spike Optimization Tool

Administering Oracle Database on Tru64 UNIX F-13 4. Start up the database.

Running Spike with Feedback

Running Spike with feedback performs all the same optimizations as static spiking plus optimizations that are workload-related such as hot and cold basic block movement. In a test environment, approximately half of the performance optimizations gained from Spike was due to the optimizations that depend on feedback information. Running Spike with feedback requires multiple steps and considerably more effort than static spiking. However, performance sensitive customers may find the extra effort worthwhile.

Perform the followings steps to run Spike with feedback:

1. Instrument the Oracle binary by entering the following command:

$ pixie -output oracle.pixie -dirname dir -pids oracle_image

In the preceding example, oracle_image is your original image and dir is the name of the directory into which the instrumented executable writes the profiling data files.

This step also creates an oracle.Addrs file that is required later.

The output of the pixie command may contain errors. You can safely ignore these errors.

2. Shut down the database.

3. Save the original image and create a symbolic link to the pixie image by entering the following commands:

$ mv oracle oracle.orig

$ ln -s oracle.pixie oracle

4. Start up the database and run your workload.

You cannot run as many users as you can with the standard executable because the pixie executable is larger and slower. As you use Oracle Database, several oracle.Counts.pid files are created, where pid is the process ID for the corresponding Oracle process. Keep track of the process ID of each Oracle process for which the optimization is aimed. These could be the shadow Oracle processes of the clients.

5. Shut down the database.

6. Create a symbolic link to replace the original executable by entering the following command:

$ ln -s oracle.orig oracle

Note: Before contacting Oracle for support, you must use the original image to reproduce any problems.

Note: The -dirname option saves the oracle.Counts.pid files in the dir directory. Because these files are large and may be numerous depending on the workload, ensure that there is enough free disk space.

Spike Optimization Tool

F-14 Oracle Database Administrator’s Reference

7. If you can identify one oracle.Counts.pid file as representative of your workload, then perform step a. If you must merge several counts files together to better represent your workload, then perform step b.

a. Ensure that the oracle.Addrs file created by the pixie command, the oracle.Counts.pid files, and the original Oracle executable are available.

Use the process ID (pid) to pick a representative oracle.Counts.pid file and then copy it by entering the following command:

$ cp oracle.Counts.pid oracle.Counts

b. Use the prof utility to merge several oracle.Counts.pid files. See the prof man pages for more information about this utility.

If you are using the parallel query option, then merge the

oracle.Counts.pid files generated by the query slaves and the query coordinator, which is the shadow Oracle process of the query-initiating client.

If you are not using the parallel query option, then merge the

oracle.Counts.pid files from the Oracle foreground processes that use the most memory.

To merge the oracle.Counts.pid files, run the following command:

$ prof -pixie -merge oracle.Counts $ORACLE_HOME/bin/oracle \ oracle.Addrs oracle.Counts.pid1 oracle.Counts.pid2

8. Ensure that the oracle.Addrs and oracle.Counts files are available in the current directory, then run Spike using the feedback information by entering the following command:

$ spike oracle -fb oracle -o oracle.spike_fb -symbols_live

The output of the spike command may contain errors. You can safely ignore these errors.

9. Create a symbolic link to the new oracle image by entering the following command:

$ ln -s oracle.spike_fb oracle 10. Start up the database.

Documenti correlati