Re: Persistent connections or no? Please help, server getting hammer ed.
| From: | Folke Ashberg | Date: | Mon, 27 Nov 2000 19:51:09 +0000 |
| Subject: | Re: Persistent connections or no? Please help, server getting hammer ed. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27438@lists.php.net to get a copy of this message | ||
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
>
>
>