Not the answer you need?
Register and ask your own question!

vm.swappiness = 0 vm.dirty_ratio = 2 is this still a good idea to run on 5.6 and 5.7?

MR.YMR.Y ContributorCurrent User Role Beginner
We setup our old DB host with Centos 5 and MySQL 5.5 with this two OS parameters entered

1.We will be editing /etc/sysctl.conf and adding the following lines
vm.swappiness = 0
vm.dirty_ratio = 2

Should I leave them as default on my new Centos 7 installation ?
Does anyone have any insight ?

~]# cat /proc/sys/vm/swappiness
~]# cat /proc/sys/vm/dirty_ratio


  • PeterPeter Percona CEO Percona Moderator Role
    Hi Mr.Y

    What Storage engine(s) are you running and with what options ? I see you have been asking questions about TokuDB so I wonder.

    When it comes to Innodb with O_DIRECT we often want low dirty_ratio as storage engine itself will be doing buffer management and as some 80%+ of memory is going to be used by buffer pool we want to scale down those numbers to reflect that as dirty_ratio=20 will allow everything which is not allocated as buffer pool to be dirty

    You may do well to run your own benchmark though as we find best practices can be often very situation dependent.
  • MR.YMR.Y Contributor Current User Role Beginner
    I am running innodb as default storage engine and TokuDB for the 4 largest tables in the DB
    and we set vm.swappiness = 0 and vm.dirty_ratio = 2 when we installed mysql 5.5 with tokudb plugin

    That was 2 years ago and I am now in the process to upgrade mysql and Tokudb
    and not sure if I should kept it or now
    Mysql 5.5 was running on Centos 5
    New MySQL will be running on Cenots 7
    - and a lot has changed on the OS level as well in Mysql since Centos 5 and Mysql 5.5

    When I have install Mysql on the new Centos 7 box sucessfully using our own backup data file I will do some testing
    But this will be with new Hardware, new Centos 7, new Mysql version, More Memory, FusioIO etc
    so I guess I have to run a test run with default values 60/20
    and then shutdown and change the swappiness/dirty_ratio to 0/2 as we now run it with

    As long this will not cause any corruption of the data it sound like it's performance related tuning ....
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.