Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

Load Balancing MySQL with extra VPSes to improve Magento Speed
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK

I’m looking to bring my 6 osCommerce shops under one Magento umbrella installation. I’m a bit wary about Magento speed. The shops won’t have tons of traffic, I expect no more than 50 simultaneous shoppers but I’m not sure our dedicated server will be of high enough spec to serve pages in the 2-3 seconds I’ve come to expect.

From reading the various speed concern threads here it seems that the ‘issue’ is that Magento requires a lot of database reads so you need fast disks for excellent I/O throughput. SCSI clusters aren’t cheap so I’m loath to enter an expensive dedicated hosting contract to find out it’s overkill.

So my thinking is as follows.

I’ll upgrade my dedicated server to fast EIDE disks in Raid. Nothing amazing, certainly affordable. Will enable all caching trickery etc. possible.

Now if things start to slow down as traffic grows, I can quickly get a bunch of VPS boxes purely for taking over some SQL queries.

Does Magento have any built-in load balancing features, such as entering multiple database connections?

I’m thinking of sending the read queries (browsing) to the fast disk dedicated server and the write queries (cart and admin stuff) to the VPS for example. Or simply alternate database connections per visitor. Whatever the MySQL load balancing strategy, does Magento allow for this out of the box? Or do I have to set this up in MySQL.

Any feedback on this idea would be very welcome. I need to decide on a server and start migrating!

Magento Community Magento Community
Magento Community
Magento Community
Sr. Member
Total Posts:  89
Joined:  2008-07-31

Magento does seem to have support for sessions in the database, although the default is to store sessions in the file system. If you were to enable sessions in the database and point two load-balanced application servers at the shared database, I’d imagine you’d have a cluster.

Of course, I haven’t tried this, but that’s how it’s done and knowing that Magento supports sessions in the DB leads me to believe that it supports it out of the box, so to speak.

Magento Community Magento Community
Magento Community
Magento Community
Total Posts:  481
Joined:  2008-07-11
New Haven, CT

All those VPSs might be connected to one mysql database [or fewer than you think] (esp if you are making multiple accounts under one “server” that you are paying for) better talk to your hosting about this idea before you ask Magento - they will know more about it specific to your hosting.

Magento Community Magento Community
Magento Community
Magento Community
Jr. Member
Total Posts:  9
Joined:  2009-02-19


I am looking for load-balancing functionality. Just there is an ambigous point for me about session variable which should be set in Apache. Anyone has done it before?

We are going to have two servers, session is storing in database at the moment.


Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top