I appreciate there are perhaps better ways of making a PHP application scale than the above, however I'm wondering more on principle. From what I've heard, Python is faster than PHP and I'm trying to decide which language to learn next, as a PHP developer.
4 Answers
Python's a very good language to learn for a number of reasons, including its clear syntax, its excellent standard library, its multi-paradigm support, and the helpful community that surrounds it.
However, scalability has more to do with your system's overall architecture than with the programming language you choose. Often, the database is the main bottleneck, and the performance of the programming language that's talking to the database will not have much impact on overall site performance.
Comments
I don't think rewriting in Python will help you that much, it is very hard to say anyway without knowing your exact scalability problem. When it comes to real scaling issues, every problem is unique and there is no one true solution.
That being said, Python is an interesting language, and if you've time on your hands and want to learn something, it sounds like a good idea to look at it closely. I would also look at JavaScript more closely though, be it using NodeJS (which is also pretty damn fast for some things) or just in a browser, it's a language that is not going away anytime soon. If you're a web developer, you can't know enough JS imo.