homepage Welcome to WebmasterWorld Guest from 54.205.122.62
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
What kind of questions do I need to ask you?
oo speed up my php/mysql script?
mrowton

5+ Year Member



 
Msg#: 398 posted 8:52 pm on Mar 20, 2006 (gmt 0)

I've used a php/mysql script on several sites for a few years now, I've hosted them on 3 different VPS's, a dedicated server for a year, and on my PC as a test. In all cased, even with very little information in the database and no traffic - it runs slow. 2-5 seconds per page. The index being especially slow.

I've spent the better part of a week now trying to figure out how to understand this better. I realize that it may not be possible for a person with my (lack of) knowledge to re-write a script and make it faster.

So instead I've decided that my first goal will be to simply understand what makes it go slow in the first place.

This is the totals from the main page on my test. Note, that if I turn on several options (that I would really like to use) the page load time increases by multiple seconds. So the below query is actually using as few queries as possible and still be functional.

15 total queries
This page was created in 2.59 seconds
Memory used: 5877040 bytes
load average: 1.93, 1.49, 1.21

and every so ofter (1 out of 7-10 page views) I'll get something like the following

15 total queries
This page was created in 5.58 seconds
Memory used: 5877528 bytes
load average: 1.32, 1.25, 1.11

I'm using
PHP Version: 4.3.10
MySQL Version: 3.23.58

Here is some other information
MySQL Stats:
Uptime: 335520
Threads: 4
Questions: 2630279
Slow queries: 0
Opens: 94031
Flush tables: 1
Open tables: 64
Queries per second avg: 7.839

I can also turn on some other debugging to have it display the sql statements and execution time as they are executed.

I've tried running the individual queries with EXPLAIN SELECT, but they seem to execute fairly quickly. I've tried adding new indexes in needed areas. But this has also made very little difference (a fraction of a second perhaps).

After thinking more about the "memory used" and looking at top on my server I'm not starting to think that this is more than a simple mysql issue.

What are some of the areas I should investigate next? What are some topics that I need to focus my research in? What other information can I provide to ask this a better way?

Thanks!

Mitchell

 

txbakers

WebmasterWorld Senior Member txbakers us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 398 posted 11:25 pm on Mar 20, 2006 (gmt 0)

look at INDEX

mrowton

5+ Year Member



 
Msg#: 398 posted 1:37 am on Mar 21, 2006 (gmt 0)

I've tried adding new indexes in needed areas. But this has also made very little difference (a fraction of a second perhaps).

Does the amount of memory used seem right? It can be higher on other pages.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved