You are here:  » Error hosting


Error hosting

Submitted by Tobix on Tue, 2021-09-21 18:25 in

Hi, David,
the hosting contacted me and told me that this line takes 20 seconds to process and even fails.

SELECT *,COUNT(id) AS numMerchants,MIN(price) as minPrice FROM `pt_products` GROUP BY search_name ORDER BY RAND() LIMIT 10

I also have other errors that surely are related to the filters that I can temporarily disable to find out if they are really them:
[21-Sep-2021 04:51:43 UTC] PHP Warning: preg_match(): Compilation failed: quantifier does not follow a repeatable item at offset 721 in /home/exjicmtr/public_html/includes/filter.php on line 225
{code saved}

Submitted by support on Wed, 2021-09-22 08:08

Hi Tobix,

That query isn't part of the distribution can you confirm which file that was added to and the surrounding code?

Regarding the warnings; that will be an issue with the configuration of one or more Drop Record RegExp filters; if you're not sure which is causing the error let me know the configuration values you are using and I'll check that out further for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by Tobix on Wed, 2021-09-22 14:06

This is the first error!! Noresults.php
This allows him to give the customer 10 products if he does not find anything in the comparator.

<?php
  $sql 
"SELECT *,COUNT(id) AS numMerchants,MIN(price) as minPrice FROM `".$config_databaseTablePrefix."products` GROUP BY search_name ORDER BY RAND() LIMIT 10";
  if (
database_querySelect($sql,$rows))
  {
    
$searchresults["products"] = $rows;
    foreach(
$searchresults["products"] as $k => $product)
    {
      
$searchresults["products"][$k]["productHREF"] = tapestry_productHREF($searchresults["products"][$k]);
    }
    require(
"html/searchresults.php");
  }
?>

Submitted by Tobix on Wed, 2021-09-22 17:03

The hosting lets me know that there are other slowdowns or processes taking too long here they are:

[Wed Sep 22 14:47:08 2021] Query killed - : SELECT *,COUNT(ID) AS NUMMERCHANTS,MIN(PRICE) AS MINPRICE FROM `PT_PRODUCTS` GROUP BY SEARCH_NAME ORDER BY RAND() LIMIT 10
{code saved}

How can I solve this problem? I deactivated all the filters and removed the random products.

Submitted by support on Thu, 2021-09-23 08:52

Hello Tobix,

ORDER BY RAND() is not ideal for large tables; I will experiment with some other options on my test server. In the mean time; regarding filters that will be an error with the REGEXP used in the configuration rather than a problem with the code. Please could you post an example of how you were drying to use Drop Record RegExp and I'll check it out further with you...

Cheers,
David.
--
PriceTapestry.com

Submitted by Tobix on Thu, 2021-09-23 16:49

The first move to do is undoubtedly to increase the hosting features currently working with 1 GB of Ram and 1 CPU.
I bought a 2 GB of Ram and 2 CPUs.
I'm trying to redo all the filters from scratch this time instead of working on single names maybe excluding whole categories which maybe is better.

Keep me updated for ORDER BY RAND ().
I am undecided whether to work with the wordpress plugin or the scripts ...

Submitted by support on Fri, 2021-09-24 08:14

Hi Tobix,

WordPress is quite a significant overhead if your site is primarily price comparison rather than a blog to which price comparison is added by way of the plugin (which is the primary intention of it). A typical use case is a review site where lots of unique content is created for a specific product (rather than using merchant descriptions) and then a price comparison table added via a shortcode.

For a site that is primarily comparison I would use the standalone script and if one wanted to add a blog in the future use something like Wordpress in a sub-directory...

Cheers,
David.
--
PriceTapestry.com