1

I have just entered into the world of e-commerce, and I am trying to get my Magento website up and running.

I am using AWS cloud for hosting my website. I am trying to use an architecture, where I can run multiple servers connected to a single DB server. Specifically, I want to use an AWS Auto scaling group along with ELB to start multiple EC2 instances, during high load. There is only one Mutli AZ RDS Database instance.

As initial trials, I tried creating 2 ec2 instances, and installed magento on both of them. I have used same RDS DB for both of them. But as is turns out, magento stores the base url of webserver in the database itself. Which means, I can only store one base url of magento website running one particular server.

To be precise magento stores base url in table core_config_data in column 'path' where row values ares "web/unsecure/base_url" and "web/secure/base_url", and the column 'value' for corresponding row specifies the url address of magento installed web server. My question is how can I use multiple server using EC2 auto scaling, if magento permits only one server address in the base url.

Here's a partial view of the table with 2 rows -

config_id   scope     scope_id    path                      value   
5           default   0           web/unsecure/base_url     http://server1.com/magento/
6           default   0           web/secure/base_url       http://server1.com/magento/

Are there any other known methods to somehow use horizontal scaling during heavy load conditions in Magento.

1 Answer 1

3

You're almost there. You need to set up an Elastic Load Balancer (ELB) which balances the load to the two (or more) web servers.

Once you have done that, just point the domain at the load balancer rather than one of the web servers and your load will scale to as many web servers as you want to throw behind the ELB (until the database becomes the bottleneck).

The base URL stored in Magento will not affect this. There will only be one base URL and that will point to the ELB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.