Re: what is better? mysql_connect() or mysql_pconnect()?

From: Date: Tue, 24 Apr 2001 16:52:04 +0000
Subject: Re: what is better? mysql_connect() or mysql_pconnect()?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-50125@lists.php.net to get a copy of this message
If you are using PHP as CGI, pconnect is no different than connect. If you are using PHP as an Apache module, persistant connections can be of some help. But if your own mysql, I don't reccommend you bother with pconnect. MySQL is extremely efficient at creating connections, unlike databases like Oracle and PostgreSQL which have heavier connection processes. If MySQL is on a different server than your webserver is on, then you still may gain some positive result from using persistant connections, but it will be nothing impressive and could cause bad things to happen if Apache and MySQL are set in certain ways and the site get's hammered with requests. Still, with MySQL it's just not much worth using persistant connections, because the effect is just so minor. If you use a slower connecting database or if it's located on another server, then it may be a good idea. In other words persistant connections are not so wonderful that everyone should use them in every instance. You'll have to judge on a case by case basis. -- Plutarck Should be working on something... ...but forgot what it was. ""elias"" <elias_bachaalany@yahoo.com> wrote in message news:9c3fi6$edm$1@toye.p.sourceforge.net... > hello... > just asking...what is better in this case: > i got lots of scripts and almost all of them needs to connect to the DB and > some of thems are accessed lots of times what is better to use in such > cases: > mysql_connect() or mysql_pconnect()... > i mean will speed factor play a role when lots and lots of user tries to > connect to the DB? > > -elias > http://eassoft.cjb.net > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#50125) next »