The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Control client's mysql quota?

Discussion in 'General Discussion' started by chunpal, Jan 29, 2003.

  1. chunpal

    chunpal Member

    Joined:
    Dec 13, 2002
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  2. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    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.
     
  3. chunpal

    chunpal Member

    Joined:
    Dec 13, 2002
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  4. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    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.
     
  5. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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&.
     
  6. chunpal

    chunpal Member

    Joined:
    Dec 13, 2002
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    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..
     
  7. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    [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!
     
  8. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    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.
     
  9. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    & 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 !
     
  10. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    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
     
  11. taivu

    taivu Well-Known Member

    Joined:
    Nov 22, 2001
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    [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&.
     
  12. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    & 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.
     
  13. fengzhu

    fengzhu Registered

    Joined:
    Dec 10, 2002
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
    #13 fengzhu, Mar 9, 2003
    Last edited: Mar 9, 2003
  14. goodmove

    goodmove Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    Moronhead's predictions are particularly frightening. :confused:

    Any thoughts?
     
Loading...

Share This Page