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.
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.
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.
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.
Why separate it? It's a simple sum. You should calculate the website quota and then sum the mysql database size to it.
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.
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)
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?
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.
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.
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