cosmin
06-21-2002, 08:02 AM
Hello!
I have a client who have some php scripts. But, he tell the time between php and mysql is too long, between 2.5 sec and 78!!!! On a local computer the time is ... 0.3 sec
How can I verify the speed and how can I modify the speed?
Thank you very much!
flitcher
06-21-2002, 10:27 AM
I'm not a PHP/MySQL expert but what I can tell you is it really depends on what his search string is and how he searches for it in the table. And to increase speed you can try allocating more memory to MySQL, sorry but I dont remember what file you do it in.
CagedTornado
06-21-2002, 11:22 AM
This is kind of confusing...
1.) What (specifically) is executing when it's taking a long time? (Select, insert, update, etc)
2.) Is there a discrepancy between the number of rows on your test database (locally) and the number of rows in the database that is causing problems?
3.) Have you done a ps -ef --sort %cpu to see what is taking the most CPU time on the slow box?
4.) What does 'uptime' say that the CPU stats are on the slow box?
5.) If it's a select that is slow, have you tried putting an index on the columns used in the where clause (or on foreign keys)?
Dan
magnafix
06-21-2002, 12:36 PM
Time the page generation:
http://www.php.net/manual/en/function.microtime.php
mwatkins
06-21-2002, 12:42 PM
In addition to the above, is the user selecting from the same quantity of data on his local test machine? If he has a development envioronment with only a few records locally, but man tens of thousands of records on the host machine, it could mean:
- a completely unfair comparison.
- that lack of indexes on columns being queried do not show up as issues on the dev environment but do in production simply because there is more data there for MySQL to churn against
Bottom line, there are many more questions that need asking and it seems as if both you and your user may not have the background to look for the right questions first in order to get answers.
Your server may or may not have issues, but you wont be able to bring this to a conclusion without getting a lot more detail.
PS, answer my poll:
Bearded Geeks or Not?
http://www.webhostingtalk.com/showthread.php?s=&threadid=56351