Empty /tmp folder?

6 posts by 2 authors in: Forums > CMS Builder
Last Post: May 19, 2014   (RSS)

By gversion - April 3, 2014

Hello,

I have received an automated alert from cPanel stating that my /tmp folder is reaching max capacity (approx. 500MB).

I realise this isn't very large but I would like to stop these automated alerts being sent to me and resolve the problem to ensure cPanel does not disable my website.

I can see the /tmp folder is full of session files (e.g. sess_ab8b4d361cd6793c02bee270aee49f89), which I think have been created by cmsBuilder.

Is it safe to delete all the contents of my /tmp folder?

Thank you,

Greg

By Dave - April 7, 2014

Hi Greg, 

The /tmp folder should be managed automatically by the operating system.  You might want to ask your host about it.  It shouldn't be reaching max capacity.

Those session files are just regular PHP session files.  So you can delete them, worst thing it will do is just erase someone's session (which would be like if they cleared their cookies or didn't come back to the site for a long time).  PHP or the OS should usually automatically clean up old session files.

You could also try just rebooting your server as their might be some automatic cleanup processes that run on shutdown/startup, but if that doesn't work check with your host to be sure.  

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

By gversion - May 11, 2014

Hi Dave,

Unfortunately this issue with the session files is still on-going. As a short term fix I have scheduled "tmpwatch", (which is a CentOS file usually scheduled to run via cron daily) to run in /etc/cron.hourly and this seems to be deleting them fast enough. However,  I am having thousands of session files created ranging from 19 bytes to 460kb! I therefore don't think this is the same issue as the 0 byte sessions I have read in the forums are created due to PHP's file system and my host assures me it is not an issue with the server, apparently it is something in the software.

I am just wondering if you have any ideas as to how I can resolve this. My site keeps going down as the /tmp folder is filling up so fast and the server runs out of disk space.

Thanks again for the continued support.

Regards,

Greg

By Dave - May 13, 2014

Hi Greg, 

> I am having thousands of session files created ranging from 19 bytes to 460kb!

This could be related to other websites hosted on your server (they will all use the same /tmp folder) or other php scripts you have on your website.

Can you try create a new folder for CMSB session files above your htdocs?  Or just give it a random name like /www/yoursite.com/htdocs/cmsSession_dj938923dh83/  

Then set that path under: Admin > General > session.save_path

That will cause CMSB and any pages that load the viewers to put their session files there and clean up old session files randomly once every 100 page views.

Let me know if that works for you and if you still see the big session files in that folder as well.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

By Dave - May 19, 2014

Hi Greg, 

Yea, sure thing, can you email me CMS & FTP details to dave@interactivetools.com (don't post login details to the forum).  I can take a look at those files and see if I can figure out what is going on.  It definitely does look like something weird, might be malware or something like that, but I'll take a look and let you know.

PS: Also please include a link to this forum thread in your email for easy reference.  

Thanks,
Dave

Dave Edis - Senior Developer
interactivetools.com