I\'ve been arguing with some friends on the university, and we can\'t get to a point to which is the framework with more scalability for web applications (and still very fast).<
A compiled language will generally run faster than an interpreted language so I think Ruby and PHP start behind the eight ball but It really comes down to how you use the language and how you structure the code.
All languages will have their own best practices and patterns to build scalable applications and often there will be compromises depending on the functionality of the proposed application.
Algorithms will count more for scalability than the language used.
That said, there will be differences in execution speed between the languages. I believe that Java (Servlets and JSPs compile to servlets, i.e., native code) will be faster than Ruby and PHP by some amount). There are also a tonne of web frameworks for Java that will encourage you to do things the best way for scalability.
Also design your app so that it can run happily behind a load balancer, and scalability becomes a lot easier :) This isn't my field of expertise however.
Web framework scalability is a bit of an over thought question (some would say p155ing contest). Unless you are getting mega bucks (good luck with that these days) and can ensure millions of visitors per day all those frameworks can handle it well (as can ASP.NET).
Personally I would always choose ASP.NET. It is as scalable as anything and has the best developer tools. Only downside is hosting and operating system costs.
A: C ISAPI dll (or custom apache module) :)
Even then the overhead of the web server, parsing the http requests and serving the html pages makes the execution time of your apps almost irrelevant. If you run your app as a CGI app, then expect even less performance.
For scalability in the web, you're really talking about adding more servers and load balancing, taking load off the server by putting the database (if heavily used) on a separate server.
The raw performance of those languages are almost nothing to worry over. Use the one you want to use, that you will be most productive with. Worry over the other issues you'll run into - network io, security, correctness.
I'm not sure any of those frameworks you mention will seriously hinder scalability.
It all depends on the implementation.
I would concentrate getting your web app to work well first, and then worry about scalability when it becomes an issue. In other words "let's cross that bridge when we come to it".
If you want to know how the major sites use LAMP to achieve scalability, you should take a look at database sharding.