Continuously showing "Error establishing database connection"

0

I've a website hosted on AWS EC2 instance (Ubuntu) developed by WordPress. At the beginning of the development, the site was running smooth without any error. But some day's later, it's continuously showing "Error establishing database connection" page on my wordpress website in two minutes in a row.

wp-config.php is completely okay and there is no miss information regarding database connection (username, db name, host and pass).

My developer's are saying that it's showing for heavy traffic and when some users are visiting at same time, the database process is getting high. Is it correct???

Currently my site traffic is only 500 users per day and max 50 traffic at a time. Can someone please help me to solve this ignominious situation?

Thanks.

profile picture
Saif
gefragt vor einem Jahr231 Aufrufe
1 Antwort
0

Hi Saif,

This is a common issue with PHP based framework (Stateless DB connection). There are many best prectices shared by AWS to run such workload you can see here

But the simpler solutions would be improve the caching for read only user and there are many easy ways to do that, one of the simple one is to implement plugins like W3 Total Cache.

But if you are planning to serve larger user number I would suggest moving the Database to Aurora, Setup Cloud front and S3 Plugin for static content. The document here explain all the implementation steps needed.

beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen