Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Error with nginx cache: no space left on /tmp

Discussion in 'General Discussion' started by clopezi, Mar 26, 2013.

  1. clopezi

    clopezi Member

    Joined:
    Mar 17, 2013
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    Today our server did something strange, but i solved. I make the post for one question and maybe will be helpfull to other user.

    Suddenly, the server make a error 500, after that, i restart all services but varnish cache don't restart. When i go to check the varnish configuration, the script says: no space left in /tmp/

    I check with df -h and /tmp have around 2GB free (32% of space).

    I remove all session* in /tmp and all in /tmp/nginx_client and now all works perfectly, with a 90% empty in /tmp

    So i have two questions:

    1) Why no space empty if df -h says yes?

    2) Who can i make a cronjob to empty nginx dir and after that restart nginx service every night? The following command in crontab is correct?

    Thank you!
     
    #1 clopezi, Mar 26, 2013
    Last edited: Mar 26, 2013
  2. Jeff Shotnik

    Jeff Shotnik Well-Known Member

    Joined:
    Oct 10, 2012
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Denver, Colorado, United States
    cPanel Access Level:
    DataCenter Provider
    Nginx has a cache manager process that watches the nginx cache and removes inactive files after a certain period or when the cache limit has been reached. In order to keep /tmp from becoming full you'll need to adjust your 'proxy_cache_path' directive to use a smaller cache size. If /tmp is too small for the cache size you need, move nginx cache to /home, or a larger partition.

    Here's a link on how to use proxy_cache_path - HttpProxyModule

    "Why no space empty if df -h says yes?"
    >> You may need to run `sync` to get the correct value to show - changes aren't committed until buffers are flushed.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice