connection optimization - simple question, I think

I have a single server with multiple websites that each utilize PHP and MySQL on the server. All PHP scripts on all websites are connecting to the same MySQL server (localhost) … just a standard server environment, I assume.

My question is this: On a purely mysql-connection level, does it make any difference how the connections are divided among websites and/or users? If one website gets 100 times more traffic and thus accesses MySQL 100 times more, is it better for this website to connect using its own username and password?

I wouldn’t think it’d make any difference unless MySQL allocates resources on a per-user basis, or per-domain-account basis somehow.

I ask because in order to simplify an application I’m creating that is common to all sites, I’m thinking of having all the individual website php scripts connect to mysql under a single username/pwd (created under my hub website). There would be multiple databases under this account, one for each website.

I hope that’s clear - it’s harder to explain than to answer I hope )

[B]bluem wrote on Mon, 11 June 2007 22:56[/B]
I hope that's clear - it's harder to explain than to answer I hope )
It is, use a single a single username and password.

Nothing is performed on a user level.
What you call user level is just a username/password that lets you in thru the door. The work for this is the same regardless of who you say you are.
It is what happens inside that matters. For example how big amount of data the DB server has to handle, how many queries per second and how complicated the queries are to perform, etc.

When it comes to memory allocation etc, some things are performed on a per connection level and some things on a global level.
And that can be good to know when you read about the server variables that you can set on mysql.

Cool – thanks!!!