Want more timely Centmin Mod News Updates?
Become a Member

Can i use this path for better performance as tmp ?

Discussion in 'System Administration' started by pamamolf, Apr 1, 2015.

  1. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    6:00 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Hi

    I have a soft Raid 5 with this info:


    Code:
    /dev/md2        289G  162G  113G  59% /
    tmpfs            64G     0   64G   0% /dev/shm
    /dev/md0        488M  144M  320M  31% /boot
    /dev/md1         64G  813M   63G   2% /tmp
    tmpfs            64G  813M   63G   2% /tmp
    Can i change this:
    Code:
    tmpdir=/home/mysqltmp
    to

    Code:
    tmpdir=/dev/shm
    for better temp performance as this is tmpfs ?

    Thanks
     
  2. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,672
    Local Time:
    1:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes better performance as long as you know you will never create tmp files >64GB in size
     
  3. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    6:00 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Yes i know that i will never use 64gb for temp but is this a problem to use it ?

    Any negatives because of the big size?

    This is what i have now:

    Code:
    4.0K  /home/mysqltmp
     
    Last edited: Apr 1, 2015
  4. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    11:00 AM
    Mainline
    10.2
    This is mine:
    Code:
    # df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/vg_draft32-lv_root
                           50G   12G   36G  24% /
    tmpfs                  16G     0   16G   0% /dev/shm
    /dev/sda1             477M  123M  329M  28% /boot
    /dev/mapper/vg_draft32-lv_home
                          265G   31G  222G  12% /home
    tmpfs                  16G   28K   16G   1% /tmp
    
    
    Much better to use /tmp?
    Or there is dis-advantage on using /tmp?
    Thanks Eva :)
     
  5. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    6:00 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Yes i was thinking also to use /tmp but as the /dev/shm is not used at all i was think to use this one but i am not sure if it is better or not....
     
  6. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    11:00 AM
    Mainline
    10.2
    I just applied this on my server :)
    tmpdir=/dev/shm

    Seems to be running fine :whistle:
     
  7. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    6:00 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    It will be great if George comment here about /tmp and /dev/shm and about the big sizes if it is a problem and which one is better to use :)
     
  8. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,672
    Local Time:
    1:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    both the same /tmp and /dev/shm both ramdisks :)
     
  9. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    11:00 AM
    Mainline
    10.2
    Doesn't need something like this?
    chown mysql:mysql /dev/shm

    Using /dev/shm survive on reboots? That mysql will start automatically/normally ?
     
  10. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    6:00 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Also do we need to force using ram by adding this on my.cnf?

    Code:
    tmp_table_size=2K
     
  11. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,672
    Local Time:
    1:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    sorry as both of you have ample ram and /tmp is tmpfs ramdisk you should actually use

    Code:
    tmpdir=/tmp
    and no, nothing in tmpfs ramdisks survives reboots
     
  12. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    11:00 AM
    Mainline
    10.2
    Meaning? Mysql will not start automatically on reboot? or what else do you mean? :D
     
  13. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,672
    Local Time:
    1:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    mysql created temp files if any in /tmp will be removed on reboot

    properly working mysql server shouldn't have lingering temp files anyway so not a problem
     
  14. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    6:00 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Also do we need to force using ram by adding this on my.cnf?

    Code:
    tmp_table_size=2K
     
  15. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    11:00 AM
    Mainline
    10.2
    Ok, then another knowledge for today :D
    Thanks Eva and pamamolf for this thread :)
     
  16. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    6:00 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    I thought that was default for Centminmod and permanent change using fstab.... :( Why not add as default something like this?

    Also i am waiting for the last answer George about forcing it to use tmpfs using:

    Code:
    tmp_table_size=2K
    Thanks !
     
  17. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,672
    Local Time:
    1:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  18. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    6:00 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    No i am not talking about default values for Centminmod to changed....

    I am talking about Centminmod auto create a tmpfs and use this as tmpdir=
     
  19. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,672
    Local Time:
    1:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Centmin Mod .08 beta already does as of this change CentOS 7.x - How to help test .08 CentOS 7 Betas with Github code ? | Page 5 | Centmin Mod Community depending on detected total memory installed. But tmpdir for my.cnf is left to end user to do as there are serious complications if you do not have enough memory to mysql tmpdir usage = corrupted mysql data or inability to repair corrupted database tables
     
  20. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    6:00 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    The db size is 18gb about and the /tmp is 64gb.

    Do you think that is enough and i will not have any problems?

    I mean the /tmp must be related to size of the db?