Slow search results on dedicated server
This topic contains 14 replies, has 2 voices, and was last updated by Stiofan O’Connor 7 years, 8 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
July 18, 2017 at 10:41 am #387496
Hi guys,
We’ve moved our site https://dinnerdata.co.uk/ to a new managed dedicated server, and whilst the site is generally performing faster, the searches have slowed down since we moved from the shared server environment.
The response from 1and1 is that the number of rows being queried is the reason for processor slow down.
I have copied their email below, can you let me know what you think to their comments?
“Dear Malcolm Stewart,
I have looked through the logs, here’s what we think. These are the slow logs:
# Time: 170718 10:46:28
# User@Host: dbo690621754[dbo690621754] @ localhost [] # Query_time: 0.908832 Lock_time: 0.000093 Rows_sent: 10 Rows_examined: 98046 SET timestamp=1500367588;
SELECT SQL_CALC_FOUND_ROWS wp_posts.*, wp_geodir_gd_place_detail.* FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_geodir_gd_place_detail ON (wp_geodir_gd_place_detail.post_id = wp_posts.ID) WHERE 1=1 AND (
wp_term_relationships.term_taxonomy_id IN (3)
) AND wp_posts.post_type = ‘gd_place’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘virtual’) GROUP BY wp_posts.ID ORDER BY wp_geodir_gd_place_detail.geodir_my_custom_sort asc, wp_geodir_gd_place_detail.is_featured asc, wp_posts.post_date desc, wp_posts.post_title LIMIT 10, 10; # Time: 170718 10:46:31 # User@Host: dbo690621754[dbo690621754] @ localhost [] # Query_time: 0.820267 Lock_time: 0.000112 Rows_sent: 10 Rows_examined: 98046 SET timestamp=1500367591;
SELECT SQL_CALC_FOUND_ROWS wp_posts.*, wp_geodir_gd_place_detail.* FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_geodir_gd_place_detail ON (wp_geodir_gd_place_detail.post_id = wp_posts.ID) WHERE 1=1 AND (
wp_term_relationships.term_taxonomy_id IN (3)
) AND wp_posts.post_type = ‘gd_place’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘virtual’) GROUP BY wp_posts.ID ORDER BY wp_geodir_gd_place_detail.geodir_my_custom_sort asc, wp_geodir_gd_place_detail.is_featured asc, wp_posts.post_date desc, wp_posts.post_title LIMIT 20, 10; # Time: 170718 10:46:34 # User@Host: dbo690621754[dbo690621754] @ localhost [] # Query_time: 0.797096 Lock_time: 0.000100 Rows_sent: 10 Rows_examined: 98046 SET timestamp=1500367594;
SELECT SQL_CALC_FOUND_ROWS wp_posts.*, wp_geodir_gd_place_detail.* FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_geodir_gd_place_detail ON (wp_geodir_gd_place_detail.post_id = wp_posts.ID) WHERE 1=1 AND (
wp_term_relationships.term_taxonomy_id IN (3)
) AND wp_posts.post_type = ‘gd_place’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘virtual’) GROUP BY wp_posts.ID ORDER BY wp_geodir_gd_place_detail.geodir_my_custom_sort asc, wp_geodir_gd_place_detail.is_featured asc, wp_posts.post_date desc, wp_posts.post_title LIMIT 30, 10; # Time: 170718 10:46:38 # User@Host: dbo690621754[dbo690621754] @ localhost [] # Query_time: 0.804067 Lock_time: 0.000094 Rows_sent: 4 Rows_examined: 98046 SET timestamp=1500367598;
SELECT SQL_CALC_FOUND_ROWS wp_posts.*, wp_geodir_gd_place_detail.* FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_geodir_gd_place_detail ON (wp_geodir_gd_place_detail.post_id = wp_posts.ID) WHERE 1=1 AND (
wp_term_relationships.term_taxonomy_id IN (3)
) AND wp_posts.post_type = ‘gd_place’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘virtual’) GROUP BY wp_posts.ID ORDER BY wp_geodir_gd_place_detail.geodir_my_custom_sort asc, wp_geodir_gd_place_detail.is_featured asc, wp_posts.post_date desc, wp_posts.post_title LIMIT 16010, 10;I think that the Rows_examined: 98046 is the root of tje issue. Processing this much data will slow the server down greatly. “
Thanks and regards
Malc
July 18, 2017 at 1:14 pm #387521Hi Malc,
Can you provide wp-admin and i’ll check over the queries to see if there is anything wrong.
Thanks,
Stiofan
July 18, 2017 at 4:44 pm #387559This reply has been marked as private.July 19, 2017 at 10:03 am #387664Hi Malc,
I notice you have some widgets set as random order, i would not have random order of anything if you have over a few hundred listings, it is the most expensive type of SQL query, please remove all random order by from widgets and anywhere else you might have, that should greatly improve things.
Thanks,
Stiofan
July 19, 2017 at 11:21 am #387669Hi Stiofan,
Thanks for coming back – I’ve changed the widgets I’m aware of to no longer use Random:
DD Homepage Area 2 >
1. GD > Popular Post View: Featured, FROM Random TO A-Z
2. GD > Popular Post View: A selection to tempt you…, FROM Random TO LatestGD Home Content Section >
1. GD > Popular Post View: Search Results, FROM Random TO Latest
2. GD > Popular Post View: Venue Spotlight > Post Category, FROM All TO Restaurants
3. GD > Popular Post View: Venue Spotlight, FROM Random TO A-ZThis has made no difference in respect of the problem we are experiencing.
To be clear about our problem: If from the homepage I enter the search term “Noodle” in the first search field and leave the second field blank, the search results take 1 minute and 17 seconds to come in. If I repeat that search (without closing the browser) it takes 4.1 seconds. Similarly on another browser the search result will be quick. Change the search term to “Noodles” plural, and we’re back to over a minute to get a result. To experience what we’re seeing I would suggest you try something like “Bangladeshi” as I haven’t used that search term.
Although we purchased and activated GD Booster, I have disabled it again, and I’m not really noticing any difference, so whilst testing this problem we’re leaving it disabled.
If we use the “Near me” search the results came in in 6.6 seconds.
The problem we have, therefore, is that users searching using the search field – the main purpose of our directory, will simply not use our site a second time, completely negating our business. I don’t know if it has any relevance but the form search returns the URL https://dinnerdata.co.uk/?geodir_search=1&stype=gd_place&s=Noodle&snear=&sgeo_lat=&sgeo_lon=, and the “Near me” search returns https://dinnerdata.co.uk/location/me/. Your own instructions in GD Booster comment on use of unfriendly permalinks, which the https://dinnerdata.co.uk/?geodir_search=1&stype=gd_place&s=Noodle&snear=&sgeo_lat=&sgeo_lon= seems to be an example of?
Our broadband download speed is over 25MB on wifi, and equivalent tests on cellular mobiles have had no better luck.
Obviously a bit of a critical problem for us here, so very grateful for an answer to this.
Many thanks
Best regards
Malc
July 19, 2017 at 1:04 pm #387689Have u got some sort of hosting backend or somewhere i can access PhpMyAdmin?
Stiofan
July 19, 2017 at 3:08 pm #387711This reply has been marked as private.July 19, 2017 at 3:12 pm #387712This reply has been marked as private.July 19, 2017 at 3:14 pm #387713Hi Stiofan,
Further to this I have a slow log report and some information from the server support team at 1and1.
They have said:
“We have found that your server is doing some queries that has some serious problems. Looking at your database, you only have 191,176 rows at the time of writing in the database, but the SQL queries are searching upwards of a million rows. I believe this is the reason some pages are having troubles. We got the second and third queries by searching for restaurants in Gloucester and then changing results page, whilst the first is pulled from the slow log.”
I have attached the log file they sent me.
Let me know about your preferred option for accessing the database from my previous message and I’ll set that up.
Thanks again Stiofan
Best regards
Malc
July 19, 2017 at 3:27 pm #387715Thanks for the log that should help, please see my reply above.
Stiofan
July 19, 2017 at 3:48 pm #387718This reply has been marked as private.July 19, 2017 at 6:47 pm #387743Hi Malc,
I am just finishing up for the night, i’ll tackle this in the morning.
Thanks,
Stiofan
July 20, 2017 at 11:05 am #387820Hi Malc,
Can you give this a try now.
Thanks,
Stiofan
July 20, 2017 at 11:37 am #387825Hi Stiofan,
YES – brilliant – thank you!!! You have absolutely nailed it by the looks of things, really appreciate it.
What was the issue and the fix?
Many thanks
Malc
July 20, 2017 at 1:19 pm #387840Glad to hear it!
Your server seems to fall down with sub queries in the main query, i researched it and it seems some servers suffer from this, i removed the sub query and just inject the results to the search query to get around it. I have sites running about 10x the listings you have that don’t suffer this so it must be some sort of server specific thing.
Anyway the fix will be in the next release of GD.
Thanks,
Stiofan
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket