Monthly Archives: March 2019

MySQL Memory Reduction

It’s been a while since I’ve posted on here. In fact it’s been so long that all of my old posts have been deleted after migrating. So I decided I would start off with something simple. I’ve moved everything to AWS and ran into a problem right off the bat with hosting it on AWS. The server unexpectedly shut down, so I started poking around the logs to see what I could gleam from there. Looking in the apache server logs I noticed this message:

mmap() failed: [12] Cannot allocate memory

After looking at what processes were taking up the most memory I saw that MySQL was using around 50% of the 1G of RAM that this blog is hosted on (AWS micro instance). So after some googling on how to reduce MySQL memory usage I came across this setting:

performance_schema=0

Which works as long as you don’t need the performance schema data. For me this is acceptable since I don’t need to look at it for the purposes of hosting my personal site.