The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How will tmp act with RAMDISK

Discussion in 'Workarounds and Optimization' started by ilaurens, Jul 15, 2013.

  1. ilaurens

    ilaurens Active Member

    Joined:
    Jul 13, 2013
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hallo,

    I want to change tmp to a ramdisk in order to speed up the loading time, while having minimum effect on the harddisks.

    So, there is two things that is on my mind.

    1. How will tmp act when the disk is full?

    2. How will mysql cache act when the disk is full?

    I know it is possible to seperate but this is more a whatif question. As far I know mysql will turn off the caching, while tmp cannot upload anything nor create any new sessions.


    If you own a CPanel server, I would like to know the tmp and mysql cache directory size. And amount of clients on that server.


    Thank you :)
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,813
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    The /tmp partition should be allotted at least 2G per the advanced partitioning guide at Advanced Options: Pre-Installation. It's not recommended to operate your system with a /tmp partition at 100% disk space usage. There are several potential problems that would arise, including the inability for MySQL to store temporary files or for PHP scripts to utilize new session files.

    Thank you.
     
  3. ilaurens

    ilaurens Active Member

    Joined:
    Jul 13, 2013
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you, the link is pretty useful.

    Sorry about that, I'm not natively English so might have put it wrong in a way. It's not that I want to mount a single harddisk(or with full capacity) to "/tmp", It's just I want to create a ramdisk(harddisk space from memory) and mount it as "/tmp", since temp does not contain any important data and just caching it does not matter that it'll loses all data inside the folder after power outage or reset.

    The recommended space for tmp is 2 GB, but is there any recommendation for 1gb for 100 clients or something like that? Because more client = more usage = bigger temp I can assume.


    The server will have enough memory, it will have at least 100 GB.

    Edit: Woops, you gave already the awnser for tmp space. Sorry about that. Edited that part
     
    #3 ilaurens, Jul 15, 2013
    Last edited: Jul 15, 2013
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,813
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    2G is standard, but there is no recommended size based on the number of accounts. It's difficult to predict exactly how much space will be required because each account or database may require a different amount of temporary space.

    Thank you.
     
  5. ilaurens

    ilaurens Active Member

    Joined:
    Jul 13, 2013
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I see thank you, I will give it a size I can spare ~ 10 GB after that I can always upgrade/downgrade it. Will also be using "tmpwatch" to clean it.
     
  6. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    we use 4GB as our standard tmp partition size
    the highest usage is 4%

    just fyi we have used ram disk for tmp the performance gain is negligible
     
  7. ilaurens

    ilaurens Active Member

    Joined:
    Jul 13, 2013
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you for the response,

    I think it might be and it might not be, truth told I did not put this to practice yet but I'm sure it depends on users. Mysql is cached which has a big gain in the long run, session files has a lot of i/o which might also be important.

    This will be important when receiving high traffic count, this will be a big help. As far I know the file management system has caching build in, so that will probably take care of the smaller PHP files. <-- Only when having enough memory.

    Though, Like you said this might be negligible, but it depends on Circumstances, amount of RAM to spare, amount of users, etc etc

    Sorry, wrote this one fast, I do not have much time.

    also this might be interesting for some(''dynamic allocation <3'): TipsAndTricks/TmpOnTmpfs - CentOS Wiki
     
    #7 ilaurens, Jul 20, 2013
    Last edited: Jul 20, 2013
Loading...

Share This Page