Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › error establishing a database connection
- This topic has 12 replies, 2 voices, and was last updated 9 years, 5 months ago by
Ernest Marcinko.
-
AuthorPosts
-
November 8, 2016 at 10:03 pm #10777
hdarab
ParticipantHello,
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
November 9, 2016 at 10:13 am #10785Ernest Marcinko
KeymasterHi,
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!
November 9, 2016 at 9:12 pm #10815hdarab
ParticipantHI,
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 ?!
November 10, 2016 at 9:57 am #10822Ernest Marcinko
KeymasterHi,
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: http://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.
November 12, 2016 at 6:47 pm #10835hdarab
ParticipantHi,
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.November 14, 2016 at 4:27 pm #10844Ernest Marcinko
KeymasterHi,
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.
November 15, 2016 at 3:54 pm #10862hdarab
ParticipantHi,
yes you can see error logs in
/public_html/wp-content/debug.logNovember 15, 2016 at 4:55 pm #10865Ernest Marcinko
KeymasterThanks!
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:
[code][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[/code]and from the theme:
[code][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[/code]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.
December 10, 2016 at 10:07 pm #11234hdarab
ParticipantYou cannot access this content.
December 12, 2016 at 3:52 pm #11243Ernest Marcinko
KeymasterHi,
In which directory can I find the website? I tried var/www/html/ but it’s not that.
December 12, 2016 at 4:31 pm #11244hdarab
ParticipantHi,
is CPanel the directory you will be found in /home/hd-arab/public_html
thanks
December 13, 2016 at 7:53 am #11248hdarab
ParticipantHello,
any update about the issue !?
December 13, 2016 at 1:27 pm #11257Ernest Marcinko
KeymasterHi,
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.
-
AuthorPosts
- You must be logged in to reply to this topic.