Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 432
  • Last Modified:

I'm writing a software load balancer at Amazon EC2 and need to know the fastest possible way to redirect to different servers

n00b alert.

I'm writing a software load balancer at Amazon EC2 and need to know the fastest possible way to redirect to different servers.

I am very new to the AWS environment and am current redirecting using a series of IF / ELSE statements and then doing a 301 redirect inside a PHP file.

I'm sure there is a better way and wanted to ask the EE community the fastest way to redirect to a new server using a LAMP server.

THANKS!
0
Arbuckle2
Asked:
Arbuckle2
2 Solutions
 
ravenplCommented:
For couple of destination servers it would do, for more use map or hashmap for fast destination server search.
I will not help You with the implementation though - i'm c++ programmer.
0
 
shalomcCommented:
unless you write the load balancer for fun, why don't you use haproxy?
or apache with mod_rewrite and mod_proxy?

these are existing, fast, stable and proven solutions for load balancing a LAMP environment.

furthermore, they work on EC2 :)
HAProxy documentation:
http://1wt.eu/articles/2006_lb/

mod_rewrite general LB
http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide_advanced.html#load-balancing

mod_rewrite split traffic according to refering site
http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide_advanced.html#referer-deflector

mod_rewrite split traffic according to browser type
http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide_advanced.html#browser-dependent-content

mod_rewrite split traffic according to browser host domain
http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html#redirecthome

mod_rewrite and GEOIP - load balance according to geolocation
http://www.maxmind.com/app/mod_geoip 
0
 
ahoffmannCommented:
what's wrong with existing apache modules like
  mod_proxy
  mod_proxy_balancer
  mod_athena
  mod_backhand
  mod_balancing

or other tools like
  http://www.caucho.com/resin-3.0/config/balance.xtp
0
 
Arbuckle2Author Commented:
Thanks for the fast response. This was the exact info needed.
0

Featured Post

A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now