You are here: Re: Database server auto-close « PHP Programming Language « IT news, forums, messages
Re: Database server auto-close

Posted by Chung Leong on 04/30/07 22:58

On Apr 30, 8:08 pm, Sanders Kaufman <b...@kaufman.net> wrote:
> Chung Leong wrote:
> > As a side note: Don't wait till the end of the page before you close
> > the database connection. That's a recipe for "Too many connections"
> > errors. Read the necessary data from the database then close the
> > connection before you output to the client.
>
> Could you expand on that?
> I can't think of a way that closing at the end would do that.

Well, it's not that hard to understand. It takes time for the page to
get sent to the client. Generally it's a lot longer than the time it
takes to retrieve data from the database. A query might take 100
millisec. Transferring a HTML page could conceivably take over 10
seconds. Holding onto the connection til the end of the page means
more concurrent connection there needs to be.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация