Home » Performance » MySQL » connection optimization - simple question, I think
connection optimization - simple question, I think [message #1401] Mon, 11 June 2007 16:56 Go to next message
bluem  is currently offline bluem
Messages: 15
Registered: November 2006
Junior Member
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 Smile

Re: connection optimization - simple question, I think [message #1404 is a reply to message #1401 ] Mon, 11 June 2007 20:03 Go to previous messageGo to next message
sterin  is currently offline sterin
Messages: 324
Registered: March 2007
Location: Sweden
Senior Member
bluem wrote on Mon, 11 June 2007 22:56

I hope that's clear - it's harder to explain than to answer I hope Smile


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.

Re: connection optimization - simple question, I think [message #1405 is a reply to message #1404 ] Tue, 12 June 2007 03:10 Go to previous message
bluem  is currently offline bluem
Messages: 15
Registered: November 2006
Junior Member
Cool -- thanks!!!
Previous Topic:mysql restart problems....please help!!!
Next Topic:PERL MY SQL SCRIPT
Goto Forum:
  


Current Time: Thu Jul 9 21:10:47 EDT 2009

Total time taken to generate the page: 0.00642 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.