Jump to content

Load Balance without persistent web server connection


KT Walrus

Recommended Posts

I'm thinking of adding load balancing using haproxy and multiple web servers. Normally, you would set this up such that subsequent connections by the same user are balanced to the same web server (using cookie or source ip). I'd like to not worry about this and just run haproxy in round robin load balancing mode.

I'm currently researching what parts of IPB would break in this scenario. I found that IPB does use 1 session variable:

$_SESSION['ips_InlineMessage'] = $text;



which I think I can easily fix by storing the message in memcache. I also noticed that the facebook interface uses SESSION data (maybe unused, I just searched for $_SESSION), but I don't use this feature (and will probably never use this feature). I also don't use any extra apps, hooks, or other code that I didn't write and didn't come with IPB.

Any other gotchas I should investigate? I assume it will be very hard to detect when the code is not working right since PHP page loads are going to be randomly distributed among the web servers invisibly to the user (making it harder to recreate a problem).

Link to comment
Share on other sites

We load balance across multiple servers in a very similar way to your proposal and have had no major issues, although you will need a process to ensure things like the cache, public and hooks folders are common on all boxes.

Link to comment
Share on other sites


Can I ask you why you feel the need the load balance/use multiple servers?



Right now, I'm just interested in High Availability and the ability to locate the servers in multiple datacenters (west coast and east coast). If I can load balance, I can solve these two requirements. Also, I want the load balanced solution to help provide a great backup solution so the system can survive any datacenter catastrophe (including the datacenter being shut down and my servers being held hostage). This is just a long term goal and I'm just investigating smaller steps towards this goal.
Link to comment
Share on other sites

I think that may be older code. We avoid PHP sessions in the core release (although Gallery and Nexus make use of PHP sessions).

Note that you can set PHP sessions to be stored in shared memory or even memcache, so that might be something for you to look into if you are concerned about them.

Link to comment
Share on other sites


I think that may be older code. We avoid PHP sessions in the core release (although Gallery and Nexus make use of PHP sessions).



Yes, you are correct. BTW, the file acp/setup/sources/classes/output/output.php still sets the $_SESSION variable, but no code uses it anymore.


Note that you can set PHP sessions to be stored in shared memory or even memcache, so that might be something for you to look into if you are concerned about them.



Thanks. This is good to know. Does IPB offer a setting to store IPB sessions in shared memory or even memcache (as a cache for the DB table values)? I'd like to not replicate the sessions table. I can do this myself, but I want to minimize my changes to IPB.
Link to comment
Share on other sites


Thanks. This is good to know. Does IPB offer a setting to store IPB sessions in shared memory or even memcache (as a cache for the DB table values)? I'd like to not replicate the sessions table. I can do this myself, but I want to minimize my changes to IPB.




Not at this time.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...