I have recently started on a PoC project wherein we are developing a small web app. The initial setup is done on a micro instance from AWS. We are on rails+mysql stack.
After installing/running MySQL, I see that about 500+ MB RAM has been consumed already; leaving quite less for rest of the systems (micro instances have barely 620 MB RAM).
Our app is fairly simple at this stage. Can I do something to reduce the memory consumed by MySQL server?
Appreciate the help.
Best Answer
In your
/etc/my.cnf
file:And restart MySQL. This should chop memory usage dramatically if you previously had it on.
Edit: For MySQL versions between 5.7.8 and 8.0.1 (not required from 8.0.1 onwards), the above is not enough to free your memory of performance schema data:
(source)
To prevent this behaviour, set
show_compatibility_56
to 1 in addition toperformance_schema
. That is to say, your my.cnf changes should look like: