 | |  | | | General Discussion General use discussion forum for PhotoPost products. |
September 25th, 2009, 12:58 PM
|
#1 (permalink)
| | Ultimate Member
Join Date: Jun 2007 Location: Texas
Posts: 1,362
| Randomize Database User Connections
Until I get a dedicated server, I am only allowed 50 MySQL connections - per database users.
I can get around that, as suggested my my hosting support, to add more database users, and randomly connect to the DB with those different users.
Would anyone know how to randomize the connection process, for more users?
|
| |
September 25th, 2009, 08:28 PM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,725
|
That would definately take a good deal of rewriting of the entire $link section here. As to what would need to be changed I have never personally looked at it. Code: Content visible to verified customers only.
|
| |
September 26th, 2009, 01:27 AM
|
#3 (permalink)
| | Ultimate Member
Join Date: Jun 2007 Location: Texas
Posts: 1,362
|
Not for VB - just basic PP Pro
|
| |
September 26th, 2009, 07:38 AM
|
#4 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,725
|
Right I am merely stating anything you do or code up would probally be centered around there as thats where we define the $link and $db_link lines.
|
| |
September 27th, 2009, 01:12 AM
|
#5 (permalink)
| | Ultimate Member
Join Date: Jun 2007 Location: Texas
Posts: 1,362
| Quote:
Originally Posted by Chuck S Right I am merely stating anything you do or code up would probally be centered around there as thats where we define the $link and $db_link lines. | I basically need something like this:
$mysql_user1="vande11_user1";
$mysql_user2="vande11_user2";
$mysql_user3="vande11_user3;
$random_user = $mysql_user1, $mysql_user1, $mysql_user1
$mysql_user= $random_user
I am guessing this should work for each login.. as it will randomly select a differnet users based on the $random_user
|
| |
September 27th, 2009, 01:26 AM
|
#6 (permalink)
| | Ultimate Member
Join Date: Jun 2007 Location: Texas
Posts: 1,362
|
I this should work..
$the_dbarray = array( "user1", "user2", "user3", "user3" ); //<--Note the extra "item3"
shuffle($the_dbarray);
$mysql_user = $the_dbarray
This should select 1 of the users# for a database connection, then pass the results to $mysql_user. Testing it, it is working. I would figure if there was an error, I would not be able to login ;-)
If only now I can base the random of Max_Sql connections, then it would work perfect.. for shared hosting, at this point in time.
|
| |
September 27th, 2009, 07:32 AM
|
#7 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,725
|
yeah thats probally a very basic way to do it for your situation if your mysql password is the same for all users sure.
|
| |
September 27th, 2009, 09:57 AM
|
#8 (permalink)
| | Ultimate Member
Join Date: Jun 2007 Location: Texas
Posts: 1,362
| Quote:
Originally Posted by Chuck S yeah thats probally a very basic way to do it for your situation if your mysql password is the same for all users sure. | True.
It would be nice the make it more of an
if .. else kinda thing, where it checks connections maxed out or not. I will keep looking for code snippets that will help me until such time as I move to a dedicated server. thanks..
|
| |
September 27th, 2009, 01:34 PM
|
#9 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,725
|
yeah well if your host limits mysql connections to 50 per user sounds to me like you need a better host as thats even way more restrictive than powweb which I think is like 50000.
|
| |
September 27th, 2009, 06:21 PM
|
#10 (permalink)
| | Ultimate Member
Join Date: Jun 2007 Location: Texas
Posts: 1,362
|
You are right. I am on shared housting though - for now..
Bluehost has some good options, so I am in touch with them.. Powweb I haven't checked out yet - but will look into it.
|
| |
September 27th, 2009, 06:28 PM
|
#11 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,725
|
No you dont want powweb.
Check out my host westhost.com
|
| |
September 27th, 2009, 06:41 PM
|
#12 (permalink)
| | Ultimate Member
Join Date: Jun 2007 Location: Texas
Posts: 1,362
|
What's wrong with PowWeb?
Unlimited Space/ Unlimited data
|
| |
September 27th, 2009, 06:47 PM
|
#13 (permalink)
| | Ultimate Member
Join Date: Jun 2007 Location: Texas
Posts: 1,362
|
well, Bluehost is out - 60 only and only shared hosting.
|
| |
September 27th, 2009, 06:50 PM
|
#14 (permalink)
| | Ultimate Member
Join Date: Jun 2007 Location: Texas
Posts: 1,362
|
well, the randomizing of users for the DB seemed to solve my problem 4 now...
|
| |
September 27th, 2009, 07:20 PM
|
#15 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,725
|
Thats a good thing.
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Rate This Thread | Linear Mode | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -5. The time now is 10:05 AM. | |