I'd like to have your opinion about writing web apps in PHP vs. a long-running process using tools such as Django or Turbogears for Python.
As far as I know:
- In PHP, pages are fetched from the hard-disk every time (although I assume the OS keeps files in RAM for a while after they've been accessed)
- Pages are recompiled into opcode every time (although tools from eg. Zend can keep a compiled version in RAM)
- Fetching pages every time means reading global and session data every time, and re-opening connections to the DB
So, I guess PHP makes sense on a shared server (multiple sites sharing the same host) to run apps with moderate use, while a long-running process offers higher performance with apps that run on a dedicated server and are under heavy use?
Thanks for any feedback.
As many others have noted, PHP nor Django are going to be your bottlenecks.  Hitting the hard disk for the bytecode on PHP is irrelevant for a heavily trafficked site because caching will take over at that point.  The same is true for Django.
Model/View and user experience design will have order of magnitude benefits to performance over the language itself.
PHP vs. long-running process (Python, Java, etc.)?