How to scale a PHP application (servers, mysql, memcache)

Posted by Stéphane Goetz on Stack Overflow See other posts from Stack Overflow or by Stéphane Goetz
Published on 2010-04-15T17:04:29Z Indexed on 2010/04/15 17:13 UTC
Read the original article Hit count: 269

Filed under:
|
|

Hi,

I'm currently creating a website for a social project in switzerland.

And before there is an overflow of user, I want to prepare the application to scale.

I answered by myself many questions but some are left.

I explain what I want to do.


First

at the beginnning, the Application will have only one server (short time) with DNS, PHP, Mysql, Data, and memcache.


Second

Then I will split them in two

  1. DNS, Mysql, memcache
  2. Data, PHP

Third

Here is the problem, I don't know how to do it exactly here to keep the application running well.

I could do :

  1. Front : Load Balancer, memcache, DNS
  2. Web 1 : PHP, DATA
  3. Web 2 : PHP, DATA
  4. Mysql

This would be the scheme, all PHP sessions are kept in the DB.

BUT, how do I sync the data? do I run a Rsync to keep them up to date. do I put them on a separate disk (network disk) to be sure ? but in this case, how can I do in case of user uploads ?

and if the website gets more success and we have to go on greater structures, would'nt it create some latency on updates ?

or would it be a good thing to go directly to amazon's web services ?

some infos I use codeigniter as Framework. I use linux as webserver (distribution not chosen now, but should be Debian)

Thanks in advance for your answers.

© Stack Overflow or respective owner

Related posts about php

Related posts about codeigniter