Connecting Tech Pros Worldwide Forums | Help | Site Map

How to improve scalability of PHP mySQL system?

hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,609
#1: Mar 25 '08
I have a PHP, mySQL site. It works good when number of users is less than 50. To the 51th user, the mySQL server doesn't give connection. Apparently, the hosting company provides only 50 concurrent connections.

How can I improve the scalability of the site so that more then 50 users can use it even if allowable number of connections is limited to 50?

I know it could be done by making some intermediate agents. Any suggestions or documentation on that?

Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,949
#2: Mar 25 '08

re: How to improve scalability of PHP mySQL system?


Interesting...

Unfortunately, i have no idea how to counter this, hopefully someone else will because it might come in handy in the future.

Regards, and good luck.
hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,609
#3: Mar 25 '08

re: How to improve scalability of PHP mySQL system?


Do some research dude!!
I didn't expect this answer from you, you are a PHP expert!

(don't mind, j/k)

Regards,
Harpreet

PS: You site is down?
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,949
#4: Mar 25 '08

re: How to improve scalability of PHP mySQL system?


Unforunately, it is.
Just as i was finishing up some major remodeling, the site goes down.
What's more annoying is, i have no way of fixing the problem; i just have to wait for my friend (who is hosting it for me) to fix it.

I'm going to get hosting a site on dreamhost, some time soon.

Lol, it was a windfall on my part - my website.
I was talking to this lad on msn, who lives in Aus, and he mentions he has a website, so i say "i have a domain but no hosting" n then he randomly offers to host my site for me. It's great cos it's free, but rubbish because i have limits - there are no bandwidth limits, but i can't make subdomains, or emails, etc. And neither can i fix problems such as the "site temporarily down" one i'm experiencing now!

Pah!

Oh, did you find a solution to your problem?
hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,609
#5: Mar 25 '08

re: How to improve scalability of PHP mySQL system?


Ok, but you should have found some better host.

I couldn't find the solution. I have an idea though.
Its like, you don't connect directly to the mySQl server, you just include a PHP file, which acts as an intermediate agent to handle the queries. When we run an SQL query, it doesn't go straight to the mySQL server, but instead, it goes to that PHP file. That PHP file than runs the query and gives the response back to the requesting script. And you can have multiple intermediate agents (files). This improves scalability to 10 times.

But its quite a tough job to implement it.

I have an online test-center, on which students take there school tests. At times, there can be 500 students, or even more than that (population of India is 100 Crore). So its a problem for me.

Or I should go for a dedicated server. Which costs me 40,000 rupees per month (approx 600 GBP), which is difficult for me.

So do some research. I'm also doing the same.

Regards,
Harpreet
Reply