{"id":223,"date":"2013-01-05T19:18:00","date_gmt":"2013-01-05T17:18:00","guid":{"rendered":"http:\/\/evcz.tk\/blog\/?p=223"},"modified":"2013-01-08T13:33:11","modified_gmt":"2013-01-08T11:33:11","slug":"processing-mysql-dumps-in-hurry-convert-single-insert-to-extended-insert","status":"publish","type":"post","link":"https:\/\/evcz.tk\/blog\/2013\/01\/05\/processing-mysql-dumps-in-hurry-convert-single-insert-to-extended-insert\/","title":{"rendered":"Processing mysql dumps in hurry (convert single insert to extended insert)"},"content":{"rendered":"<p>Most time there&#8217;s little time, sometime there&#8217;s NO TIME!<\/p>\n<p>A few days ago I had no time, and had to manipulate a badly exported database (2million+ single myisam insert statements) tuning mysqld was useless, insert delayed useless, increasing buffers useless&#8230; and so on&#8230; import was taking hours (many hours) on the target box due to impressively high disk io!<\/p>\n<p>So I just fired up a vmware instance with 32gb of ram, 10gb hdd and 8cpu cores (of a xeon L56xx) and did everything in ram.<br \/>\nWhat was going to take hours on the target box took just 2minutes on the vmware instance&#8230;<br \/>\nThen I did a proper &#8220;mysqldump &#8211;opt&#8221; and imported it back into the target box in just 20seconds \ud83d\ude00<\/p>\n<pre lang=\"bash\">yum upgrade -y\r\nwget -q -O - http:\/\/www.atomicorp.com\/installers\/atomic | sh\r\nmkdir -p \/var\/lib\/mysql && mount -v -t tmpfs -o size=24G none \/var\/lib\/mysql\r\nyum install mysql mysql-server -y\r\nnano -w \/etc\/my.cnf\r\n<\/pre>\n<p>tune it up a little, in my case<\/p>\n<pre lang=\"bash\">thread_concurrency=16<\/pre>\n<p>was enough \ud83d\ude42<\/p>\n<pre lang=\"bash\">service mysqld restart\r\nmysql_secure_installation<\/pre>\n<p>and you are good to go!<\/p>\n<p>import the bad export and after that export it making use of all the proper settings (extended queries, locking and so on) &#8230; &#8211;opt handles all of them by default \ud83d\ude42<\/p>\n<p>So yes&#8230; sometime I make use of &#8220;the cloud&#8221; too :O<\/p>\n<p>PS: I do the same (storage on ramdisk) when I&#8217;ve to compile a linux kernel.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most time there&#8217;s little time, sometime there&#8217;s NO TIME! A few days ago I had no time, and had to manipulate a badly exported database (2million+ single myisam insert statements) tuning mysqld was useless, insert delayed useless, increasing buffers useless&#8230; and so on&#8230; import was taking hours (many hours) on the target box due to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/evcz.tk\/blog\/2013\/01\/05\/processing-mysql-dumps-in-hurry-convert-single-insert-to-extended-insert\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Processing mysql dumps in hurry (convert single insert to extended insert)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,20],"tags":[5,27],"class_list":["post-223","post","type-post","status-publish","format-standard","hentry","category-howto","category-snippets","tag-centos","tag-cloud"],"_links":{"self":[{"href":"https:\/\/evcz.tk\/blog\/wp-json\/wp\/v2\/posts\/223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/evcz.tk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/evcz.tk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/evcz.tk\/blog\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/evcz.tk\/blog\/wp-json\/wp\/v2\/comments?post=223"}],"version-history":[{"count":5,"href":"https:\/\/evcz.tk\/blog\/wp-json\/wp\/v2\/posts\/223\/revisions"}],"predecessor-version":[{"id":228,"href":"https:\/\/evcz.tk\/blog\/wp-json\/wp\/v2\/posts\/223\/revisions\/228"}],"wp:attachment":[{"href":"https:\/\/evcz.tk\/blog\/wp-json\/wp\/v2\/media?parent=223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/evcz.tk\/blog\/wp-json\/wp\/v2\/categories?post=223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/evcz.tk\/blog\/wp-json\/wp\/v2\/tags?post=223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}