PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > Running Amazingly Slow Of PHP Queries Against MySQL
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Running Amazingly Slow Of PHP Queries Against MySQL

Réponse
 
LinkBack Outils de la discussion
Vieux 05/11/2007, 03h36   #1
DarkPilgrim@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Running Amazingly Slow Of PHP Queries Against MySQL

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

  Réponse avec citation
Vieux 05/11/2007, 03h41   #2
DarkPilgrim@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Running Amazingly Slow Of PHP Queries Against MySQL

On 11 5 , 11 36 , "DarkPilg...@gmail.com" <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 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

  Réponse avec citation
Vieux 05/11/2007, 04h07   #3
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Running Amazingly Slow Of PHP Queries Against MySQL

DarkPilgrim@gmail.com wrote:
> On 11 5 , 11 36 , "DarkPilg...@gmail.com" <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 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
==================

  Réponse avec citation
Vieux 05/11/2007, 04h17   #4
DarkPilgrim@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Running Amazingly Slow Of PHP Queries Against MySQL

On 11 5 , 12 07 , Jerry Stuckle <jstuck...@attglobal.net> wrote:
> DarkPilg...@gmail.com wrote:
> > On 11 5 , 11 36 , "DarkPilg...@gmail.com" <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 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.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 12h37.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12015 seconds with 12 queries