RE: [PHP] Persistent connections or no? Please help, server gett ing hammer ed.

From: Date: Mon, 27 Nov 2000 20:46:38 +0000
Subject: RE: [PHP] Persistent connections or no? Please help, server gett ing hammer ed.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27455@lists.php.net to get a copy of this message
Hello! No, it's the time mysqld closes a single connection! Test it with mysqld --set-variable wait_timeout=10 & wait 10 secs and you'll see that mysqld isn't shutting down. The most importest thing for a webserver is that the server never had to use its swap! (put in more RAM) You'll make the mashine faster in setting MaxClients to a number the server can handle. i think you mean with maxchilds MaxClients (isn't it)?, because i never heard maxchilds for apache. This year i was one week in the same situation and i've increased the performance in decreasing MaxClients to a suitable value!! Also take a look on your apache-scoreboard: ExtendedStatus on <Location /server-status> SetHandler server-status Order allow,deny Allow from all AuthType Basic AuthUserFile /xxxxxxxx AuthName "Webserver Statistics" require valid-user # or validate your IP and forgot AuthType Basic </Location> what do you see? Full of K? -> decrease MaxKeepAliveRequests and KeepAliveTimeout. iprefer KeepAlive Off, because IE makes KeepAlive errors! ->the whole scoreboard (255) is full with RWK ->decrease MaxClients, about 180 with 384MB-RAM is good Also try to set "RLimitCPU 15 20" if you have hosted sites using endless-looping perls (or something else)(we as game-fansite-hoster have a lot,grrr) also check this out: http://arctic.org/~dean/apache/perf.html hope you can master your terrible situation 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: > 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 > > >

« previous php.general (#27455) next »