AbanteCart Community

Shopping Cart Operations => Support => General Support => Topic started by: aiswarjya on January 28, 2016, 01:51:21 AM

Title: Problem in 'online_customers' Mysql Killed Queries Logs
Post by: aiswarjya on January 28, 2016, 01:51:21 AM
Helo Abantecart
Suddenly I found that my site take very slow response. When i contact to my server administrator they said that the problem in the SQL query.


localhost   2015-12-05 17:07:47   mand:Query   :DELETE   site_online_customers` WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`date_added`) > 3600
localhost   2015-12-05 17:07:47   mand:Query   :DELETE   site_online_customers` WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`date_added`) > 3600
localhost   2015-12-05 17:07:47   mand:Query   :DELETE   site_online_customers` WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`date_added`) > 3600
localhost   2015-12-05 17:07:47   mand:Query   :DELETE   site_online_customers` WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`date_added`) > 3600
localhost   2015-12-05 17:07:47   mand:Query   :DELETE   site_online_customers` WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`date_added`) > 3600
localhost   2016-01-15 13:01:41   mand:Query   :UPDATE   ducts SET viewed = viewed + 1 WHERE product_id = '2867'
localhost   2016-01-19 13:41:51   mand:Query   :DELETE   site_online_customers` WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`date_added`) > 3600
localhost   2016-01-19 13:42:11   mand:Query   :DELETE   site_online_customers` WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`date_added`) > 3600
Title: Re: Problem in 'online_customers' Mysql Killed Queries Logs
Post by: eCommerce Core on January 28, 2016, 07:08:12 AM
Let us check this one.

Meanwhile, there was a fix for one slow query. You can see changes here or copy these files over.
https://github.com/abantecart/abantecart-src/commit/1f4ffd44ffeb0931e2228b35f230b7045ba393ba
Title: Re: Problem in 'online_customers' Mysql Killed Queries Logs
Post by: abolabo on January 28, 2016, 12:23:38 PM
please run this SQL query in your phpmyadmin
Code: [Select]
ALTER TABLE `site_online_customers`
CHANGE COLUMN `ip` `ip` VARCHAR(50) NOT NULL ,
ADD INDEX `site_online_customers_idx` (`date_added` ASC);

Then replace file
public_html/storefront/model/tool/online_now.php
by attached
and let us know about result