Re: Many processes in SHOW PROCESSLIST;

2002-03-05 Thread BD

At 10:24 PM 3/4/2002 , you wrote:
On Mon, Mar 04, 2002 at 01:47:42PM -0600, BD wrote:
 
  Jeremy,
 
   PMFJI, but has anyone done any testing to see if persistent
  connections with MySQL and PHP is actually faster in practice?

What's PMFJU?

Pardon me for jumping in


Without testing, I suspect that it is faster but that the gains are
very small.  If this was Oracle, it'd be a whole different story.  The
connection overhead in MySQL is minimal.

Has anyone created a table showing the connection times of the various 
databases? Like MySQL, PostgreSQL, Oracle, Interbase etc.? Then you could 
say Oracle was 4xMySQL, or 3xInterbase etc.. I think it would give 
developers a better understanding whether they need persistent connections 
or not. At least it would show them the overhead involved in connecting to 
a database.

Brent

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Many processes in SHOW PROCESSLIST;

2002-03-05 Thread Steven Roussey

   PMFJI, but has anyone done any testing to see if persistent
  connections with MySQL and PHP is actually faster in practice?

 Without testing, I suspect that it is faster but that the gains are
 very small.  If this was Oracle, it'd be a whole different story.  The
 connection overhead in MySQL is minimal.

With MySQL's thread_cache, the connection overhead is even lower. 

PHP's persistent connections can be good or bad. If you have a small
site, low traffic, etc., it will help. If you have lots of traffic, then
it can make more problems than it solves.

PHP's implementation of persistent connections is flawed. A connection
is persistent per process, not per server. Depending on you Apache
variables, this can cause MySQL to have a _lot_ of useless threads
running. And they take up memory. And that can slow things down and push
MySQL to crash (setting a limit on MySQL connections solves this crash
problem).

Maybe with a new MySQL module for PHP in the works, this will get fixed.
It needs to use shared memory so multiple apache processes can use the
same connection pool.

Sincerely,
Steven Roussey
http://Network54.com/?pp=e 

sql,query



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Many processes in SHOW PROCESSLIST;

2002-03-04 Thread Takacs Istvan

Hi,

We use mysql 1.23.47 as a database for our
PHP based accounting system.
We use mysql_pconnect() to get a
connection to the DB.
This morning we couldn't log in because
mysql sent back a 'too many open connection!'
(or someting like that) error message.
If I use the command SHOW PROCESSLIST
than I can see many 'Sleep' processes.
If I try to kill some processes by KILL processnumber
than newer processes appear in the list.

Is there any way to kill all of the hanging processes?
And why are so many processes if we use mysql_pconnect()
which uses the same connection what the PHP
user opened before?

Thanks in advance!

Regards;

Istvan

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Many processes in SHOW PROCESSLIST;

2002-03-04 Thread Jeremy Zawodny

On Mon, Mar 04, 2002 at 11:19:54AM +0100, Takacs Istvan wrote:
 Hi,
 
 We use mysql 1.23.47 as a database for our PHP based accounting
 system.  We use mysql_pconnect() to get a connection to the DB.
 This morning we couldn't log in because mysql sent back a 'too many
 open connection!'  (or someting like that) error message.  If I use
 the command SHOW PROCESSLIST than I can see many 'Sleep' processes.
 If I try to kill some processes by KILL processnumber than newer
 processes appear in the list.

Sounds like you need to decrease the amount of time that idle
connections stay around in the server before they are disconnected.

 Is there any way to kill all of the hanging processes?

Best not to get them in the first place!

 And why are so many processes if we use mysql_pconnect() which uses
 the same connection what the PHP user opened before?

mysql_pconnect() tells PHP *not* to close the connection when a page
completes.  That means there will be more open connections to the
database server.  If you have a sufficient number of Apache (or
whatever) children, you can easily over-run MySQL.

Jeremy
-- 
Jeremy D. Zawodny, [EMAIL PROTECTED]
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936

MySQL 3.23.47-max: up 25 days, processed 840,969,833 queries (386/sec. avg)

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Many processes in SHOW PROCESSLIST;

2002-03-04 Thread BD

At 01:13 PM 3/4/2002 , you wrote:
On Mon, Mar 04, 2002 at 11:19:54AM +0100, Takacs Istvan wrote:
  Hi,
 
  We use mysql 1.23.47 as a database for our PHP based accounting
  system.  We use mysql_pconnect() to get a connection to the DB.
  This morning we couldn't log in because mysql sent back a 'too many
  open connection!'  (or someting like that) error message.  If I use
  the command SHOW PROCESSLIST than I can see many 'Sleep' processes.
  If I try to kill some processes by KILL processnumber than newer
  processes appear in the list.

Sounds like you need to decrease the amount of time that idle
connections stay around in the server before they are disconnected.

  Is there any way to kill all of the hanging processes?

Best not to get them in the first place!

  And why are so many processes if we use mysql_pconnect() which uses
  the same connection what the PHP user opened before?

mysql_pconnect() tells PHP *not* to close the connection when a page
completes.  That means there will be more open connections to the
database server.  If you have a sufficient number of Apache (or
whatever) children, you can easily over-run MySQL.

Jeremy

Jeremy,
 PMFJI, but has anyone done any testing to see if persistent 
connections with MySQL and PHP is actually faster in practice?

Brent

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Many processes in SHOW PROCESSLIST;

2002-03-04 Thread Jeremy Zawodny

On Mon, Mar 04, 2002 at 01:47:42PM -0600, BD wrote:
 
 Jeremy,

  PMFJI, but has anyone done any testing to see if persistent
 connections with MySQL and PHP is actually faster in practice?

What's PMFJU?

Without testing, I suspect that it is faster but that the gains are
very small.  If this was Oracle, it'd be a whole different story.  The
connection overhead in MySQL is minimal.

Jeremy
-- 
Jeremy D. Zawodny, [EMAIL PROTECTED]
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936

MySQL 3.23.47-max: up 25 days, processed 859,947,219 queries (388/sec. avg)

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php