MySQL tuning for low mem
I have Percona XtraDB Cluster running on three nodes, one of which is a 512MB DO VM. Percona provides the cluster gloss on top of MySQL 5.6.9.
Here is memory usage without MySQL running on an otherwise idle 64-bit Debian 8 droplet. I'm running 64-bit because etcd is not certified against 32-bit. (I'm running Debian because Debian thx.)
total used free shared buffers cached Mem: 494 109 385 0 2 52 -/+ buffers/cache: 55 439 Swap: 999 19 980
The swap is because I'd restarted mysql several times in this illustraiton.
After starting MySQL:
total used free shared buffers cached Mem: 494 488 5 0 0 24 -/+ buffers/cache: 464 30 Swap: 999 74 925
Ouch. I am using innodb, but I've tuned innodb_buffer_pool_size down to 32MB and mysql is still sucking up 400+ MB.
After some experimenting, I found that turning off the performance schema in the mysql config makes a mammoth difference.
"performance_schema = 0" in the mysql config makes a mammoth difference...here's the same droplet with MySQL running...only difference is turning off the performance schema:
total used free shared buffers cached Mem: 494 160 333 0 1 51 -/+ buffers/cache: 107 386 Swap: 999 20 979
Holy crap. 350MB just to keep performance stats in memory!?
I think the most important thing the performance schema could tell me in this situation is that the database performs much better with out it.
For LET support, please visit the interim support desk.