Are /tmp files included in cpanel disk usage calculation?

electric

Well-Known Member
Nov 5, 2001
790
11
318
Hello,

Can someone from cpanel please confirm if this is true?

1. Cpanel quota system includes any files in the system /tmp folder that are owned by the cpanel account user.

2. Cpanel "disk usage viewer" utility does not include accounting of "owned" files in the system /tmp folder.

3. Thus, it is possible for great disparity between reported disk usage in the cpanel, compared to what is shown as "used" by the disk usage viewer.

Is this correct?

The problem is that we often have customer's who are creating large files/folders in the system /tmp folder... and then they get upset when their account says "149999/250000 MB", but the disk usage viewer utility shows only 5gb disk usage.

Sometimes, these customers think cpanel is broken, because they refuse to believe their script has created huge files in the system /tmp folder.

If the above is true, can you please fix the cpanel disk usage viewer so it includes owned files in the system /tmp folder?

Otherwise, there is little point to include this utility, since it is always going to be inaccurate (and misleading), resulting in upset customers.

Thanks.

STEPS TO RECREATE:

1. Login to shell as any user.
2. Change into system /tmp directory.
3. Create a file with large size. Maybe 50gb or so. Whatever.
4. Login to user's cpanel.
5. Total disk usage should be at least 50gb used.
6. Go to "Disk Usage Viewer" utility.
7. Disk breakdown usage displayed under "Disk Usage Summary" does not include the file created in the system /tmp folder. Thus, user has no way to know where the "missing" 50gb is located, and gets upset because they think cpanel is broken and/or you're ripping them off.
 
Last edited:

SB-Nick

Well-Known Member
Aug 26, 2008
175
9
68
cPanel Access Level
Root Administrator
Hello,

Im not a cPanel Official Technician but i will try to give you a hand.

1. True
2. False. It should display the same quota. Did you try to update/fix all quotas for users?

If a user creates a file (Im assuming that the file is created under the same cPanel user name) outside his directory (/tmp for ex) it should count as used space for that user. That's how it should work.

If they are complaining about used space they do not see, a good idea is to create a tmp folder for every specific user inside his home folder. Doings this will make your customers to see where are they using such of space.

If you have any feature request about how cPanel works you could submit it to bugzilla.cpanel.net

Hope i have been of help.
 
Last edited:

electric

Well-Known Member
Nov 5, 2001
790
11
318
Hello,
2. False. It should display the same quota.
It does not. The disk usage viewer shows only the usage from files located inside the user's "/home/username/" folder.

Files from outside his home directory are not included in the disk usage viewer display or calculation.

Did you try to update/fix all quotas for users?
Yes. No change.

If a user creates a file (Im assuming that the file is created under the same cPanel user name) outside his directory (/tmp for ex) it should count as used space for that user. That's how it should work.
That is how it works. That is not the issue. The issue here is that the user has no idea how much disk space is being used up from files located outside their /home/username folder, and the disk usage viewer utility does not show such files.

If they are complaining about used space they do not see, a good idea is to create a tmp folder for every specific user inside his home folder. Doings this will make your customers to see where are they using such of space.
Already done. However, the system /tmp folder is still used by some scripts unless specifically changed. (All new cpanel accounts automatically have a tmp folder created as part of the basic directory structure.)

I have not submitted this as a bug to bugzilla yet, because I would like to hear from anyone else about this. Is this a bug or "by design"?
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
This is the design of the /tmp directory. Files should periodically be removed from the /tmp directory. Some use a cron job that does this. If the user has shell access, he can remove files he owns from /tmp.

Another way to handle this is to put /tmp on a partition that does not have quotas enabled.
 

electric

Well-Known Member
Nov 5, 2001
790
11
318
This is the design of the /tmp directory. Files should periodically be removed from the /tmp directory. Some use a cron job that does this. If the user has shell access, he can remove files he owns from /tmp.

Another way to handle this is to put /tmp on a partition that does not have quotas enabled.
Right... I understand all this, but the fact remains that if the customer has some files in the /tmp folder... they are included in the cpanel disk usage calculation, but NOT in the Disk Usage Viewer.

I think as a "fix" for this problem you might consider adding some text or something on the disk usage viewer that says the summary disk usage information does not include files located outside the user's account root folder.

At least this way, they won't be totally surprised (or upset) when we tell them the reason they're over their disk space limit is because of files in the system /tmp folder...

It's all about making things as "easy to use and understand" as possible.

Thanks.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Right... I understand all this, but the fact remains that if the customer has some files in the /tmp folder... they are included in the cpanel disk usage calculation, but NOT in the Disk Usage Viewer.

I think as a "fix" for this problem you might consider adding some text or something on the disk usage viewer that says the summary disk usage information does not include files located outside the user's account root folder.

At least this way, they won't be totally surprised (or upset) when we tell them the reason they're over their disk space limit is because of files in the system /tmp folder...

It's all about making things as "easy to use and understand" as possible.

Thanks.
I'll pass this along to the design department. We had discussed such a change in the description of the Disk Usage viewer due to other scenarios that cause disparity in space reporting.
 

electric

Well-Known Member
Nov 5, 2001
790
11
318
I'll pass this along to the design department. We had discussed such a change in the description of the Disk Usage viewer due to other scenarios that cause disparity in space reporting.
Sounds good. I do think adding the /tmp folder to the summary view area would be appropriate, since there is a high chance of at least a few files (php sessions, etc) being located in this folder.. and the folder itself is a known location.

(ie: it's not like we don't know the /tmp folder doesn't exist when calculating disk space usage, so why not throw it into the summary display?)

Anyway... anything is better then nothing. :)