sources:

InnoDB buffer pool:

  • usual recommendation is 50 – 75% of available RAM on dedicate database machine
  • but real amount depends on number of connections and settings influencing memory usage per connection
  • here is an interesting article – Calculating InnoDB Buffer Pool Size for Your MySQL Server – points out importance of the total log file size

Memory for connections:

  • basic calculation for MyISAM is:
    • key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections

But do not forget to count memory for OS!

Real setting:

  • min 20% RAM for OS
  • memory for MyISAM connections (if you use this engine)
  • rest for InnoDB memory pool

And avoid swapping…