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 gversion - May 17, 2014

Hi Dave,

Thanks so much for your advice. I am running on a VPS and I have just changed the location of the session path as you instructed.

I can see that the folder is immediately being loaded with session files so that will certainly imply it's my version of cmsBuilder and not someone else's software.

I have attached a JPG so you can see how many are being created.

There is definitely something weird going on. We are not getting anywhere near the sort of traffic that would be creating these user sessions... I wish we were!

Do you think you could take a closer look for me please?

Thanks again,

Greg

Attachments:

cmsSessions.jpg 219K

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