agrafuese Posted July 22, 2008 Share Posted July 22, 2008 Hi there, I am currently working with a client with a high traffic website. i was concerned about the number of simultaneous mysql connections her host allowed, so i spoke to them, and they said that we could handle a max of 50 simultaneous connections at any one time, per mysql user, with a total max of 1500 simultaneous connections on the server (using multiple mysql users). my question is: how would i go about using multiple mysql users so that we could take advantage of the 1500 connection limit instead of just 50? is it like an overflow system, where i can use a series of if/then statements to check for a mysql overflow and then switch over to the next available user? or am i supposed to be assigning different user accounts for different tasks (i.e. one for log ins, one for item look ups, etc...)? i have only ever used one mysql user in all my years of php/mysql programming, so this is all very new to me. if none of this is possible and i have the wrong idea, is the real solution then to go with a dedicated server or VPN instead? any help is much appreciated. thank you. Quote Link to comment Share on other sites More sharing options...
fenway Posted July 23, 2008 Share Posted July 23, 2008 The # of different user names isn't really going to make much of a difference... Quote Link to comment Share on other sites More sharing options...
agrafuese Posted July 24, 2008 Author Share Posted July 24, 2008 ah ok, so would you say that if i'm maxing connections, there's little i can do as a programmer to work around the 50 simultaneous connection limit imposed by my host? does "mysql_free_result" or "mysql_close" help at all in cases like this? i know mysql_free_result is used more for memory issues, and i make sure to use mysql_close at the end of all my scripts as a fail-safe, but i've also read that it's basically unnecessary because connections close at script's end anyway. also, keep in mind, im not using persistent connections. i've been consistently told that persistent connections are bad in cases where one needs to mind connection limits. so is my only answer to just get a better hosting solution where more than 50 simultaneous connections are possible? Quote Link to comment Share on other sites More sharing options...
fenway Posted July 26, 2008 Share Posted July 26, 2008 Well, the question is really if your server can handle more than 50 at a time nayway. Quote Link to comment Share on other sites More sharing options...
agrafuese Posted July 27, 2008 Author Share Posted July 27, 2008 Well, to be honest, the reason I ask is because I'm working for a client with a high demand website. I contacted her host to make sure that their MySQL database could handle burst traffic (she just has a basic shared hosting plan), and this is what they said: Regarding MySQL, we allow max 50 simultaneous connections per mysql user on server and 1500 per server. I understood the "50 simultaneous connections" part, but I didn't know what they meant by "1500 per server". That's why I ask if there's anything else I can personally do, or is that "1500 per server" part just host gibberish to keep us as customers? I suspect that this particular host is the kind that inflates numbers just to sound impressive, but when it comes down to it, those numbers are actually just the total numbers for ALL accounts on one particular shared server, and not necessarily available to us. Quote Link to comment Share on other sites More sharing options...
fenway Posted July 28, 2008 Share Posted July 28, 2008 I'm sure you *could* figure out a way to "assign" a round-robin list of mysql users.. but again, if your server can't handle the load, it won't help matters much. Quote Link to comment Share on other sites More sharing options...
agrafuese Posted July 29, 2008 Author Share Posted July 29, 2008 good to know, and thanks for all your help. we're actually moving to a dedicated server this week, so hopefully that will provide some kind of solution. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.