title: MySQL operating system cache
body: <p>We have a dedicated database server (MariaDB 5.5.31) hosting our database used by our java application (accessing the db via hibernate from another server). While our database itself is using about 12gb of RAM, the operating system (CentOS 6.4) is caching around 25gb additionally. </p>
  
  <p>Can you give me any advice, how we can influence this behaviour?</p>
  
  <p>While most of our 100 tables have less than 1000 entries, we have some tables with above 10 million. These tables experience lots of reads and writes.</p>
  
  <p>These are our db settings:</p>
  
  <pre><code>[server]
  
  [mysqld]
  port            = 3306
  socket          = /var/lib/mysql/mysql.sock
  character-set-server = utf8
  collation-server=utf8_general_ci
  skip-external-locking
  back_log = 50
  max_connections = 100
  max_connect_errors = 10
  table_open_cache = 2048
  max_allowed_packet = 16M
  max_heap_table_size = 64M
  read_buffer_size = 2M
  read_rnd_buffer_size = 16M
  sort_buffer_size = 8M
  join_buffer_size = 16M
  thread_cache_size = 8
  thread_concurrency = 8
  query_cache_size = 128M
  query_cache_limit = 2M
  thread_stack = 240K
  transaction_isolation = REPEATABLE-READ
  tmp_table_size = 64M
  binlog_cache_size = 1M
  log-bin=mysql-bin
  binlog_format=mixed
  expire_logs_days = 2
  
  #*** MyISAM Specific options
  key_buffer_size = 384M
  bulk_insert_buffer_size = 64M
  myisam_sort_buffer_size = 128M
  myisam_max_sort_file_size = 10G
  myisam_repair_threads = 1
  myisam_recover
  
  # *** INNODB Specific options ***
  innodb_additional_mem_pool_size = 16M
  innodb_buffer_pool_size = 10G
  innodb_data_home_dir = /var/lib/mysql
  innodb_write_io_threads = 8
  innodb_read_io_threads = 8
  innodb_thread_concurrency = 16
  innodb_flush_log_at_trx_commit = 1
  innodb_log_buffer_size = 8M
  innodb_max_dirty_pages_pct = 90
  innodb_lock_wait_timeout = 120
  
  [embedded]
  [mysqld-5.5]
  [mariadb]
  [mariadb-5.5]
  </code></pre>