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
已提問 1 年前檢視次數 231 次
1 個回答
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.

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南