You are here:  » Localhost running auto SELECT queries against shop products

Localhost running auto SELECT queries against shop products

Submitted by Retro135 on Tue, 2019-09-03 13:14 in

Recently, been getting frequent OOMs which kill mySQL. Viewing top in Terminal, the mysqld CPU jumps intermittently from 0 then raises to 195% (probably crashes then). I have auto restart so site operates. In PMA, I'm seeing these weird localhost automatic queries (I have 3 screenshots) that are SELECT DISTINCT items against products with Fulltext initialization. I have slow log set, here's a few of those entries, however, the queries run every few seconds, so these are just the longer ones (long-query-time=10):

{code saved}

How to troubleshoot this? I've never seen this before.

Submitted by support on Tue, 2019-09-03 13:57


I don't think they're anything being invoked automatically - with MySQL running on the same server as your website every query will be showing as coming from "localhost" as that is where PHP/your web server is running...

The queries you mentioned are for Related Products - I just saw your follow up post where you checked the products referred to in the queries and they no longer exist in the database however that is intentional (in the distribution) in order to show related products for products no longer in the database (even if site is not configured to show related products) but you can disable this easily - I know you have been using the script for several years now so I looked at most recent products.php from email and you should have the following code at line 82:

  if ($config_useRelated || (!isset($product)))

...if you only wish to show related products for live products, you can REPLACE with:

  if (isset($product))

Hope this helps!


Submitted by Retro135 on Tue, 2019-09-03 15:14

Ack, yes, see the SELECT DISTINCT code in products.php. I decided to just turn off related. Thank you, David!