<br><br><b><i>Gary Short <gary@garyshort.org></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> -------- Original Message --------<br>> From: Lee Hughes <toxicnaan@yahoo.co.uk><br>> Sent: 11 February 2008 13:28<br>> To: Tayside Linux User Group <dundee@mailman.lug.org.uk><br>> Subject: Re: [dundee] Rails work<br>> <br>> Can't you just load balance with a farm? I've load balanced a few php apps<br>> before, with success? or is there something with rails I'm missing?<br>> does it support database locking for example?<br><br>The trouble with Rails is that it uses the MVC pattern (Model, View Controller) where the interaction between the Model (an object that holds entity information and has business behavour) and the View (the web page in this case) is managed by the Controller.<br><br>So, you may see a URL like http://www.MyDomain.com/customer/12/edit (which means edit
the customer who has id = 12). However, this URL doesn't actually exist and Mod_rewrite is used to route the request to http://www.MyDomain.com/controllers/customer.rb (or similar) passing /customer/12/edit as a parameter so that the code in the controller knows what to do. This is really cool BTW, but makes load balancing a PITA.<br><br>This is not a problem confined to Rails of course, all MVC frameworks (Rails, ASP.Net MVC, CakePHP etc) have this problem to overcome. However, Rails further suffers from Ruby's inherent poor performance aswell. Look out for this being fixed in the short to medium term though, very clever people are working on it right now.<br><br>-- <br>Cheers,<br>Gary<br>http://www.garyshort.org<br><br><br></dundee@mailman.lug.org.uk></toxicnaan@yahoo.co.uk></blockquote>Very Interesting, so, I guess the only open is to balance on source ip address<br>of the client, and direct same request to the same server , not exactly dynamic<br>balancing but it will
work. However, sharing session state was always a<br>big problem, store it in memory (of the web server) and you have a problem<br>distributing that across the cluster, store it in the database and you have<br>the problem of performance , you have to reread you session variables on every<br>page load. . pick yer enemy.<br><br>Keeping clients on the same server seems to do the job, but it's always<br>better if a farm of servers can handle any request, ensuring the least loaded<br>get works to do.<br><br>Does rails have any caching , like mmcache?<br><br>that would certainly speed things up, why recompute a web page, when<br>9 times out of 10, your serving dynamic (which does'nt change that much).<br><br>It's certainly interesting stuff, from now on I'm moving from rails to<br>assembler code. that should improve performance somewhat ;-)<br><br><br><br><br><br><br><br><p> 
<hr size=1> Sent from <a href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=51949/*http://uk.docs.yahoo.com/mail/winter07.html">Yahoo!</a> - a smarter inbox.