Reliably Scaling Large PHP Web Apps

If you’re working with a high traffic website or looking to be able to scale up your LAMP site for heavy traffic loads, it’s important to plan to scale up your site to handle higher levels of traffic. The first step toward understanding your traffic requirements and needs is through load testing your site against a wide range of configurations and options. By testing your site in advance of deployment you can determine how well Memcache, your hardware configurations and server settings can handle high levels of traffic. You should aim to fully test a site in a production environment to identify where improvement might be needed. While you may not fully know exactly how much traffic your site should be able to handle, preparing to scale and testing the limits of your system can provide valuable insights.

The two core principles for properly scaling a site include caching, distributed databases (by optimizing your mySQL installation with a solution such as InnoDB which allows for improved row retrieval and writing) as well as writing clean, concise code across your properties. You should aim to optimize your hardware to meet your PHP architecture needs which can vary widely depending on the scope and delivery of your application.
At a basic level, starting with a basic Apache LAMP server you can identify areas where you need to improve performance. The most common issues that impact the ability to scale include a lack of sufficient memory to handle database queries or processing power to handle high levels of traffic.

In order to effectively scale a LAMP solution to handle high levels of traffic, it’s important to distribute computing power across many servers with load balancing and mem_cache settings to optimize for high loads. With a distributed database setup you can utilize multiple mySQL servers which handle database SELECTION commands with a common master server that handles insertions and updates to the database. As a result, you can handle common database queries more effectively with cache and load memory, while replicating the command to writing a master database. If you have a large scale site with user inputs, too much traffic can lead to a lag between reading and writing user inputs into the database.

With sites such as photo sharing applications, users may see a lag time between inputs and the resulting outputs. By optimizing your load balancing, you can add more resources (slave servers) as well as identifying opportunities to scale through proactive server monitoring. You can benchmark the capacity of each distributed server to estimate your hardware needs and work with computing partners in order to properly scale your hardware configuration.

There are a variety of potential problems that can arise with a distributed setup including over-use of open ports, which requires a distributed pool of IP as well as additional hardware to scale. You want to constantly check the vitality of each independent server to identify critical problems – working with the right managed hosting provider can provide you with resources to scale based upon need, so you can increase your server footprint in real time.

Related Blog Links

0 responses so far ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment




 

Search Website

 
 
 

Top 10 PHP Hosting Providers

MyHosting - $4.00 USD
InMotion Hosting - $5.95 USD
WebHostingHub - $4.95 USD
JustHost - $3.95 CDN
iPage - $3.50 CDN
HostGator - $4.95 USD
FatCow - $3.67 USD
GreenGeeks - $4.95 USD
BlueHost - $6.95 USD
10  GoDaddy - $4.11 CDN