error establishing a database connection

Home Forums Product Support Forums Ajax Search Pro for WordPress Support error establishing a database connection

This topic contains 12 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 years, 3 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #10777
    hdarab
    hdarab
    Participant

    Hello,

    I face issue with you plugin after i active in my site, i see this message in Arabic “error establishing a database connection” every 1 to 5 minutes.
    like when 200 visitors login site after 200 it will be face this message.

    thanks

    #10785
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you for the details, I’ve looked through your configuration, and made a few changes, that should affect the performace and should fix the issue. I suspect your database might have been overloaded, which caused the problem. You can find all the tweaks on this documentation article as well: https://goo.gl/Rn6lG6

    1. I’ve enabled and generated the index table engine. It’s made exactly for cases like yours. It gives a huge performance boost, and reduces the database usage. More about index table here: https://goo.gl/ooNYPY

    2. I’ve also enabled the Custom Ajax Handler.

    I have also re-enabled the search in the dropdown_boxes.php file in the theme child directory, to see if the problem re-appears. It appears to be working without issues now. I have not made changes to any other files.

    I hope this helps!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10815
    hdarab
    hdarab
    Participant

    HI,

    is still message coming out “error establishing a database connection”.
    this issue is showing when i have traffic in my site.

    maybe is from php configuration in my server ?!

    #10822
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I don’t think it’s related to the PHP configuration. The error message means, that the database server gets overloaded. It might not be able to handle the search requests.

    Try turning off the “Trigger live search while typing” option: https://i.imgur.com/Y2u9uQP.png
    It saves a lot of performance, as the plugin is only triggered when the user hits the return button or clicks the Magnifier.

    Since you have a lot of traffic, I also recommend using a cache plugin, like WP Super cache (you have to enable the cache after activation). It saves a lot of performance, and lot’s of database connections.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10835
    hdarab
    hdarab
    Participant

    Hi,

    i do what you told me, but still i face this error.
    i turn off Trigger live search while typing and i install WP Super cache.
    is not make a different with DB error.

    #10844
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Are there any kind of error logs or something else to see?

    I’ve tried everything to re-create the problem, but I was not able to.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10862
    hdarab
    hdarab
    Participant

    Hi,

    yes you can see error logs in
    /public_html/wp-content/debug.log

    #10865
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thanks!

    Please not that the file is over 716MB. It’s pretty huge, and it might cause issues for loggers. I highly recommend deleting is occasionally.

    I haven’t found any error messages from Ajax Search Pro there though. There are many notices from the theme and the cache plugin, but those should not be a problem. I see warnings as well, which are more important

    From the wp-movies plugin:

    [15-Nov-2016 15:17:53 UTC] PHP Warning:  Creating default object from empty value in /home/hdarab/public_html/wp-content/plugins/wp-movies/classes/movieInfo/class_imdb_api.php on line 625
    [15-Nov-2016 15:17:53 UTC] PHP Warning:  Creating default object from empty value in /home/hdarab/public_html/wp-content/plugins/wp-movies/classes/movieInfo/class_imdb_api.php on line 188

    and from the theme:

    [15-Nov-2016 15:30:29 UTC] PHP Warning:  ucwords() expects parameter 1 to be string, array given in /home/hdarab/public_html/wp-content/themes/wp_movies-child/dropdown_boxes.php on line 56
    [15-Nov-2016 15:30:47 UTC] PHP Warning:  array_slice() expects parameter 1 to be array, null given in /home/hdarab/public_html/wp-content/themes/wp_movies-child/functions.php on line 41

    These should not be a problem either, these are only warnings, but should be fixed. Unfortunately I see no indication of errors in this file.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #11234
    hdarab
    hdarab
    Participant
    You cannot access this content.
    #11243
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    In which directory can I find the website? I tried var/www/html/ but it’s not that.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #11244
    hdarab
    hdarab
    Participant

    Hi,

    is CPanel the directory you will be found in /home/hd-arab/public_html

    thanks

    #11248
    hdarab
    hdarab
    Participant

    Hello,

    any update about the issue !?

    #11257
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    After a long time of searching I have not found any error messages or anything indicating database issues. Then I looked at the PHP configuration and your memory_limit is set to 32M which is very low!!!

    WordPress requires at least 64M to run correctly, but it’s recommended to use at least 96 – 512M depending on how many plugins you have and how much the server is uses.

    I’ve changed the memory limit via ini_set in your wp-config.php file to 96M (on line 25) and the issue seems to be resolved. If it re-appears just increase the memory limit more slowly, up to 512M if needed.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.