PHP's include() performance & bottlenecks?
Posted: Wed Oct 01, 2003 5:08 am
Hello all,
I got a bit of a situation with using PHP includes on my site. Let me explain the whole deal in bit more detail.
I'm generating some PHP-pages on the fly from several included files, all of which have PHP code and some MySQL queries in them. This is needed because the content is customized for each user separately according to session variables set on their browsers. I've got the MySQL queries optimized very well, and I'm using indexes if, for example, where-clauses are used. The database connection itself is opened up at the start of the page. All important variables such as user's ID are carried within $_SESSION.
My concern is with PHP's include() and the bottleneck it can create by reading from the drive. What alternatives could you suggest to do deal with this situation? Would it be lighter to store all the template-files in a table, parse the templates, and then echo out the output?
I've also installed PHP-Accelerator today to help with caching the created content, but I'm not sure if that's actually useful in this situation because the content updates continually.
Thanks in advance!
I got a bit of a situation with using PHP includes on my site. Let me explain the whole deal in bit more detail.
I'm generating some PHP-pages on the fly from several included files, all of which have PHP code and some MySQL queries in them. This is needed because the content is customized for each user separately according to session variables set on their browsers. I've got the MySQL queries optimized very well, and I'm using indexes if, for example, where-clauses are used. The database connection itself is opened up at the start of the page. All important variables such as user's ID are carried within $_SESSION.
My concern is with PHP's include() and the bottleneck it can create by reading from the drive. What alternatives could you suggest to do deal with this situation? Would it be lighter to store all the template-files in a table, parse the templates, and then echo out the output?
I've also installed PHP-Accelerator today to help with caching the created content, but I'm not sure if that's actually useful in this situation because the content updates continually.
Thanks in advance!