
|
View Full Version : Plans and MySQL Databases
ThomasB 09-19-2002, 03:28 AM This really puzzles me: How to hosting companies decide how many mySQL database's you get in a plan?
Initialy I assumed the mySQL must be capped somehow. Searching mySQL only revealed that max table sizes is OS dependant and 2 or 4 GB for Linux, depending on kernel.
Is there a resriction on the number of tables in a database somewhere? I haven't found it.
I read somewhere that several databases could be used for different applications. e.g. A forum app might require sole access to a database, not sure why tho - greedy coding.
So is there any real difference between a user with 100MB of data in 1 database, or 20MB data in 5 databases.
Perhaps what I'm missing is that running 5 DBs would have a sever load impact?
Conclusion I'm drawing, is that it's a meaningless marketing gimic. Or a tool to force users to upgrade to more expensive plans. Am I right?
Precise 09-19-2002, 12:32 PM Conclusion I'm drawing, is that it's a meaningless marketing gimic. Or a tool to force users to upgrade to more expensive plans. Am I right?
You make it sound so evil. Lets say that this is the reason, every company does it! Regardless of the industry.
My opinion and the reason I do it is because it is a tool for controlling and managing resources of the server.
net-trend 09-19-2002, 12:59 PM From my point of view, it is a marketing gimmick. There are also other gimmicks such as 5 email addresses and having to pay an additional 1 buck for another one.
This just tends to inflate the plan prices.
Having 5 mysql databases do not use as much resources as a huge single database, unless those 5 databases are accessed together.
And NO, not every company does it. :)
Precise 09-19-2002, 01:25 PM I think that controlling the resources on your server is as important as controlling bandwidth. For instance, you have someone who uses your smallest package. This person can then utilize more resources on your server than the cost can absorb. If this person is a heavy MySQL/script developer, depending on what he/she does this can put an inappropriate strain on the server. This means that he may be using the resources (maybe not bandwidth or space but server load) that 5 accounts or more would use. That is 5 accounts that you cannot put on the server. Whereas, if you control the resources by limiting certain aspects you can maximize the use of your server.
You are right in that someone could utilize one database for all their programs/scripts, however, when I write scripts that utilize MySQL, for development and organizational purposes, I prefer to use separate databases for each script. I would think this would be the case for any serious developer. So, it is not a marketing gimmick, it is a server resource management tool.
I would love to hear opinions from other people. Maybe I am looking at this from the wrong light.
net-trend 09-19-2002, 01:34 PM Honestly, I do not see how offering 1 email address as compared to 100 email addresses having much difference. Firstly, the account owner may only use 5 of the 100.
But let's talk about MySQL. Let me explain again what i said earlier. If the amount of SQL databases are restricted to 1, you mentioned that it will serve as a resource management tool. But what if it was that1 HUGE mysql database that is taking up more server resources than accounts with 5 databases?
Am i making sense? Basically, it all boils down to how the site runs and such. And also, there should always be a clause in the TOS specifying the limits of over-utilization.
And hence, I remain true to what i said about it being a marketing gimmick. :)
But of course, everyone has their own opinions. :)
wlandman 09-19-2002, 01:40 PM As for your e-mail question. If a company has 100 e-mail box's,
that means they can use it for 100 employees which would take
up more resources on the mail server.
Also it would take up room on the filesystem (if the company
uses Maildir format, it can be quite afew directories).
I am also sure the performance of the mail server depends on the number of e-mail boxes it has. I should say mail servers since they recieve and send email.
phpdeveloper 09-20-2002, 02:01 PM I agree that the number of databases is a marketing gimmick and nothing more... server load doesn't depend on how many databases you use for your data and if you place all your 100 Mb of data into 1 db or split it between 5 db's... unless you run multiple mysql servers, but then it's a different thing already...
refcom 09-20-2002, 04:05 PM MySQL has no limits coded into it. Most UNIX software is flexible and does the authors do not spend extra time to code limits into their software like Microsoft. The difference? Microsoft codes limits right into the application because they are a business. MySQL lets the users (web hosts providers in this case) add those limits for business.
I limit the size of each database and I limit the number of tables. Why? Both marketing "gimick" and resource management. It's more of a pricing tool than a gimick - if people want to use more disk space or need more databases, they must be in theory using more resources, thus have to pay more to keep things fair for the other clients.
Of course, 95% of web hosts don't have the experience or knowledge to limit database sizes and max number of tables.
You can usually get away with as many tables as you want and as large of a database as you want, until your host finds out and either warns you if they are a part of the 20% of good hosts or cancels your account and runs off with your money if they are the other 80% of web hosts.
machineman 09-21-2002, 12:25 AM Originally posted by refcom
I limit the size of each database and I limit the number of tables. Why? Both marketing "gimick" and resource management.
You can't limit the size of MySQL databases. If you are using the InnoDB table type, you can pre-set the size, but that's it! You must use your OS's disk quota system to limit your users across the board.
Our plans, if they include, 100MB for example, is for ALL resources... web pages, MySQL, email, etc.
Good luck!
ThomasB 09-21-2002, 05:51 AM That raises an interesting question, how does MySQL cope with quota's being full? I'm assuming your using a method simular to changing the db files owner/group to the user and either linking or placing the db directories in a users home, or quota'ing the db directories.
What happens when mySQL tries to write to a table and it exceeds the users quota? Does it fail, crash, ignore the quota.
The same question I have yet to explore with procmail and using the homedir as default. Does the email get stuck in the mail queue, when the user reaches his quota.
P.S. No offence was meant by the word 'gimic'
cyberlot 09-21-2002, 06:53 AM Mysql blows up if it can't write to disk..
Well not really but it tends to corrupt that DB slightly.. Never seen it be more then a couple repair commands wouldnt fix.
machineman 09-21-2002, 08:33 AM Originally posted by ThomasB
That raises an interesting question, how does MySQL cope with quota's being full? I'm assuming your using a method simular to changing the db files owner/group to the user and either linking or placing the db directories in a users home, or quota'ing the db directories.
What happens when mySQL tries to write to a table and it exceeds the users quota? Does it fail, crash, ignore the quota.
Despite what the user above says, it simply returns a "Disk Full" error, and doesn't corrupt anything. If you dig through the MySQL talk list from about a month ago, I went through this exact thing with them and these responses were official from the MySQL developers.
Good luck!
gnuguy 09-22-2002, 01:13 PM Originally posted by machineman
Despite what the user above says, it simply returns a "Disk Full" error, and doesn't corrupt anything. If you dig through the MySQL talk list from about a month ago, I went through this exact thing with them and these responses were official from the MySQL developers.
Good luck!
Correct, MySQL won't get corrupted, but only return "Disk Full" messages, but you might experience hanging threads until disk space is freed up or you restart MySQL.
To include MySQL databases in the users quota you could do something like this:
cd /path/to/mysql/database (usually /var/lib/mysql)
chgrp usersgrp databasedir
chmod g+s databasedir
To make this work you have to have your users assigned to their own groups, default in Redhat distributions. By doing a chmod g+s, any new table files created will inherit the group ownership.
As usual, test before putting into production. Your mileage may vary.
refcom 09-22-2002, 05:21 PM I realize that many hosts are pretty new to the game and don't really have the system administration experience required to properly run a web hosting server. Not to say that they shouldn't be in the business, this is capitalism where the fittest survive and everyone gets a chance.
Regardless, my point is that you should not use quotas for limiting mysql softly, you can use a hard limit with disk quota, but should really set that hard limit up about 5 megs from where you want the user to be quotad. You never want a Disk Full error coming from MySQL - this means lost data and you don't know how much data was not recorded...
Here's how it should be done for a five meg limit:
1) Hard limit the db with file system quotas to ten megs.
2) Code scripts in a cron job to check the size of all db's, check their size and if they are over-using take appropriate action (email the user, or email the admins so they can email the user...)
Just my words from experience.
|