RE: [PHP] Persistent connections or no? Please help, server gett ing hammer ed.
| From: | Chad Day | Date: | Mon, 27 Nov 2000 20:05:04 +0000 |
| Subject: | RE: [PHP] Persistent connections or no? Please help, server gett ing hammer ed. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-27444@lists.php.net to get a copy of this message | ||
Isn't wait_timeout the number of seconds the server will go without traffic
before shutting down?
from mysql homepage:
20.4.1 MySQL server has gone away error
This section also covers the related Lost connection to server during query
error.
The most common reason for the MySQL server has gone away error is that the
server timed out and closed the connection. By default, the server closes
the connection after 8 hours if nothing has happened. You can change the
time limit with by setting the wait_timeout variable when you start mysqld.
I don't want to set that low in case traffic gets light during the night and
mysql shuts down entirely, or am I reading that wrong? Is it the number of
seconds before the server closes, or the number of seconds before a
connection closes?
BTW in Apache I have maxchilds set to 0, and my load right now on the server
is hovering around 2.5, with mysql eating up most of the memory.
Any help is appreciated as the site is still being hammered and will
continue to get worse throughout the day. :(
Chad
-----Original Message-----
From: Folke Ashberg [mailto:folke@fanstage.de]
Sent: Monday, November 27, 2000 2:51 PM
To: Chad Day
Cc: 'php-general@lists.php.net'
Subject: Re: [PHP] Persistent connections or no? Please help, server
getting hammer ed.
Hi!
First of all:
Not persistant connections persisting during the whole request, that
means php connects only one time per page call and that request serves all
your 100 sql-queries.
Persistant-connections will not be closed after the script aborts!
I made the experience not to use persistent SQL-connections.
I'm using an extra Server for mySQL wich has 384MB RAM but despite i had
so much opened mysqld's that the system have had to swap!
Btw.: It was an forum with about 20 connections/second ! The forum has
more than 100.000 postings!
So disable mysql_pconnect and one more tip for mySQLd:
set-variable = wait_timeout=120
especially when using pconnect!
because connections have a timeout of several hours as default!
And that connections are "eating" your ram.
regards
Folke
--
Folke Ashberg
Stage Internet Services GmbH
Technical Development
folke@fanstage.de
folke@fanstage.de | Tel: +49 89 454591-77 | Fax: +49 89 454591-71
Kreillerstr. 21 | 81673 Munich | Germany | www.fanstage.de
On Mon, 27 Nov 2000, Chad Day wrote:
> I got linked by a popular site today and am getting positively hammered by
> connections.
>
> I was using persistent connections, as it's a fairly simple database that
is
> going to get a lot of traffic.. each user views a page with a database
> connection required on it about 100 times per user session, so I thought
> persistent would be the way to go to cut down on the overhead.. problem is
I
> got a lot of lingering connections around.. not sure if I should lower
> mysql's wait timeout, or if I should be using regular connects and closes
> constantly.
>
> Chad Day
> Beach Associates
>
> When I speak german... I think german in my head... but like...Do skript
> kiddies see a w40l3 8uncha 1's and 0's and 3's and 4's and 7's in
their
> h34d'5 w43n t43y R +a1k1n6 ? -- SirStanley
>
>
>
--
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