Number of requests SQL
5 posts by 2 authors in: Forums > CMS Builder
Last Post: November 26, 2008 (RSS)
By Djulia - November 25, 2008
It would be possible to know the number total of requests SQL on the public pages ( pageList.php and pageDetail.php ) ?
For example :
Homepage :154 query SQL
Story : 106 query SQL
etc..
An idea ?
Thanks for your assistance.
Djulia
Re: [Djulia] Number of requests SQL
By Dave - November 25, 2008
Do you want to create a hit counter? You can do that like this:
Create a field called 'hits' (or whatever you want to call it) add this in your page. Then use this code. This first field is the tablename, the second field is the fieldname, and the third field is the record number
<?php incrementCounterField('news', 'hits', $newsRecord['num']); ?>
Or do you want to know the number of SQL queries executed? (If so, curious what for?)
interactivetools.com
Re: [Dave] Number of requests SQL
By Djulia - November 25, 2008 - edited: November 25, 2008
Thank you Dave for your answer.
>> Or do you want to know the number of SQL queries executed?[/#800000]
Yes, I seek to obtain the number of requests SQL.
We are on a mutualized server and we wish to be able to check if slownesses are caused by server SQL or the file server.
It is objective information and which enables me to exchange with our ISP (...)
You think that it is possible ?
I think that it is necessary to create a function PHP ?
Or, there is perhaps a extension for Firefox ?
Thanks,
Djulia[font "Times New Roman"][font "Times New Roman"]
Re: [Djulia] Number of requests SQL
By Dave - November 25, 2008
How slow is it? You can display the total time at the bottom of the page like this:
<?php showExecuteSeconds() ?> seconds
CMS Builder does do some extra MySQL queries, and you can reduce those if needed. But it's likely the web host since CMS Builder is fast on many other hosts.
In our experience the best way to convince a web host is to write a short script that demonstrates the problem so they can't blame it on the software. I've attached a script I recently wrote the times the MySQL connection speed. (This may or may not be the problem).
On the client's host I wrote this for it took 9 seconds just to connect to MySQL - not even to run any queries.
Try this one, just change the login info at the top. Then let me know what happens.
interactivetools.com
Re: [Dave] Number of requests SQL
By Djulia - November 26, 2008 - edited: November 26, 2008
That functioned well, and other customers also informed them of the problem.
Our ISP thus took time to look at. There was a problem of memory (ram) on server SQL.
They will do what is necessary.
Sometimes, they have a little difficulties for hearing the customers…
We preciously keep your file for the future.
Thanks,
Djulia