{"id":1006,"date":"2017-03-27T12:49:19","date_gmt":"2017-03-27T11:49:19","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=1006"},"modified":"2017-03-27T12:54:47","modified_gmt":"2017-03-27T11:54:47","slug":"controlling-mysql-queries-killing-necessary","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2017\/03\/27\/controlling-mysql-queries-killing-necessary\/","title":{"rendered":"Controlling MySQL Queries, and killing if necessary."},"content":{"rendered":"<p>Today we had a customer call in who had a problem with their magento site. What had happened was they had reached the maximum number of connections for their MySQL. <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n 250481 | someuser | localhost:7777 | somewebsite | Query   | 2464 | Writing to net               | SELECT \/*!40001 SQL_NO_CACHE *\/ * FROM `mg_sales_flat_quote_address`                                 \r\n\r\n| 250486 | someuser | localhost       | somewebsite | Query   | 2459 | Waiting for table level lock | INSERT INTO `mg_sales_flat_quote_address` (`quote_id`, `created_at`, `updated_at`, `customer_id`, `a |         0 |             0 |         0 |\r\n\r\n.. and a whole load more waiting for table level lock were underneath\r\n\r\n<\/pre>\n<p>Solution is simple;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nkill 250481\r\n<\/pre>\n<p>250481 is the processid of the select query causing these issues. I suspect it will go away, eventually but in the meantime, want to make sure the max connections don&#8217;t get reached, otherwise website will be down again!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we had a customer call in who had a problem with their magento site. What had happened was they had reached the maximum number of connections for their MySQL. 250481 | someuser | localhost:7777 | somewebsite | Query | &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2017\/03\/27\/controlling-mysql-queries-killing-necessary\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,61,1],"tags":[],"class_list":["post-1006","post","type-post","status-publish","format-standard","hentry","category-mysql","category-rackspace","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1006"}],"version-history":[{"count":2,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1006\/revisions"}],"predecessor-version":[{"id":1008,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1006\/revisions\/1008"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=1006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=1006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}