First of all I’ve looked for this issue in the community and over the web as well but I don’t understand the answers or didn’t find the answer at all.
- AWS EC2 (T2.Small) - 1 vCPU - 2GB RAM
- CentOS 7.9 and using Webmin Panel
- The Websites Using WordPress
In this BlackFriday I expect hundreds of visits so I tried to use Apache JMeter to test my website (100 Users in 10 Seconds) without Cloudflare so the CPU usage became 103% and and a lot of memory usage, the MySQL is down and restarted (because I’m using RestartAlways command in the configuration), Anyway I decide to use the Cloudflare to protect my website from DDoS attack so I moved from Route53 to Cloudflare and configuring it like the Docs then I try to test my website with JMeter once again then I noticed that the CPU Usage and the RAM is very normal but MySQL Server is out of memory without stop working (My other domains in the same EC2 don’t use Cloudflare are working properly) But the Cloudflare’s website generates (Error establishing a database connection) … Calm Down and don’t say go to search I already have looked for that issue because I don’t want to wait for community but I nothing help … Anyway the website start working again in few seconds without any action from me but this scenario is not good with visitors so I need to solve that.
The MySQL’s log file Out Of Memory messages:
InnoDB: mmap(137756672 bytes) failed; errno 12 201118 13:16:35 InnoDB: Completed initialization of buffer pool 201118 13:16:35 InnoDB: Fatal error: cannot allocate memory for the buffer pool 201118 13:16:35 [ERROR] Plugin 'InnoDB' init function returned error. 201118 13:16:35 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 201118 13:16:35 [ERROR] mysqld: Out of memory (Needed 128917504 bytes) 201118 13:16:35 [ERROR] mysqld: Out of memory (Needed 96681984 bytes) 201118 13:16:35 [ERROR] mysqld: Out of memory (Needed 72499200 bytes) 201118 13:16:35 [Note] Plugin 'FEEDBACK' is disabled. 201118 13:16:35 [ERROR] Unknown/unsupported storage engine: InnoDB 201118 13:16:35 [ERROR] Aborting
Anyone can help?
This is my Cloudflare’s DNS Records
- Full (strict) because I’m using Lets Encrypt free certificate for all domains.
- Always Use HTTPS is ON