I hate looking for this….

This will give you a rough idea of your innodb memory usage. I know it’s in a hundred spots, but i hate looking for it when i double check things.

innodb_buffer_pool_size
+ key_buffer_size
+ max_connections*(sort_buffer_size+read_buffer_size+binlog_cache_size +2MB)

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
 

5 Responses to MySQL: Innodb Memory Usage Formula

  1. Shlomi Noach says:

    Hi,

    Just a few remarks:
    * The formula you’ve presented does not relate directly to InnoDB. The innodb_buffer_pool_size is in fact the only innodb related parameter there.

    * It also formulates a worst case scenario where all possible connections are open, all querying, all using the sort buffer (you may as well have thrown in the join_buffer_size).

    * The formula also measures key_buffer_size. If you’re using MyISAM tables, than make sure the memory sum of the formula is well below system memory, since MyISAM really needs OS page cache.

    Regards

  2. jon says:

    Hi Shlomi,
    Yes, it’s the worst case scenario. However, I’ve seen it happen often enough to know that a system won’t recover once it starts paging to disk.

    What else would you factor in, assuming only innodb is in use?

  3. Shlomi Noach says:

    Hi,

    Missing from the equation is the thread_stack_size (per connection), query_cache_size (global).

    There isn’t anything I would add to the equation which relates to InnoDB. buffer_pool_size is the only thing I consider (to be honest, I don’t even count query_cache_size as this usually measures in a few MB)

    Regards

  4. Hi,

    You could also try or which both will assist you in figuring out MySQL memory usage.

  5. (Seems like the links was stripped from my previous comment)

    You could also try http://www.omh.cc/mycnf/ or http://wiki.mysqltuner.com/MySQLTuner which both will assist you in figuring out MySQL memory usage.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>