Some questions

Discussion in 'General' started by tom123, Feb 18, 2012.

  1. till

    till Super Moderator Staff Member ISPConfig Developer

    About which kind of users are you talking?
     
  2. tom123

    tom123 New Member

    i'm talking about client user.
     
  3. tom123

    tom123 New Member

    Let's assume a multiserver setup, with web,database and mysql services on 3 different servers.

    how do you calculate the users quota? Will you sum web+database+mysql ? On which frequency?

    When overquota, how do you disable writings for that users? On multiservers I think that disk quota doesn't work.
     
  4. tom123

    tom123 New Member

    any help???
     
  5. tom123

    tom123 New Member

    No answers?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The quota in the client settings is the max amount of disk space that can be assigned to all sites of this client. The mysql database server engine has no quota support, so mysql quota is not included.

    mysql is the only supported database, so the above setup would be just web and databse server.

    It makes no difference if this is a single or multiserver setup as quota is always assigned for each website and a website can only be on one server at a time.
     
    Last edited: Mar 15, 2012
  7. tom123

    tom123 New Member

    MySQL can show the data size for each database in a query like this:

    Code:
    SELECT table_schema AS database_name, 
    SUM(data_length + index_length)/1024/1024 AS db_size
    FROM information_schema.TABLES 
    GROUP BY table_schema ; 
    
    so you can sum this size to the quota script, like every other control panel does.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    I'am awaae that mysql can show the database size, nevertheless it has no quota feature which allows to set and enforce limits in mysql. We will implement a workaround for that in ispconfig in future by querying the mysql database manually, but such a quota will be separate from website quota.
     
  9. tom123

    tom123 New Member

    Why separate it?
    It's a simple sum. You should calculate the website quota and then sum the mysql database size to it.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Linux filesystem quota is enforced by a linux kernel module, it is not enforced by ispconfig like traffic quota. ISPConfig just sets the quota values with the linux quota tools for the filesystem. So you would have to extend or write a new linux kernel module when you want that the file system quota takes mysql quota in account when it should block file access when the mysql database exceeds a limit.

    If you would sum it up as you said, you can block access to mysql of yourse when the sum of disk plus mysql quota is exceeded, but the client will be able to create more files on the harddik until the disk quota recahes the overall quota. So the max value in your setup qould be mysql size at the timepoint where the sum of quotas exceeded the overallquota plus the complete sum of the overall quota as disk size. So even if you sum it up, the client can take more space. So its a cleaner approach to have a defined disk limit and a defined mysql limit also disk space is normally "cheaper" then mysql space as you often run mysql servers on ssd's while you use a traditional harddisk for website space and processing of large databases costs a lot more processing power. So mixing a expensive storage space and a cheap storage space in the same limit is not a good choice.
     
  11. tom123

    tom123 New Member

    You can make immuatable (chattr +i) the customer directory, when FS quota plus MySQL db size reach the user's quota.

    Or you can disable FTP account and disable php's writing function (file_put_contents and so on)
     
  12. tom123

    tom123 New Member


    i've configured a multiserver setup by adding

    123.123.123.123 server.hosts.tld server

    (the same taken by hosts file on client) to the server and seems to work properly.

    Is this ok?
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Its ok if it works. In most cases it dont work as mysql fails to authenticate the slaves then.
     
  14. tom123

    tom123 New Member

    Is possibile to know the exact reason? Is the connection type used by ISPConfig that need this entry in hosts file?

    I've never added anything to host files and all of my script works perfectly with remote mysql.
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Mysql does a exact match of the hostname when it verifies a connection, so server1 and server1.example.com are different hostnames for mysql.

    Then you have setup the hostnames of your server correctly in dns which is good, but most poeple dont do that or at least they dont do that before they install the server. If you setup the hotnames in mysql before you install the first server and dont use the hosts file, then its ok.

    Btw, this is not ispconfig specific, its common for all mysql installations and applications that use mysql.
     
  16. tom123

    tom123 New Member

    Using a direct connection to mysql IP should avoid this issue.
    As far as I know, in that case, mysql will use the client ip and not the hostname
     

Share This Page