Hello Sam,

Thursday, March 28, 2002, 10:21:39 AM, you wrote:

SI>  >   The good solution for this would be to put OOPS behind of apache.

SI> What is OOPS ?

The OOPS is squid-like PROXY application which mostly used as WEB
accelerator (server side proxy). The main idea of using it with
PHP/MYSQL is to decrease number of clients apache has (how many do you
have now ?) also this decreases number of needed mysql connections and
so number of MySQL threads.    This happens because OOPS is able to
get result quite fast from the server, buffer it and then slowly push
it to dialup client, while the same apache process is able to process
other request.

SI> Is it like SQL Relay ? Others have said that we should be using a 
SI> connection pooler & that it's a PHP/Apache config problem that we're 
SI> running into. We may also move to BSD from Redhat.

I think you're running into performance problem mostly. At least you
should look at VMSTAT output then this problem occures.

SI>  > P.S Are you using mysql binary or version compiled with patched GLIBC
SI>  > if not the threads limit should be the cause.

SI> We had to use the patched glibc. We have over 1,000 connections 
SI> supported now.

Well. That's what I have afraid of. Unfortunately the Linux has
troubles scheduling large number of threads, that's why trying to keep
the number of threads as small as possible is good. You can look at
the results I've posted to the conference a week or so ago, or do you
own once with fork_XXX.pl scripts coming with mysql distribution.

The solutions for this problem I have so far are:

- Trying to decrease number of running threads using OOPS as I
advised, decreasing timeout, limiting number of mysql_pconnect in PHP
config and so on. Also one of often errors about this is using objects
which connect to MySQL in PHP - remember they would open more
connection to mysql then not passed/returned by reference.
- Try to Speed up threads handling. You may use Ingo's sheduler
available for recent kernels or NGPT thread package. Therefore this
packages are not quite well tested with mysql yet.

SI> - Sam.

SI> On Monday, March 11, 2002, at 06:06 AM, Peter Zaitsev wrote:

>> Hello Michael,
>>
>> Monday, March 11, 2002, 3:38:28 PM, you wrote:
>>
>>
>> I had a close problem once -  then having many active connections (and
>> so threads) mysql speed may degrade a lot because of scheduling and
>> convergency problem. This does not explain the mysql lock itself, but
>> may be the reason (i.e too many threads may make mysql to lock or
>> crush because of GLIBC limits)
>>   The good solution for this would be to put OOPS behind of apache.
>> This gives two positive issues:
>>   - your apache server will have much less children and so will require
>>   much less memory and will basically work faster. In my case the
>>   number of children have dropped from 150 to 16 and required memory
>>   from about 1G to 200M (I'm running very complicated PHP scripts)
>>   - you will need much less number of connections for mysql.  In my
>>   case the number have dropped from about 500 connections from web
>>   server to 50, and load average on mysql server fell from 3.0-4.0 to
>>   0.5-1.0.
>>
>>
>> P.S Are you using mysql binary or version compiled with patched GLIBC
>> if not the threads limit should be the cause.
>>
>>
>> MW> Hi!
>>
>> Sam>> We have a very high volume site (3 million page views a day) 
>> that's run
>> Sam>> on 16 Apache / PHP web servers & 2 MySQL servers. We are using 
>> PHP with
>> Sam>> persistent connections. Each MySQL serves 8 web servers & is 
>> supposed to
>> Sam>> act as a failover machine for the other group of 8 web servers.
>> Sam>>
>> Sam>> The failover won't work now as if one MySQL goes down the cost of 
>> the 8
>> Sam>> web servers switching over is so high the other MySQL locks up.
>> Sam>>
>> Sam>> Each Apache / PHP server takes up hundreds of connections even 
>> when
>> Sam>> they're idle so we ran into the Linux connection limit of 1000 & 
>> had to
>> Sam>> recompile to get past that.
>> Sam>>
>> Sam>> Our actual MySQL CPU useage is low but the goes when with the 
>> connection
>> Sam>> overhead when starting up or failing over a bank of machines.
>> Sam>>
>> Sam>> We get a mysterious MySQL lockup once a week at the same day & 
>> time.
>>
>> MW> Could you please describe the lookup, exactly what happens ?
>>
>> MW> What does 'mysqladmin var ext' show when this happens?
>> MW> What do you have in your log files ?
>>
>> Sam>> Questions :
>> Sam>>
>> Sam>> - Is our configuration of 2 sets of 8 Apache/PHP web servers & 1 
>> MySQL
>> Sam>> servers just not a good idea ?
>>
>> MW> This should not be a problem.
>>
>> Sam>> - Would we better off with FreeBSD ?
>>
>> MW> If you are running a CMP machine, then Linux preforms normally 
>> better
>> MW> than FreeBSD.
>>
>> MW> To be able to give some recommendations we need to know more about
>> MW> this setup.
>>
>> Sam>> - Is there anyone doing any similar setups with lots of web 
>> servers & a
>> Sam>> few MySQLs ?
>>
>> MW> We have several hundred of paying support customers with this setup.
>>
>> Sam>> - Is there any way to get Apache / PHP to use fewer connections ?
>>
>> MW> Stevens Rousseys exellent answer should help you with this
>>
>> Sam>> We pay for MySQL support but haven't had much help from them.
>>
>> MW> I checked our support email archive, but couldn't find anything from
>> MW> you or your company in it.
>>
>> MW> Could you please use our supportwizard interface to make a ticket of
>> MW> this problem so that we can help you with it?
>> MW> If you have already a ticket, please email me the ticket number so
>> MW> that we can check this up.
>>
>> MW> Regards,
>> MW> Monty
>>
>>
>>
>>
>> --
>> Best regards,
>>  Peter                            mailto:[EMAIL PROTECTED]
>>



-- 
Best regards,
 Peter                            mailto:[EMAIL PROTECTED]


---------------------------------------------------------------------
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

Reply via email to