Error connecting to dB on specific search strings

This topic contains 26 replies, has 4 voices, and was last updated by  Iain Brewster 5 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #481125

    Iain Brewster
    Expired Member
    Post count: 74

    Hi all,
    I’m using V2 really happy with it.

    I have noticed something around the search function however and can’t scope the size of the problem.

    When I search Novotel paddington or Novotel London

    I get the wordpress error
    “Error establishing connection to databse” of I just any other searches are fine and if I put something made up I. It will bring up the search not found result.

    Are you able to advise the potential issue?

    I am unable to understand the pact of this as it seems to be around specific search.

    Thanks

    #481167

    Paolo
    Site Admin
    Post count: 31206

    Can you recreate the problem every time you search for those terms?

    Normally database connections problems, are due to problems with the database server in shared hosting.

    If you provide a link, admin and cpanel credentials in a private reply, we’ll have a look.

    Thank you

    #481175

    Iain Brewster
    Expired Member
    Post count: 74
    This reply has been marked as private.
    #481191

    Paolo
    Site Admin
    Post count: 31206
    This reply has been marked as private.
    #481254

    Iain Brewster
    Expired Member
    Post count: 74
    This reply has been marked as private.
    #481343

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Ian,

    I seen a number of issues, firstly the search page was in the trash, i restored it and then its slug was conflicting with BP so i changed it.

    For the number of listings you have and the plugins you are running your server spec is not really enough, please read this https://wpgeodirectory.com/making-your-wordpress-site-slow/

    When you do a search that goecodes a location to GPS it then has to do some heafty SQL queries, how heavy they are depends on a few things but i would say the issue is simply that the server can’t handel it.

    I’m not sure it is having any negative affect but i would check the cloudflare logs to see if maybe its triggering any security rules.

    Thanks,

    Stiofan

    #481469

    Iain Brewster
    Expired Member
    Post count: 74
    This reply has been marked as private.
    #481478

    Iain Brewster
    Expired Member
    Post count: 74
    This reply has been marked as private.
    #481790

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Ian,

    The issues in your theme functions file is your custom code, it was malformed quotation marks, i have fixed those for you.

    The server just is not up to the task, even this non specific non GD query done directly on the DB takes over 1 second

    SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
    FROM wp_posts  
    WHERE 1=1
    AND wp_posts.post_type = 'gd_place'
    AND (wp_posts.post_status = 'publish'
    OR wp_posts.post_status = 'closed'
    OR wp_posts.post_status = 'private'
    OR wp_posts.post_status = 'hidden')
    LIMIT 0, 10

    With that many listings you need to bump your server spec.
    I would also not run a forum on the same site as a directory, a forum is a hungry plugin.

    If you need more advice about hosting please ask.

    Stiofan

    #481985

    Iain Brewster
    Expired Member
    Post count: 74

    Really appreciate your help with this stiofan.

    I think the support here is always incredible so thanks again.

    With regards the server.
    My current VPS spec is

    2 GB RAM.
    2 Cores CPU.
    120 GB Disk Space.
    1.5 TB Bandwidth

    Where can I find what would be required to speed my site up?

    Thanks again

    #481992

    Alex Rollin
    Moderator
    Post count: 27815

    You can read the recommended server requirements here: https://wpgeodirectory.com/docs/server-requirements/

    #482204

    Iain Brewster
    Expired Member
    Post count: 74
    This reply has been marked as private.
    #482310

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Iain,

    Who is your hosting with, even loading the cpanel is pretty slow for me. The changes did not seem to boost query times…

    Where is the majority of your target users?

    Stiofan

    #482311

    Iain Brewster
    Expired Member
    Post count: 74
    This reply has been marked as private.
    #482468

    Iain Brewster
    Expired Member
    Post count: 74
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 27 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount