Welcome to Centmin Mod Community
Register Now

Can i use this path for better performance as tmp ?

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

  1. pamamolf

    pamamolf Well-Known Member

    2,819
    251
    83
    May 31, 2014
    Ratings:
    +445
    Local Time:
    4:47 PM
    Nginx-1.13.x
    MariaDB 10.1.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

    30,926
    6,911
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,407
    Local Time:
    12:47 AM
    Nginx 1.13.x
    MariaDB 5.5
    yes better performance as long as you know you will never create tmp files >64GB in size
     
  3. pamamolf

    pamamolf Well-Known Member

    2,819
    251
    83
    May 31, 2014
    Ratings:
    +445
    Local Time:
    4:47 PM
    Nginx-1.13.x
    MariaDB 10.1.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. RoldanLT

    RoldanLT Well-Known Member

    3,975
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    10:47 PM
    1.11
    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 Well-Known Member

    2,819
    251
    83
    May 31, 2014
    Ratings:
    +445
    Local Time:
    4:47 PM
    Nginx-1.13.x
    MariaDB 10.1.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. RoldanLT

    RoldanLT Well-Known Member

    3,975
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    10:47 PM
    1.11
    10.2
    I just applied this on my server :)
    tmpdir=/dev/shm

    Seems to be running fine :whistle:
     
  7. pamamolf

    pamamolf Well-Known Member

    2,819
    251
    83
    May 31, 2014
    Ratings:
    +445
    Local Time:
    4:47 PM
    Nginx-1.13.x
    MariaDB 10.1.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

    30,926
    6,911
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,407
    Local Time:
    12:47 AM
    Nginx 1.13.x
    MariaDB 5.5
    both the same /tmp and /dev/shm both ramdisks :)
     
    • Like Like x 1
  9. RoldanLT

    RoldanLT Well-Known Member

    3,975
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    10:47 PM
    1.11
    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 Well-Known Member

    2,819
    251
    83
    May 31, 2014
    Ratings:
    +445
    Local Time:
    4:47 PM
    Nginx-1.13.x
    MariaDB 10.1.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

    30,926
    6,911
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,407
    Local Time:
    12:47 AM
    Nginx 1.13.x
    MariaDB 5.5
    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. RoldanLT

    RoldanLT Well-Known Member

    3,975
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    10:47 PM
    1.11
    10.2
    Meaning? Mysql will not start automatically on reboot? or what else do you mean? :D
     
  13. eva2000

    eva2000 Administrator Staff Member

    30,926
    6,911
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,407
    Local Time:
    12:47 AM
    Nginx 1.13.x
    MariaDB 5.5
    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 Well-Known Member

    2,819
    251
    83
    May 31, 2014
    Ratings:
    +445
    Local Time:
    4:47 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Also do we need to force using ram by adding this on my.cnf?

    Code:
    tmp_table_size=2K
     
  15. RoldanLT

    RoldanLT Well-Known Member

    3,975
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    10:47 PM
    1.11
    10.2
    Ok, then another knowledge for today :D
    Thanks Eva and pamamolf for this thread :)
     
  16. pamamolf

    pamamolf Well-Known Member

    2,819
    251
    83
    May 31, 2014
    Ratings:
    +445
    Local Time:
    4:47 PM
    Nginx-1.13.x
    MariaDB 10.1.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

    30,926
    6,911
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,407
    Local Time:
    12:47 AM
    Nginx 1.13.x
    MariaDB 5.5
  18. pamamolf

    pamamolf Well-Known Member

    2,819
    251
    83
    May 31, 2014
    Ratings:
    +445
    Local Time:
    4:47 PM
    Nginx-1.13.x
    MariaDB 10.1.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

    30,926
    6,911
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,407
    Local Time:
    12:47 AM
    Nginx 1.13.x
    MariaDB 5.5
    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 Well-Known Member

    2,819
    251
    83
    May 31, 2014
    Ratings:
    +445
    Local Time:
    4:47 PM
    Nginx-1.13.x
    MariaDB 10.1.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?