Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 695791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:59:45+00:00 2026-05-14T02:59:45+00:00

I have a PHP program that has been written keeping in mind a single

  • 0

I have a PHP program that has been written keeping in mind a single server, so there are inherent limitation to how much it can handle. For example, the developer says that his current webhosting service provides him with “50 MySQL connections” which he interprets as that only 50 people can be simultaneously logged onto it.

What do we need to do if we want to scale it up so it can handle a load of 500 or more? How can we adapt this program to a “load balancer” with minimal changes?

The application is writen in PHP and uses MySQL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:59:45+00:00Added an answer on May 14, 2026 at 2:59 am

    Regardless of any restrictions set up by a host, you should sensibly limit your queries whenever possible. This goes if you are on shared hosting, or own 10 racks full of servers that are entirely at your disposal.

    The fewer queries needed to render a page:

    • The faster database connections are closed, allowing the RDBMS to release memory
    • The faster connection resources are closed, allowing your application to release memory
    • The faster HTTP server processes exit, allowing them to release memory
    • The faster the user gets the information they were looking for

    A typical shared web host will (as you note) have a single server mentality. Running a RDBMS on the same computer as a web server is almost never a good idea if you want to scale. Why? Both have to allocate way more memory than they actually need or use in order to be able to deal with requests and return the data that is asked for. This is especially true for any RDBMS that supports type affinity.

    Also, take a look at how long the queries that you actually need are taking to return. The faster they finish, the faster resources are released (and pretty much everything else in the list above).

    This means, the less time your app spends connected to the database, the less likely you will be to hit a connection limit. 50 can serve 500, or more users. Be that limiting queries, optimizing them or both.

    Take a good look at your app. Where can you implement caching for information that is not likely to change on every page load? How can you make better use of sessions? Is that groovy ajax interface making a query for EVERY event?

    Most people already ensure this is not the case, so questions like this would fall into the micro optimization category. Its really a fundamental design concept.

    Design it to scale and work around such constraints, and you can usually avoid the constraints until time and money permits addressing them.

    Also, a side note, a VPS where you control everything is almost as cheap as a typical re-seller hosting account. Why not build your own sandbox and play by your own rules?

    As for load balancing, first decide on a replication scheme. You then decide on how best to distribute the work. In some instances, you can read from one slave and write to another, in other cases you need to employ some kind of reverse proxy, be it hardware or software. Your question is a little too generic to offer a more comprehensive answer in that regard.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an INI file that has been created by an AutoHotKey program written
I have a PHP program that has the user copying a URI into a
I have a PHP script that runs as a CGI program and the HTTP
We have PHP 5.2.6 deployed to c:\php and in that folder there is the
I have a program I wrote that when it has an error, it saves
I have a simple PHP program that list some topics. for example I have
I have a remote php program that generates 2 random numbers, I call to
I've a project that has a program written in C++ (that always has to
I have a SQL update statement I am running from inside a PHP program.
I'm writing server-side programs in PHP for an iPhone app. And I have no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.