[Lazarus] fpWeb - Apache Modules

Michael Van Canneyt michael at freepascal.org
Fri Jan 23 11:36:56 CET 2009



On Fri, 23 Jan 2009, Graeme Geldenhuys wrote:

> On Fri, Jan 23, 2009 at 11:43 AM, Henry Vermaak <henry.vermaak at gmail.com> wrote:
> >
> > just for interest sake, have you measured how long it takes to set up
> > the connection relative to how long the network transfer takes?  it'll
> > obviously be dependant on the connection speed, but i get the feeling
> > that it's minimal.
> 
> Yes I have, and so did other users of tiOPF.  The Connect/Disconnect
> part of a database takes considerably longer than retrieving a subset
> of data. And with the way CGI applications work, they
> connect/disconnect very often (each screen refresh).

All depends on how your CGI application works.
For any reasonably user-friendly application screen buildup usually 
requires so many queries that the startup time is dwarfed.

Take the mantis bugtracker: it runs more than 40 queries to show certain
pages ('My view' page takes 45) , and needs sometimes up to 100 Mb (!!) 
to display a single page. I had to increase the allowed memory per page
in php.ini to be able to run Mantis.

In such cases, reverting to CGI will IMHO result in a speed gain. 
PHP has become so bloated that it slows with every release.

For simple CGI's a lot can be improved by caching some things in the
session data, which you of course should not store in the database.
If you need to run a query on the database to display the user name
in the top-right corner of your web-page, your design is basically 
flawed.

Not to mention that CGI (or apache modules) are less prone to attacks
than the ubiquitous interpreted PHP...

Michael.



More information about the Lazarus mailing list