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
asked 10 months ago223 views
1 Answer
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.

answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions