From: Michael Widenius Date: April 18 1999 9:12pm Subject: Multiuser/multideamon and CPU/RAM/DISK usage List-Archive: http://lists.mysql.com/mysql/2037 Message-Id: <14106.18401.391586.564083@monty.pp.sci.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit >>>>> "Martin" == Martin Lorensen writes: Martin> Hi! Martin> Background: Martin> ^^^^^^^^^^^ Martin> We are planing to set up a MySQL server on one of our unix-webhosting Martin> servers. The plane is that all users will be offerd to get their own Martin> database for their website using PHP. Martin> Our concern is wheter to have a single MySQL deamon or a MySQL deamon for Martin> each website (running with seperate uid's, log- and database-path etc.). Martin> Safety is somewhat the same - Both setups have problems. Administration is Martin> fare easiest with one deamon - as far as I can see. Martin> Our primar concern is, if we will be able to see what is going on if the Martin> CPU/RAM/DISK load is raising dramaticly or if we see denial-of-service Martin> attacs. Martin> Problem! Martin> ^^^^^^^^ Martin> E.g. two users has active websites which simular queries, but one has set Martin> up a index on the queried key, the other doesn't - Or the databases has Martin> siginificantly diffrent size - Will we then be able to see which of the Martin> users that is causing the problem? Martin> Having only on deamon, that deamon will take up all the CPU-time, require Martin> more RAM, and constantly in an I/O-wait state. Martin> Having multible deamons, the deamon owned by the user causing trouble, Martin> will have abover symptoms, the rest of the deamons runs as normal - It Martin> would be easy to stop/debug the problem. Martin> Question? Martin> ^^^^^^^^^ Martin> Is there anywhere in the log (or some place else) we could find that Martin> information if we are running only one deamon? Is there a "debug" flag or Martin> something that will enable us to do so? Martin> Thanks in advance! Martin> Martin Lorensen Martin> Tele2 A/S Hi! You can with 'mysqladmin processlist' check which users are running what type of queries and how long they have executed. You can't however check how much CPU/RAM a given user has used. It would be trivial to add logging of how long each query took, but RAM usage per query is a much harder and CPU usage is almost impossible. We at TCX only use one MySQL daemon to handle all queries from different customers against their own databases and for us this haven't caused any problems. (We have on the other hand educate our SQL users so they should know what they are doing :) If you have no control over your users, multiple daemons would probably be the easiest choice. The nice part with this is that you can easily restrict the number of simultaneous connection for each database. MySQL should also run relatively well even if you run it with VERY small buffers. Regards, Monty