[fpc-pascal] CGI (with Free Pascal) vs PHP
Michael Van Canneyt
michael.vancanneyt at wisa.be
Tue Mar 6 14:39:28 CET 2007
On Tue, 6 Mar 2007, Daniël Mantione wrote:
> Op Tue, 6 Mar 2007, schreef Jonas Maebe:
> > On 6 mrt 2007, at 13:16, Michael Van Canneyt wrote:
> > > > PHP does not in any way burden a modern web server, at least when
> > > > used
> > > > as an apache module. My test server at work has 128MB of RAM and only
> > > > occasionally does it slow down noticably, typically when MySQL is
> > > > working on a particularly ugly join. In my experience, the speed of
> > > > well written PHP is indistinguishable from the speed of the same
> > > > static HTML, as long as you leave out any database interaction (and
> > > > Pascal of course would have database interaction as well).
> > >
> > > Well. Since we switched to Mantis (PHP based, Apache module) for the
> > > bug-tracker, we have nothing but problems with the webserver.
> > Well, he explicitly mentioned the problem that Mantis has: we use it in
> > combination with MySQL (I don't even know if it supports another database),
> > and Mantis does a lot of joins (don't know if they are ugly though).
> That is not the real problem with Mantis. Mantis views a database record
> as an object with methods and fields. If you modify a field the record is
> retrieved from the database and stored again.
> So, during a page request hundreds of queries can get executed, instead of
> requesting all data for the page at once, Mantis uses one query per
This is not the only problem. To be able to do multiple MySQL queries at
once (the MySQL C client does not allow this), PHP must retrieve the whole
record set at once, and keep it in memory, thus wasting a lot of memory.
That has nothing to do with Mantis, but is a design problem of MySQL - and
thus PHP. But unfortunately, MySQL is used most for PHP web apps, it gets
shipped as the default.
More information about the fpc-pascal