Multiple application instances with Codeigniter

How can I create a Codeigniter application that resides on multiple servers and has a hook that sends users to different instances based on load balance?

+3
source share
3 answers

I would not use PHP for this. Routing users between servers is work for Apache.

Take a look at this http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html

Your domain acts as a proxy for your many web servers. Apache balances requests for each server.

I have never used it, but I think it works.

+1
source

CI-hook per-say, ngnix apahce2 / . , , Memcached ( ), , , CDN /js.

0

System , , app1, app2... then on index.php. , , :

$cpu > 80 || $memory > 900  $ application = "app2";

, 1024 RAM. , vars () .

apache http://www.ctrip.ufl.edu/apache2-cluster-in-debian-lenny-howto

0

Source: https://habr.com/ru/post/1769635/


All Articles