Re: database connections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, July 24, 2006 10:46 am, Ryan A wrote:
> This is not really a problem, more like a slightly OT
> question.
>
> Recently I have been testing some "CMS/carts/BB
> boards" and other related software, sometimes at the
> end of the page the software outputs the time it took
> to generate the page and the number of database calls.
>
> I have seen some scripts give the number of database
> calls in the hundreds (from 100 - 400) just to
> generate one single damn page.
> Isnt that just too much?
>
> Or am I blowing smoke and MySql can handle that
> without a sweat on a shared hosting environment? (with
> say....100 page requests per minute?)

You'd have to time the DB call on your own system to get truly
meaningful data.

The function call to a database on localhost to send a simple query
and get back a tiny result set is very very very cheap, usually.

A big-long-ass complex query is "expensive" but only in the SQL side,
not in PHP side.

A large result set is killer for both SQL and PHP, and the pipe in
between.

It's possible that 100 small queries are faster then a big query, in
some cases, but generally not, for the same given result set.

It's also possible that the database API has some kind of caching
system, so that the "hundreds" of calls are not actually hitting the
DB, but are getting counted anyway.

You're on your own to find out what the metrics actually mean. :-)

I'd pay more attention to actual user-percieved performance than just
the number of DB calls.

Something that does one super-fast DB call in a splintered second and
then outputs HTML that takes the browser 30 seconds to render is a lot
worse than something that does 100 not-so-fast DB calls but generates
quickly-rendered HTML.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux