Running Amazingly Slow Of PHP Queries Against MySQL

Running Amazingly Slow Of PHP Queries Against MySQL

am 05.11.2007 04:36:57 von DarkPilgrim

I'm facing a bizare problem with my LAMP.

For I'm preparing the webserver for one event, I have some simple
tests on the server.
I write a php script in which I run about 3000 queries against mysql
db(loop the same query for 3000 times). The queries are simple, just
select * from some table(this table only has about 100,000 records).
But this script told me it cost about 85 seconds!! I have set Apache,
MySQL and PHP on my own machine where the same script cost less than 1
second.
I can't find any error in php or mysql logs.
Server: Red Hat AS 5, Apache 2.2.3, PHP 5.1.6, MySQL 5.0.22 (these are
buddled with red hat)

Anyone, please help me.

Re: Running Amazingly Slow Of PHP Queries Against MySQL

am 05.11.2007 04:41:07 von DarkPilgrim

On 11 5 , 11 36 , "DarkPilg...@gmail.com"
wrote:
> I'm facing a bizare problem with my LAMP.
>
> For I'm preparing the webserver for one event, I have some simple
> tests on the server.
> I write a php script in which I run about 3000 queries against mysql
> db(loop the same query for 3000 times). The queries are simple, just
> select * from some table(this table only has about 100,000 records).
> But this script told me it cost about 85 seconds!! I have set Apache,
> MySQL and PHP on my own machine where the same script cost less than 1
> second.
> I can't find any error in php or mysql logs.
> Server: Red Hat AS 5, Apache 2.2.3, PHP 5.1.6, MySQL 5.0.22 (these are
> buddled with red hat)
>
> Anyone, please help me.

I do modified my.cnf but I think it should has no affect on this.
I changed back_log from 50 to 100, and max_connections from 100 to
3000m key_buffer_size to 256MB

Re: Running Amazingly Slow Of PHP Queries Against MySQL

am 05.11.2007 05:07:33 von Jerry Stuckle

DarkPilgrim@gmail.com wrote:
> On 11 5 , 11 36 , "DarkPilg...@gmail.com"
> wrote:
>> I'm facing a bizare problem with my LAMP.
>>
>> For I'm preparing the webserver for one event, I have some simple
>> tests on the server.
>> I write a php script in which I run about 3000 queries against mysql
>> db(loop the same query for 3000 times). The queries are simple, just
>> select * from some table(this table only has about 100,000 records).
>> But this script told me it cost about 85 seconds!! I have set Apache,
>> MySQL and PHP on my own machine where the same script cost less than 1
>> second.
>> I can't find any error in php or mysql logs.
>> Server: Red Hat AS 5, Apache 2.2.3, PHP 5.1.6, MySQL 5.0.22 (these are
>> buddled with red hat)
>>
>> Anyone, please help me.
>
> I do modified my.cnf but I think it should has no affect on this.
> I changed back_log from 50 to 100, and max_connections from 100 to
> 3000m key_buffer_size to 256MB
>
>

Try comp.databases.mysql for mysql tuning.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Running Amazingly Slow Of PHP Queries Against MySQL

am 05.11.2007 05:17:08 von DarkPilgrim

On 11 5 , 12 07 , Jerry Stuckle wrote:
> DarkPilg...@gmail.com wrote:
> > On 11 5 , 11 36 , "DarkPilg...@gmail.com"
> > wrote:
> >> I'm facing a bizare problem with my LAMP.
>
> >> For I'm preparing the webserver for one event, I have some simple
> >> tests on the server.
> >> I write a php script in which I run about 3000 queries against mysql
> >> db(loop the same query for 3000 times). The queries are simple, just
> >> select * from some table(this table only has about 100,000 records).
> >> But this script told me it cost about 85 seconds!! I have set Apache,
> >> MySQL and PHP on my own machine where the same script cost less than 1
> >> second.
> >> I can't find any error in php or mysql logs.
> >> Server: Red Hat AS 5, Apache 2.2.3, PHP 5.1.6, MySQL 5.0.22 (these are
> >> buddled with red hat)
>
> >> Anyone, please help me.
>
> > I do modified my.cnf but I think it should has no affect on this.
> > I changed back_log from 50 to 100, and max_connections from 100 to
> > 3000m key_buffer_size to 256MB
>
> Try comp.databases.mysql for mysql tuning.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

I posted there too. Thx for your replay.