This topic is locked
[SOLVED]

 Slow query return in PHP, but not MYSQL

5/19/2016 12:27:28 AM
PHPRunner General questions
R
Replay author

I'm having an issue where a query that returns a three small summary rows and take 6-8 seconds to run in MYSQL, but for some reason is taking 20+ seconds to return and display in a PHPR List page.

As best I can tell, the issue might be with the PHP/MYSQL communication so I was wondering if anyone had ever seen something similar?

  • I've used Firebug to see what's going on, and it reports that 99% of the time is "Waiting" for the PHP call, so I think that indicates the issue is on the PHP/database side
  • I'm pretty sure this isn't a query-tuning issue since the SQL copied from PHPR runes 4x faster in MYSQL
  • The only impact I've had so far is by changing the PHP output_buffering to 4096. This shaved 1.5-2seconds off the load time
  • I am experiencing the issue with more than one list page, so it doesn't seem isolated to just this particular query
    The environment is a single PC running Windows 7 Business Edition 64 bit, 24GB RAM, Xenon 8-core.

    MYSQL 5.6, Apache 2.4 PHP 5.5
    If anyone has experienced this before, I'd love any suggestions for how to bring the query time in line with what I see in MYSQL.
    Thanks very much!

Admin 5/19/2016

PHPRunner needs to run more than one query per page. At the very least it needs to calculate the number of records and retrieve the data itself.

You can find more info and troubleshooting tips at http://xlinesoft.com/blog/2011/04/08/improving-perfomance-of-phprunnerasprunnerpro-applications/
I can also tell that 6-8 seconds isn't very fast for the query. Probably some indexes are missing.

R
Replay author 5/19/2016

Thanks Sergey, knowing that the query is executed multiple times answers the question and helps explain why the pages take so much longer to load than it takes MYSQL to return the data. (and yes, we know the query itself is slow too - folks are working on that - but it was the difference in time that had us perplexed)
For what we're doing, we don't need any page controls, etc... for the output. It's really just going to sit in a dashboard. Are there components we cold trim off of the page that would prevent the query from being run more than once?
Thanks again!