katrobb:
The query cache in my v1.5.1 does not seem to be working.
For example on the same product, my test v1.5.1 showed
Parse Time: 5.188 - Number of Queries: 699 - Query Time: 3.60574690321.
My v1.3.9h showed
Parse Time: 1.840 - Number of Queries: 102 - Query Time: 0.152396841141.
...
Your server seems rather slow (database for sure, also the PHP code) - you may want to look into the performance of your hosting / testing environment.
Results from a clean installation of ZC 1.5.1 w/ the SQL_CACHE_METHOD patch and the USU plugin:
ZC 1.5.1 (Query Cache: off, SQL_CACHE_METHOD: none): Parse Time: 0.507 - Number of Queries: 831 - Query Time: 0.22103139341736
ZC 1.5.1 (Query Cache: on, SQL_CACHE_METHOD: none): Parse Time: 0.470 - Number of Queries: 402 - Query Time: 0.19609870233154
ZC 1.5.1 (Query Cache: on, SQL_CACHE_METHOD: file): Parse Time: 0.419 - Number of Queries: 376 - Query Time: 0.16558531408692
NOTE: Using "test data", default settings (including EZ-Pages and sideboxes), and accessing the product page for "Matrox G200 MMS" (two attributes). Zen Cart is running on a LAMP VM (Core2 VCPU limited to 20-50% of a single core w/ 512G mem). LAMP VM is running Apache mpm-prefork + PHP 5.4 + MySQL 5.5. Same VM is also running multiple other websites (and other web applications). QC was disabled for tests by commenting out the appropriate auto loader lines.
As you can see the Query Cache does have an effect. Note using the SQL_CACHE_METHOD only affects a VERY small number of queries (ones which have potential to be slow) - thus the small impact enabling this option had in my test environment. But yes there are a few differences between QC 1.6/1.7B and the QC included in Zen Cart 1.5.1.
If I remember correctly (it has been awhile since I looked at QC 1.6/1.7B), QC 1.6/1.7B added changes to Zen Cart which resulted in the category and product name/id/parent mappings being read into memory early on and then using functions to return these where Zen Cart needed this information. This is done at the expense of additional memory being required by each page request.
The Zen Cart 1.5.1 version of QC does not do this which results in a greater number of SQL calls overall, but reduces the amount of memory required / used by a single call to Zen Cart. This reduces the potential for the server to "run out of memory" potentially forcing additional disk I/O or "out of memory" crashes of PHP.
As SQL calls are typically very fast, hosting providers often limit memory usage, and disk I/O is usually the biggest bottleneck... Having a balance between "saved SQL calls" and "memory usage" in the Zen Cart 1.5.1 version of QC makes sense. In most hosting environments were I have installed Zen Cart, making the extra 200-300 small (returned data) SQL calls instead of a few large (returned data) SQL calls does not make much difference...
However if your MySQL server is not hosted on the same server as your web server (such as a different hosting provider, in rare cases)... And there is a substantial network delay for connecting and retrieving data from the remote MySQL server... You may wish to add back in some additional caching... Or talk to your providers about why the communications are so slow...
Or better yet just make sure both the MySQL server and Web Server are on the same local network (or server) and not overloaded...
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker