{"id":10888,"date":"2018-02-17T12:49:49","date_gmt":"2018-02-17T11:49:49","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/"},"modified":"2018-02-17T12:49:49","modified_gmt":"2018-02-17T11:49:49","slug":"cpus-cores-versus-threads-on-an-oracle-server","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/","title":{"rendered":"CPUs: Cores versus Threads on an Oracle Server"},"content":{"rendered":"<p>When doing a performance review I often do talk with the DBA about the CPU utilization of the server. How reliable is the server CPU utilization with tools like top or the host CPU utilization in the AWR-report? E.g. on an Linux Intel x86-64 server with 8 Cores and 16 logical CPUs (Intel Hyperthreading), what does a utilization of 50% mean?<br \/>\nAs I had an ODA X7-M in a test lab available, I thought I&#8217;ll do some tests on that.<\/p>\n<p>In my old days at Oracle Support we used a small script to test the CPU single thread performance of an Oracle DB-server:<\/p>\n<p><code><br \/>\nset echo on<br \/>\nset linesize 120<br \/>\nset timing on time on<br \/>\nwith t as ( SELECT rownum FROM dual CONNECT BY LEVEL &lt;= 60 )<br \/>\nselect \/*+ ALL_ROWS *\/ count(*) from t,t,t,t,t<br \/>\n\/<br \/>\n<\/code><\/p>\n<p>The SQL just burns a CPU-Core for around 20 seconds. Depending on your CPU single thread performance it may take a bit longer or completes faster.<\/p>\n<p>On the ODA X7-M I have 16 Cores enabled and as hyperthreading enabled I do get 32 CPUs in \/proc\/cpuinfo:<\/p>\n<p><code><br \/>\noracle@dbi-oda01:\/home\/oracle\/cbleile\/ [CBL122] grep processor \/proc\/cpuinfo | wc -l<br \/>\n32<br \/>\noracle@dbi-oda01:\/home\/oracle\/cbleile\/ [CBL122] lscpu | egrep \"Thread|Core|Socket|Model name\"<br \/>\nThread(s) per core:    2<br \/>\nCore(s) per socket:    8<br \/>\nSocket(s):             2<br \/>\nModel name:            Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz<br \/>\n<\/code><\/p>\n<p>The CPU-speed was at 2.3 GHZ all the time:<\/p>\n<p><code><br \/>\n[root@dbi-oda01 ~]# for a in `ls -l \/sys\/devices\/system\/cpu\/cpu*\/cpufreq | grep cpufreq | cut -d \"\/\" -f6 | cut -d \"u\" -f2`; do echo \"scale=3;`cat \/sys\/devices\/system\/cpu\/cpu${a}\/cpufreq\/cpuinfo_cur_freq`\/1000000\" | bc; done<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n2.301<br \/>\n<\/code><\/p>\n<p>The CPU is capable of running up to 3.7 GHZ, but that did not happen on my machine.<\/p>\n<p>Running my SQL-script on the ODA X7-M actually took 17.49 seconds:<\/p>\n<p><code><br \/>\n18:44:00 SQL&gt; with t as ( SELECT rownum FROM dual CONNECT BY LEVEL &lt;= 60 )<br \/>\n18:44:00   2  select \/*+ ALL_ROWS *\/ count(*) from t,t,t,t,t<br \/>\n18:44:00   3  \/<br \/>\n&nbsp;<br \/>\n  COUNT(*)<br \/>\n----------<br \/>\n 777600000<br \/>\n&nbsp;<br \/>\nElapsed: 00:00:17.49<br \/>\n<\/code><\/p>\n<p>I continued to do the following tests (a job means running above SQL-script):<br \/>\n&#8211; 1 Job alone<br \/>\n&#8211; 2 Jobs concurrently<br \/>\n&#8211; 4 Jobs concurrently<br \/>\n&#8211; 8 Jobs concurrently<br \/>\n&#8211; 16 Jobs concurrently<br \/>\n&#8211; 24 Jobs concurrently<br \/>\n&#8211; 32 Jobs concurrently<br \/>\n&#8211; 40 Jobs concurrently<br \/>\n&#8211; 50 Jobs concurrently<br \/>\n&#8211; 60 Jobs concurrently<br \/>\n&#8211; 64 Jobs concurrently<br \/>\n&#8211; 128 Jobs concurrently<\/p>\n<p>Here the result:<\/p>\n<p><code><br \/>\nJobs\t\tMin Time\tMax Time\tAvg Time\tJobs\/Cores\tJobs\/Threads\tAvg\/Single-Time\tThread utilization<br \/>\n&nbsp;<br \/>\n1\t\t17.49\t\t17.49\t\t17.49\t\t0.06\t\t0.03\t\t\t1.00\t\t1.00<br \/>\n2\t\t17.51\t\t17.58\t\t17.55\t\t0.13\t\t0.06\t\t\t1.00\t\t1.00<br \/>\n4\t\t17.47\t\t17.86\t\t17.62\t\t0.25\t\t0.13\t\t\t1.01\t\t0.99<br \/>\n8\t\t17.47\t\t17.66\t\t17.55\t\t0.50\t\t0.25\t\t\t1.00\t\t1.00<br \/>\n16\t\t17.64\t\t21.65\t\t18.50\t\t1.00\t\t0.50\t\t\t1.06\t\t0.95<br \/>\n24\t\t18\t\t27.38\t\t24.20\t\t1.50\t\t0.75\t\t\t1.38\t\t0.72<br \/>\n32\t\t32.65\t\t34.57\t\t33.21\t\t2.00\t\t1.00\t\t\t1.90\t\t0.53<br \/>\n40\t\t34.76\t\t42.74\t\t40.31\t\t2.50\t\t1.25\t\t\t2.30\t\t0.54<br \/>\n50\t\t48.26\t\t52.64\t\t51.21\t\t3.13\t\t1.56\t\t\t2.93\t\t0.53<br \/>\n60\t\t52.4\t\t63.6\t\t60.63\t\t3.75\t\t1.88\t\t\t3.47\t\t0.54<br \/>\n64\t\t54.2\t\t68.4\t\t64.27\t\t4.00\t\t2.00\t\t\t3.67\t\t0.54<br \/>\n128\t\t119.49\t\t134.34\t\t129.01\t\t8.00\t\t4.00\t\t\t7.38\t\t0.54<br \/>\n<\/code><\/p>\n<p>When running with 16 Jobs top showed a utilization of around 50-52%. However running more than 16 Jobs showed an increase of the average time a job takes. I.e. with 16 Jobs the 16-Cores-Server is already almost fully utilized. Running with 32 Jobs results in an average elapsed time of 1.9 times compared to running 16 jobs (or less) concurrently. As it is 1.9 times and not 2 times I can conclude that there is an advantage of running with hyperthreading enabled, but it&#8217;s only around 5-10%. <\/p>\n<p>So when calculating the utilization of your server then base it on the number of cores and not on the number of threads. When looking at your host CPU-utilization in top or in the AWR-report on an hyperthreaded-enabled server then it&#8217;s a good idea to multiply the server-utilization by 1.9.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When doing a performance review I often do talk with the DBA about the CPU utilization of the server. How reliable is the server CPU utilization with tools like top or the host CPU utilization in the AWR-report? E.g. on an Linux Intel x86-64 server with 8 Cores and 16 logical CPUs (Intel Hyperthreading), what [&hellip;]<\/p>\n","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229,198,59],"tags":[1296,423,630,96,67],"type_dbi":[],"class_list":["post-10888","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","category-database-management","category-oracle","tag-core","tag-cpu","tag-cpu-thread","tag-oracle","tag-performance"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>CPUs: Cores versus Threads on an Oracle Server - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CPUs: Cores versus Threads on an Oracle Server\" \/>\n<meta property=\"og:description\" content=\"When doing a performance review I often do talk with the DBA about the CPU utilization of the server. How reliable is the server CPU utilization with tools like top or the host CPU utilization in the AWR-report? E.g. on an Linux Intel x86-64 server with 8 Cores and 16 logical CPUs (Intel Hyperthreading), what [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-17T11:49:49+00:00\" \/>\n<meta name=\"author\" content=\"Clemens Bleile\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ifgtxD2SrQ8r!YuXj\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Clemens Bleile\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/\"},\"author\":{\"name\":\"Clemens Bleile\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0ac04011f60f2e93c115358d0789c2da\"},\"headline\":\"CPUs: Cores versus Threads on an Oracle Server\",\"datePublished\":\"2018-02-17T11:49:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/\"},\"wordCount\":376,\"commentCount\":3,\"keywords\":[\"Core\",\"CPU\",\"CPU thread\",\"Oracle\",\"Performance\"],\"articleSection\":[\"Database Administration &amp; Monitoring\",\"Database management\",\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/\",\"name\":\"CPUs: Cores versus Threads on an Oracle Server - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2018-02-17T11:49:49+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0ac04011f60f2e93c115358d0789c2da\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CPUs: Cores versus Threads on an Oracle Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0ac04011f60f2e93c115358d0789c2da\",\"name\":\"Clemens Bleile\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/1f596609fc67cb28ed714e7bccc81ed4cd73b8582a8148a490c77daeb2fde21a?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1f596609fc67cb28ed714e7bccc81ed4cd73b8582a8148a490c77daeb2fde21a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1f596609fc67cb28ed714e7bccc81ed4cd73b8582a8148a490c77daeb2fde21a?s=96&d=mm&r=g\",\"caption\":\"Clemens Bleile\"},\"description\":\"Clemens Bleile has more than 30 years of IT experience, thirteen in Oracle Support and fifteen in Oracle Consulting. He is specialized in Oracle Database Performance Tuning (SQL Tuning, DB Tuning) and developing an Oracle DB IT architecture (highly available, low-maintenance, cost efficient storage of data). He is an expert in problem analysis and resolution. Prior to joining dbi services, Clemens Bleile was Manager of the EMEA Database Performance team at the Oracle Global Customer Support Services. Clemens Bleile is Oracle Certified Professional 11g, 12c and Oracle Certified Expert for Performance Management and Tuning and holds a Master Degree, Business Information Systems from the Fachhochschule Furtwangen, Germany.\",\"sameAs\":[\"https:\/\/www.dbi-services.com\",\"https:\/\/x.com\/ifgtxD2SrQ8r!YuXj\"],\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/clemens-bleile\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"CPUs: Cores versus Threads on an Oracle Server - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/","og_locale":"en_US","og_type":"article","og_title":"CPUs: Cores versus Threads on an Oracle Server","og_description":"When doing a performance review I often do talk with the DBA about the CPU utilization of the server. How reliable is the server CPU utilization with tools like top or the host CPU utilization in the AWR-report? E.g. on an Linux Intel x86-64 server with 8 Cores and 16 logical CPUs (Intel Hyperthreading), what [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/","og_site_name":"dbi Blog","article_published_time":"2018-02-17T11:49:49+00:00","author":"Clemens Bleile","twitter_card":"summary_large_image","twitter_creator":"@ifgtxD2SrQ8r!YuXj","twitter_misc":{"Written by":"Clemens Bleile","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/"},"author":{"name":"Clemens Bleile","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0ac04011f60f2e93c115358d0789c2da"},"headline":"CPUs: Cores versus Threads on an Oracle Server","datePublished":"2018-02-17T11:49:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/"},"wordCount":376,"commentCount":3,"keywords":["Core","CPU","CPU thread","Oracle","Performance"],"articleSection":["Database Administration &amp; Monitoring","Database management","Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/","url":"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/","name":"CPUs: Cores versus Threads on an Oracle Server - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2018-02-17T11:49:49+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0ac04011f60f2e93c115358d0789c2da"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/cpus-cores-versus-threads-on-an-oracle-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"CPUs: Cores versus Threads on an Oracle Server"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0ac04011f60f2e93c115358d0789c2da","name":"Clemens Bleile","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1f596609fc67cb28ed714e7bccc81ed4cd73b8582a8148a490c77daeb2fde21a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1f596609fc67cb28ed714e7bccc81ed4cd73b8582a8148a490c77daeb2fde21a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1f596609fc67cb28ed714e7bccc81ed4cd73b8582a8148a490c77daeb2fde21a?s=96&d=mm&r=g","caption":"Clemens Bleile"},"description":"Clemens Bleile has more than 30 years of IT experience, thirteen in Oracle Support and fifteen in Oracle Consulting. He is specialized in Oracle Database Performance Tuning (SQL Tuning, DB Tuning) and developing an Oracle DB IT architecture (highly available, low-maintenance, cost efficient storage of data). He is an expert in problem analysis and resolution. Prior to joining dbi services, Clemens Bleile was Manager of the EMEA Database Performance team at the Oracle Global Customer Support Services. Clemens Bleile is Oracle Certified Professional 11g, 12c and Oracle Certified Expert for Performance Management and Tuning and holds a Master Degree, Business Information Systems from the Fachhochschule Furtwangen, Germany.","sameAs":["https:\/\/www.dbi-services.com","https:\/\/x.com\/ifgtxD2SrQ8r!YuXj"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/clemens-bleile\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/10888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=10888"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/10888\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=10888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=10888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=10888"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=10888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}