No self-respecting post on How to Maximise CPU Performance for the Oracle Database on Linux would be complete without also mentioning Hyper-Threading(HT). This page describes HT perfectly as a feature that “uses processor resources more efficiently, enabling multiple threads to run on each core.” And is an implementation of a feature called Simultaneous Multithreading (SMT). In more details the figure shows 2 threads being scheduled on a processor, firstly without HT and then with HT illustrating fewer processor execution units sitting idle when HT is enabled.
From this description you can see that HT enables 2 threads to be executing on the same processor core at the same time and thereby improves performance by improved efficiency. It does not increase the number of physical cores available and whether HT is enabled or disabled does not impact the Oracle licence cost which is calculated based on the number of cores.
As always the best place to start to see if you can benefit from a CPU features is http://ark.intel.com. With an
example E5-2680 we can see that HT is available.
Ensuring that HT is enabled at the BIOS once the Linux operating system started you can see double the number of processors in your processor listing. In this example system with 2 x E5-2680 there are 16 physical cores however the system now sees 32 logical processors.
[root@sandep1 ~]# cat /proc/cpuinfo | grep processor
processor : 0
processor : 1
processor : 2
processor : 3
…
processor : 28
processor : 29
processor : 30
processor : 31
You can discover some more about the configuration by using the Processor Topology Tool . Running this tool on the example system tells us that there are 2 packages, 16 processors and 32 logical processors. Also it tells us which Operating System CPU corresponds to which logical processor so core 0 and thread 0 are OS processor 0 however Core 0 and thread 1 are OS processor 16. You can see that what Linux does is number the first 16 OS processors as thread 0 on the CPUs and then thread 1 for processors 16 to 31. Scheduling threads across the processor count ensures that the maximum number of physical resources are used first before then using HT or as using the initial physical processor as thread 0 and an additional logical processor as thread 1.
[root@sandep1 oracle]# ./cpu_topology64.out
…
Software visible enumeration in the system:
Number of logical processors visible to the OS: 32
Number of processor cores visible to this process: 16
Number of physical packages visible to this process: 2
…
Hierarchical counts by levels of processor topology:
# of cores in package 0 visible to this process: 8 .
# of logical processors in Core 0 visible to this process: 2 .
…
OScpu
0 16|1 17|2 18|3 19|4 20|
5 21|6 22|7 23|
…
Core
c0_t0 c0_t1|c1_t0 c1_t1|c2_t0 c2_t1|c3_t0 c3_t1|c4_t0 c4_t1|
c5_t0 c5_t1|c6_t0 c6_t1|c7_t0 c7_t1|
Oracle is also aware of the distinction between available CPUs and physical cores as shown within an AWR report.
Host Name | Platform | CPUs | Cores | Sockets | Memory (GB) |
sandep1.example.com | Linux x86 64-bit | 32 | 16 | 2 |
|
As always to prove the benefits of any feature beyond doubt I always run tests. To do so with HT is especially straightforward – what we need to do is to put a system under test conditions, turn HT off and run the test and then turn it on and run the test. The difference between the 2 will be the impact of HT. For the test I will use HammerDB, as the documentation shows the tests are fully repeatable so we can be sure that the impact between the 2 tests are attributed to HT. Reading the introduction to transactional testing guide will also help understand the results here. I took the E5-2680 system installed it with Oracle 12c and repeated the same test unattended with the autopilot feature with HT on and off. The performance profile below shows looking from left to right an increased system load by increasing the number of virtual users up to a point full system utilisation. The actual performance values are not shown. The red line shows HT off and the blue line HT on.
The post Hyper-Threading On or Off for Oracle? appeared first on Blogs@Intel.

