{"id":1164,"date":"2008-02-25T09:39:18","date_gmt":"2008-02-25T09:39:18","guid":{"rendered":"http:\/\/coalface.mcslp.com\/2008\/02\/25\/comparing-32-bit64-bit-mysql-on-opensolaris\/"},"modified":"2008-02-25T09:39:18","modified_gmt":"2008-02-25T09:39:18","slug":"comparing-32-bit64-bit-mysql-on-opensolaris","status":"publish","type":"post","link":"https:\/\/planet.mcb.guru\/?p=1164","title":{"rendered":"Comparing 32-bit\/64-bit MySQL on OpenSolaris"},"content":{"rendered":"<p>I&#8217;ve been working with the folks working on OpenSolaris for a few months now providing advice and input on getting MySQL and the connectors (C\/ODBC and C\/J) installed as a standard component. Having got the basics in, the team are now looking at adding both 32-bit and 64-bit packages. <\/p>\n<p>The question raised at the end of last week was whether OpenSolaris should enable 64-bit builds by default in 64-bit installations, and whether there was a noticeable performance difference that would make this worthwhile. <\/p>\n<p>I did some initial tests on Friday which showed that there was a small increase (10-15%) of the packaged 64-bit installations over 32-bit under x86 using snv_81. Tests were executed using the included sql-bench tool, and this was a single execution run of each package for 5.0.56. Transactions are missing because I hadn&#8217;t enabled transactions in the tests. <\/p>\n<table border=\"1\">\n<tr>\n<th>Test (x86, binary packages)<\/th>\n<th>32-bit<\/th>\n<th>64-bit<\/th>\n<th>+\/-<\/th>\n<\/tr>\n<tr>\n<td>ATIS<\/td>\n<td>20<\/td>\n<td>17<\/td>\n<td>17.65%<\/td>\n<\/tr>\n<tr>\n<td>alter-table<\/td>\n<td>18<\/td>\n<td>15<\/td>\n<td>20.00%<\/td>\n<\/tr>\n<tr>\n<td>big-tables<\/td>\n<td>14<\/td>\n<td>11<\/td>\n<td>27.27%<\/td>\n<\/tr>\n<tr>\n<td>connect<\/td>\n<td>134<\/td>\n<td>121<\/td>\n<td>10.74%<\/td>\n<\/tr>\n<tr>\n<td>create<\/td>\n<td>348<\/td>\n<td>348<\/td>\n<td>0.00%<\/td>\n<\/tr>\n<tr>\n<td>insert<\/td>\n<td>1038<\/td>\n<td>885<\/td>\n<td>17.29%<\/td>\n<\/tr>\n<tr>\n<td>select<\/td>\n<td>399<\/td>\n<td>257<\/td>\n<td>55.25%<\/td>\n<\/tr>\n<tr>\n<td>transactions<\/td>\n<\/tr>\n<tr>\n<td>wisconsin<\/td>\n<td>10<\/td>\n<td>8<\/td>\n<td>25.00%<\/td>\n<\/tr>\n<\/table>\n<p>There are some significant differences there (like the 55% increase on SELECT speeds, for example), but a single execution is never a good test. Also, it&#8217;s unclear whether the differences are between the compilations, the platform or just pure coincidence. This requires further investigation. <\/p>\n<p>As a coincidence, Krish Shankar posted <a href=\"http:\/\/blogs.sun.com\/krishs\/entry\/sun_studio_compiler_options_for1\">these notes<\/a> on using SunStudio 11 and SunStudio 12 and the right compiler flags to get the best optimization. <\/p>\n<p>I decided to do 10-pass iterations of sql-bench and compare both 32-bit and 64-bit standard builds, the 32-bit standard builds against Krish&#8217;s optimizations, and finally 32-bit and 64-bit optimized builds. <\/p>\n<blockquote>\n<p>\nSome notes on all the tests: <\/p>\n<ul>\n<li>All builds are 5.0.56<\/li>\n<li>All tests are run on SunOS 5.11, snv_81<\/li>\n<li>Tests are executed on the same OS and machine running in 64-bit. The SPARC tests are on an UltraSPARC IIIi@1.28GHz Workstation with 1GB RAM; x86 are on a Dell T105, Opteron 1212 with 4GB RAM. Of course we&#8217;re not comparing machine speed, just 32-bit binaries over 64-bit. <\/li>\n<li>All results are in seconds; lower values mean faster performance.\n<\/li>\n<li>In all tests I&#8217;m using the built-in defaults (i.e. no my.cnf anywhere) so as to simulate a standardized installation.<\/li>\n<\/ul>\n<\/blockquote>\n<p>Let&#8217;s first look at x86 and the 32-bit standard and 32-bit optimized builds: <\/p>\n<table border=\"1\">\n<tr>\n<th>Test (x86, 32-bit)<\/th>\n<th>32-bit (standard)<\/th>\n<th>32-bit (optimized)<\/th>\n<th>+\/-<\/th>\n<\/tr>\n<tr>\n<td>ATIS<\/td>\n<td>15.4<\/td>\n<td>21<\/td>\n<td>-26.67%<\/td>\n<\/tr>\n<tr>\n<td>alter-table<\/td>\n<td>15<\/td>\n<td>16.3<\/td>\n<td>-7.98%<\/td>\n<\/tr>\n<tr>\n<td>big-tables<\/td>\n<td>13.7<\/td>\n<td>12.5<\/td>\n<td>9.60%<\/td>\n<\/tr>\n<tr>\n<td>connect<\/td>\n<td>77.6<\/td>\n<td>133<\/td>\n<td>-41.65%<\/td>\n<\/tr>\n<tr>\n<td>create<\/td>\n<td>343.7<\/td>\n<td>350.6<\/td>\n<td>-1.97%<\/td>\n<\/tr>\n<tr>\n<td>insert<\/td>\n<td>760.3<\/td>\n<td>1043.8<\/td>\n<td>-27.16%<\/td>\n<\/tr>\n<tr>\n<td>select<\/td>\n<td>394.8<\/td>\n<td>384.2<\/td>\n<td>2.76%<\/td>\n<\/tr>\n<tr>\n<td>transactions<\/td>\n<td>10.8<\/td>\n<td>18.6<\/td>\n<td>-41.94%<\/td>\n<\/tr>\n<tr>\n<td>wisconsin<\/td>\n<td>6.6<\/td>\n<td>10.1<\/td>\n<td>-34.65%<\/td>\n<\/tr>\n<\/table>\n<p>The standard build uses gcc instead of SunStudio, but I don&#8217;t get the same performance increases that Krish saw &#8211; in fact, I see reductions in performance, not improvements at all. I&#8217;m going to rebuild and retest, because I&#8217;m convinced there&#8217;s a problem here with the builds that I&#8217;m not otherwise seeing. I certainly don&#8217;t expect to get results that show a 27% reduction in insert speed. That said, a 10% big-table increase is interesting. I&#8217;ll redo these builds and find out if the slow down is as marked as it here.<\/p>\n<p>Here&#8217;s the comparison for standard builds between 32-bit and 64-bit standard builds on x86: <\/p>\n<table border=\"1\">\n<tr>\n<th>Test (x86,  standard)<\/th>\n<th>32-bit<\/th>\n<td>64-bit<\/p>\n<th>+\/-<\/th>\n<\/td>\n<\/tr>\n<tr>\n<td>ATIS<\/td>\n<td>15.4<\/td>\n<td>13.5<\/td>\n<td>14.07%<\/td>\n<\/tr>\n<tr>\n<td>alter-table<\/td>\n<td>15<\/td>\n<td>10.6<\/td>\n<td>41.51%<\/td>\n<\/tr>\n<tr>\n<td>big-tables<\/td>\n<td>13.7<\/td>\n<td>10.6<\/td>\n<td>29.25%<\/td>\n<\/tr>\n<tr>\n<td>connect<\/td>\n<td>77.6<\/td>\n<td>76.4<\/td>\n<td>1.57%<\/td>\n<\/tr>\n<tr>\n<td>create<\/td>\n<td>343.7<\/td>\n<td>346<\/td>\n<td>-0.66%<\/td>\n<\/tr>\n<tr>\n<td>insert<\/td>\n<td>760.3<\/td>\n<td>681.6<\/td>\n<td>11.55%<\/td>\n<\/tr>\n<tr>\n<td>select<\/td>\n<td>394.8<\/td>\n<td>254.8<\/td>\n<td>54.95%<\/td>\n<\/tr>\n<tr>\n<td>transactions<\/td>\n<td>10.8<\/td>\n<td>10.7<\/td>\n<td>0.00%<\/td>\n<\/tr>\n<tr>\n<td>wisconsin<\/td>\n<td>6.6<\/td>\n<td>5.8<\/td>\n<td>13.79%<\/td>\n<\/tr>\n<\/table>\n<p>There are some incredible differences here &#8211; more than 50% increase in SELECT, and 30% for the big-tables test show that there is some advantage to having the 64-bit builds on x86 enabled.<\/p>\n<p>Unfortunately I&#8217;ve had problems with the 64-bit optimized builds on my machine, so I haven&#8217;t completed optimized test comparisons.<\/p>\n<p>On SPARC, Sun Studio is used as the default compiler, and the standard 32-bit and 64-bit show little difference: <\/p>\n<table border=\"1\">\n<tr>\n<th>Test (SPARC, standard)<\/th>\n<th>32-bit<\/th>\n<th>64-bit<\/th>\n<th>+\/-<\/th>\n<\/tr>\n<tr>\n<td>ATIS<\/td>\n<td>28.6<\/td>\n<td>27.5<\/td>\n<td>4.00%<\/td>\n<\/tr>\n<tr>\n<td>alter-table<\/td>\n<td>27<\/td>\n<td>26.7<\/td>\n<td>1.12%<\/td>\n<\/tr>\n<tr>\n<td>big-tables<\/td>\n<td>26.9<\/td>\n<td>29.4<\/td>\n<td>-8.50%<\/td>\n<\/tr>\n<tr>\n<td>connect<\/td>\n<td>166.3<\/td>\n<td>173.6<\/td>\n<td>-4.21%<\/td>\n<\/tr>\n<tr>\n<td>create<\/td>\n<td>155<\/td>\n<td>143.1<\/td>\n<td>8.32%<\/td>\n<\/tr>\n<tr>\n<td>insert<\/td>\n<td>1577.3<\/td>\n<td>1572.3<\/td>\n<td>0.32%<\/td>\n<\/tr>\n<tr>\n<td>select<\/td>\n<td>807.4<\/td>\n<td>761.6<\/td>\n<td>6.01%<\/td>\n<\/tr>\n<tr>\n<td>transactions<\/td>\n<td>19.5<\/td>\n<td>18.75<\/td>\n<td>4.00%<\/td>\n<\/tr>\n<tr>\n<td>wisconsin<\/td>\n<td>11.1<\/td>\n<td>11.4<\/td>\n<td>-2.63%<\/td>\n<\/tr>\n<\/table>\n<p>Overall, a pretty insignificant difference here. <\/p>\n<p>Now let&#8217;s compare the standard and optimized builds using Krish&#8217;s flags on SPARC: <\/p>\n<table border=\"1\">\n<tr>\n<th>Test (SPARC)<\/th>\n<th>32-bit (standard)<\/th>\n<th>32-bit (optimized)<\/th>\n<th>+\/-<\/th>\n<\/tr>\n<tr>\n<td>ATIS<\/td>\n<td>28.6<\/td>\n<td>27.75<\/td>\n<td>3.06%<\/td>\n<\/tr>\n<tr>\n<td>alter-table<\/td>\n<td>27<\/td>\n<td>26.25<\/td>\n<td>2.86%<\/td>\n<\/tr>\n<tr>\n<td>big-tables<\/td>\n<td>26.9<\/td>\n<td>25<\/td>\n<td>7.60%<\/td>\n<\/tr>\n<tr>\n<td>connect<\/td>\n<td>166.3<\/td>\n<td>162.5<\/td>\n<td>2.34%<\/td>\n<\/tr>\n<tr>\n<td>create<\/td>\n<td>155<\/td>\n<td>145.25<\/td>\n<td>6.71%<\/td>\n<\/tr>\n<tr>\n<td>insert<\/td>\n<td>1577.3<\/td>\n<td>1551.5<\/td>\n<td>1.66%<\/td>\n<\/tr>\n<tr>\n<td>select<\/td>\n<td>807.4<\/td>\n<td>769.625<\/td>\n<td>4.91%<\/td>\n<\/tr>\n<tr>\n<td>transactions<\/td>\n<td>19.5<\/td>\n<td>16.875<\/td>\n<td>15.561%<\/td>\n<\/tr>\n<tr>\n<td>wisconsin<\/td>\n<td>11.1<\/td>\n<td>10.875<\/td>\n<td>2.07%<\/td>\n<\/tr>\n<\/table>\n<p>The tests here show little significant difference between the standard and the optimized builds, although 6-7% would probably be enough to prefer an optimized build if you wanted to build your own. <\/p>\n<p>Now let&#8217;s compare the optimized, Sun Studio 12 builds running in 32-bit and 64-bit: <\/p>\n<table border=\"1\">\n<tr>\n<th>Test (SPARC, optimized)<\/th>\n<th>32-bit<\/th>\n<th>64-bit<\/th>\n<th>+\/-<\/th>\n<\/tr>\n<tr>\n<td>ATIS<\/td>\n<td>27.75<\/td>\n<td>27.3<\/td>\n<td>1.65%<\/td>\n<\/tr>\n<tr>\n<td>alter-table<\/td>\n<td>26.25<\/td>\n<td>26.6<\/td>\n<td>-1.32%<\/td>\n<\/tr>\n<tr>\n<td>big-tables<\/td>\n<td>25<\/td>\n<td>25<\/td>\n<td>0.00%<\/td>\n<\/tr>\n<tr>\n<td>connect<\/td>\n<td>162.5<\/td>\n<td>162<\/td>\n<td>0.31%<\/td>\n<\/tr>\n<tr>\n<td>create<\/td>\n<td>145.25<\/td>\n<td>154.3<\/td>\n<td>-5.87%<\/td>\n<\/tr>\n<tr>\n<td>insert<\/td>\n<td>1551.5<\/td>\n<td>1535.1<\/td>\n<td>1.07%<\/td>\n<\/tr>\n<tr>\n<td>select<\/td>\n<td>769.625<\/td>\n<td>771.2<\/td>\n<td>-0.20%<\/td>\n<\/tr>\n<tr>\n<td>transactions<\/td>\n<td>16.875<\/td>\n<td>19.1<\/td>\n<td>-11.65%<\/td>\n<\/tr>\n<tr>\n<td>wisconsin<\/td>\n<td>10.875<\/td>\n<td>10.7<\/td>\n<td>1.64%<\/td>\n<\/tr>\n<\/table>\n<p>The differences are virtually non-existent, and taking the reductions and increases in performance overall, there&#8217;s probably little difference.<\/p>\n<p>The overall impression is that on x86 the improvement  of 64-bit over 32-bit is significant enough that it&#8217;s probably a good idea to make 64-bit the default. On SPARC, the difference in the optimized builds is so slight that for compatibility reasons alone, 32-bit would probably make a better default.<\/p>\n<p>I&#8217;ll probably be re-running these tests over the next week or so (particularly the x86 so I can get a true comparison of the 64-bit optimized improvements), and I&#8217;ll try the T1000 which I upgraded to snv_81 over the weekend,  but I think indications are good enough to make a reasonable recommendation of 64-bit over 32-bit. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been working with the folks working on OpenSolaris for a few months now providing advice and input on getting MySQL and the connectors (C\/ODBC and C\/J) installed as a standard component. Having got the basics in, the team are now looking at adding both 32-bit and 64-bit packages.<br \/>\nThe question raised at the end [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[36],"_links":{"self":[{"href":"https:\/\/planet.mcb.guru\/index.php?rest_route=\/wp\/v2\/posts\/1164"}],"collection":[{"href":"https:\/\/planet.mcb.guru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/planet.mcb.guru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/planet.mcb.guru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planet.mcb.guru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1164"}],"version-history":[{"count":0,"href":"https:\/\/planet.mcb.guru\/index.php?rest_route=\/wp\/v2\/posts\/1164\/revisions"}],"wp:attachment":[{"href":"https:\/\/planet.mcb.guru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/planet.mcb.guru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1164"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/planet.mcb.guru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}