Control client's mysql quota?

chunpal

Member
Dec 13, 2002
23
0
151
Hello..

Is there any way to set up the mysql quota for each client?

If I give to them 100mb for HD space, it means they can use for mysql up to 100mb?

In the WHM, there is only setup the how many DB, not space for that DB.

I have one 60gb hard drive with RH7.3.

Any comment will be happy~~

Thanks..

Justin
 

chunpal

Member
Dec 13, 2002
23
0
151
Thanks for the reply...

In the Cpanel....

It shows like a below..

Total space : 100MB
Disk Space Available : 500MB =& 50MB (my fault)
Disk usage : 50MB
SQL disk usage : 10MB

Like a above...10MB for SQl space...

Is this kind of Cpanel display bug? ^^;;;

or can I just ignore that display?

Thanks
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
That should be accurate.

Total space : 100MB & ---Total space on the server with files owned by this user
Disk Space Available : 500MB &-- Total space alloted to them
Disk usage : 50MB &-- Total space in their /home directory being used
SQL disk usage : 10MB &-- Total space being used by mysql for this user.
 

Juanra

Well-Known Member
Sep 22, 2001
777
0
316
Spain
[quote:ebb1aa56e4][i:ebb1aa56e4]Originally posted by dgbaker[/i:ebb1aa56e4]
The mysql space used is part of their total alotment of space.
So if you give a user 100mb disk space that includes space for mysql.
[/quote:ebb1aa56e4]

When did this change? In my servers all databases are still owned by &mysql&.
 

chunpal

Member
Dec 13, 2002
23
0
151
I'm sorry...

Total space : 100MB
Disk Space Available : 50MB
Disk usage : 50MB
SQL disk usage : 10MB

wasn't 500MB =& 50MB

I gave to client 100MB account space..

According to above...
They use 10MB extra for mysql.

That's why I want to give them exact space for mysql..
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
[quote:f4012a5081][i:f4012a5081]Originally posted by Juanra[/i:f4012a5081]

[quote:f4012a5081][i:f4012a5081]Originally posted by dgbaker[/i:f4012a5081]
The mysql space used is part of their total alotment of space.
So if you give a user 100mb disk space that includes space for mysql.
[/quote:f4012a5081]

When did this change? In my servers all databases are still owned by &mysql&.[/quote:f4012a5081]

Your are right juarna, they are owned by mysql, but as far as I know when doing the space it does a & foreach $dir (@USERS)& that's one of the reasons that the db directories are username_

That way it can do - for each directory named username_* do check.

I thought this was the way it was done. But if I am wrong hey, free databases for everyone!
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
I found the answer I think. According to this thread http://forums.cpanel.net/read.php?TID=4243 sql is NOT in the total quota.

So I was wrong, my bad...

Doing some math of my own, it does not include anything from the user outside of there /home/user area.

So in theory you could give some a 10mb space and they could use 100mb of sql.
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
& Doing some math of my own, it does not include anything from the user outside of there /home/user area.

It actually calculates disk usage on the ~username basis. So if you've got files in another directory under the same username, it will pick up those too. ;)

MySQL files are not owned by the user, as a result those are out of cpanel's disk usage stats.

In theory at least a user can have just 10 MB of disk space and yet use 300 MB of DB space !
 

Website Rob

Well-Known Member
Mar 23, 2002
1,501
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
I would have to disagree with any statements saying mySQL space usage is include in total Web space usage. Version 5 of Cpanel did come out with &showing& disk space usage for mySQL, but it is not yet included within calculations for &total& used.

If you look within any Cpanel, you will notice that Disk Usage + Disk Space Available, will equal total alloted Web space. In order for mySQL disk usage to be included, the account owner would have to &own& their mySQL files/dir and they do not.

[/var/lib/mysql]# ls -lh
and you will see that &mysql& does in fact, own all the mySQL files for each account.

[/var/lib/mysql]# du -h --max-depth=1
and you will see how much space is actually used -- individual accounts and Server total
 

taivu

Well-Known Member
Nov 22, 2001
65
0
306
[quote:ae0f489e30][i:ae0f489e30]Originally posted by moronhead[/i:ae0f489e30]
It actually calculates disk usage on the ~username basis. So if you've got files in another directory under the same username, it will pick up those too. ;)[/quote:ae0f489e30]

Also if you have files in YOUR directory, but owned by someone else, they won't show up in CPanel's disk usage.

Example: du -hs in user's home directory shows 57 MB, &disk usage& in CPanel shows just 2 MB. Explanation? 55 MB of image files uploaded using a PHP script, thus owned by &nobody&.
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
& Example: du -hs in user's home directory shows 57 MB, &disk usage& in CPanel shows just 2 MB. Explanation? 55 MB of image files uploaded using a PHP script, thus owned by &nobody&.

YES! You could have people upload an unlimited amount of files to your web space as the webserver user &nobody& and create DBs at the same time worth 500 MB using a PHP script - even if you've allocated 100 MB to that same account ! Cpanel will currently see neither of those.

Here's what should probably happen...

* Add up ALL the files in the user's home directory

* MINUS Any files in the user's directory owned by &root&

* PLUS Calculate DB space in /var/lib/mysql under $user_

Admins should also be allowed to allocate a quota for MySQL per user when creating an account.
 

fengzhu

Registered
Dec 10, 2002
1
0
151
What a trick!

I am disappointed with Cpanel at the following points:

1. Cannot calculate Bandwidth correctly
2. Disk Space calculation is not that accurate
3. Always got quota problem
4. DB space is unlimited for everybody

When can it be fixed?
 
Last edited: