5

WordPress website(4years old) have been recently migrated from shared server to the AWS server (2cpu, 4GB ram,80 SSD).After migration website was working fine but in the night between 2am and 6am the CPU is showing spike in the usage(only on Saturday or Sunday) which cause the CPU to run out of memory and shutting down the whole server and also mail servers. After restarting the server website is running properly and also there is no spike in the CPU usage(10% - 15%). Screen shot of the logs attached https://prnt.sc/LTyOU9YrEHd6. Error logs before the website is down Usage after the server restart

What may be causing the problems with the CPU usage?, Is it because of the spamd usage or SQL usage?

Rakshith k
  • 51
  • 4

1 Answers1

6

What may be causing the problems with the CPU usage

Bad configuration.

First you need to reduce the memory overcommit (the default heuristic is way too optimistic on server hosts). There is lots of documentation on the internet. But a lot of them talk about choom and oomadj - DO NOT try to use these to solve your problem.

Next you need to configure all the services to limit the amount of memory they use up. I can't tell you how to do that because you didn't tell us what they were (don't reply with a list here - go research each daemon and of you can't find the answers, post new questions).

symcbean
  • 21,009
  • 1
  • 31
  • 52