Guest Posted April 30, 2005 Share Posted April 30, 2005 Array ( [QUERIES] => Array ( [0] => select configuration_key as cfgKey, configuration_value as cfgValue from configuration [1] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '0') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '0') and tr.tax_class_id = '0' group by tr.tax_priority [2] => select value from sessions where sesskey = 'dd0d98624e89b30cdb6a6c0efdd9e4c3' and expiry > '1114893828' [3] => select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from currencies [4] => DELETE FROM cache WHERE cache_expires <= '2005-04-30 01:43:48' [5] => SELECT cache_expires FROM cache WHERE cache_id='9e18319fdade9c4245b75b9845486bb8' AND cache_language_id='1' LIMIT 1 [6] => SELECT cache_expires FROM cache WHERE cache_id='dae46d252d93631f218b79dd62eb04eb' AND cache_language_id='1' LIMIT 1 [7] => SELECT cache_expires FROM cache WHERE cache_id='f47315cba5e35ca49994fbf925cfaa75' AND cache_language_id='1' LIMIT 1 [8] => SELECT cache_id, cache_language_id, cache_name, cache_data, cache_global, cache_gzip, cache_method, cache_date, cache_expires FROM cache WHERE cache_language_id='1' AND cache_global='1' [9] => delete from whos_online where time_last_click < '1114892928' [10] => select count(*) as count from whos_online where session_id = 'dd0d98624e89b30cdb6a6c0efdd9e4c3' [11] => update whos_online set customer_id = '0', full_name = 'Guest', ip_address = '24.17.250.32', time_last_click = '1114893828', last_page_url = '/cables-c-27.html' where session_id = 'dd0d98624e89b30cdb6a6c0efdd9e4c3' [12] => select specials_id from specials where status = '1' and now() >= expires_date and expires_date > 0 [13] => select categories_name from categories_description where categories_id = '27' and language_id = '1' [14] => select count(*) as total from products_to_categories where categories_id = '27' [15] => select count(*) as total from categories where parent_id = '27' [16] => select cd.categories_name from categories c, categories_description cd where c.categories_id = '27' and cd.categories_id = '27' and cd.language_id = '1' [17] => select manufacturers_name from manufacturers where manufacturers_id = '0' [18] => select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='1' order by sort_order, cd.categories_name [19] => select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd where c.parent_id = '27' and c.categories_id = cd.categories_id and cd.language_id='1' order by sort_order, cd.categories_name [20] => select count(*) as count from categories where parent_id = '27' [21] => select count(*) as count from categories where parent_id = '27' [22] => select count(*) as count from categories where parent_id = '52' [23] => select count(*) as count from categories where parent_id = '52' [24] => select count(*) as count from categories where parent_id = '31' [25] => select count(*) as count from categories where parent_id = '31' [26] => select count(*) as count from categories where parent_id = '35' [27] => select count(*) as count from categories where parent_id = '35' [28] => select count(*) as count from categories where parent_id = '49' [29] => select count(*) as count from categories where parent_id = '49' [30] => select count(*) as count from categories where parent_id = '30' [31] => select count(*) as count from categories where parent_id = '30' [32] => select count(*) as count from categories where parent_id = '50' [33] => select count(*) as count from categories where parent_id = '50' [34] => select count(*) as count from categories where parent_id = '53' [35] => select count(*) as count from categories where parent_id = '53' [36] => select count(*) as count from categories where parent_id = '51' [37] => select count(*) as count from categories where parent_id = '51' [38] => select count(*) as count from categories where parent_id = '42' [39] => select count(*) as count from categories where parent_id = '42' [40] => select count(*) as count from categories where parent_id = '41' [41] => select count(*) as count from categories where parent_id = '41' [42] => select count(*) as count from categories where parent_id = '43' [43] => select count(*) as count from categories where parent_id = '43' [44] => select count(*) as count from categories where parent_id = '28' [45] => select count(*) as count from categories where parent_id = '28' [46] => select count(*) as count from categories where parent_id = '47' [47] => select count(*) as count from categories where parent_id = '47' [48] => select count(*) as count from categories where parent_id = '38' [49] => select count(*) as count from categories where parent_id = '38' [50] => select count(*) as count from categories where parent_id = '36' [51] => select count(*) as count from categories where parent_id = '36' ..more of the same pattern are the duplicates normal? I cant seem to think of why I would have duplicates of the same query... ??? bobby, please please, pretty please help me. site: mypowergear.com Link to comment Share on other sites More sharing options...
Guest Posted May 1, 2005 Share Posted May 1, 2005 Have you read all 13 pages of this thread and this one and implemented most of the excellent contribs Bobby has kindly coded (mentioned in the first thread)? This thread might help if your own a dedicated server. This thread also contains good info, as does this one Theres a few more on the forum about changing the GZIP compression to make it more efficient etc, mostly in the tips section. In reply to your question, im not sure if all those duplicates (select count(*) as count) are normal but I have them. I do know that if you download the current CVS that all of these duplicates are delt with by one query which would remove 31 of your queries below. (I know cos hpdl said so :) ) the only problem is it needs porting back to MS2.2 as its not compatible as is. Theoretically as you dont have category counts enabled all of those queries are superfluous as far as I can make out. Bobby did mention that before he departs this place to return to his other job he was going to release a couple more contribs, but then I recently read that his frustration in coding to non existant standards meant he wasnt going to release any more code. I hope you do Bobby! Link to comment Share on other sites More sharing options...
Guest Posted May 1, 2005 Share Posted May 1, 2005 Have you read all 13 pages of this thread and this one and implemented most of the excellent contribs Bobby has kindly coded (mentioned in the first thread)?This thread might help if your own a dedicated server. This thread also contains good info, as does this one Theres a few more on the forum about changing the GZIP compression to make it more efficient etc, mostly in the tips section. In reply to your question, im not sure if all those duplicates (select count(*) as count) are normal but I have them. I do know that if you download the current CVS that all of these duplicates are delt with by one query which would remove 31 of your queries below. (I know cos hpdl said so :) ) the only problem is it needs porting back to MS2.2 as its not compatible as is. Theoretically as you dont have category counts enabled all of those queries are superfluous as far as I can make out. Bobby did mention that before he departs this place to return to his other job he was going to release a couple more contribs, but then I recently read that his frustration in coding to non existant standards meant he wasnt going to release any more code. I hope you do Bobby! <{POST_SNAPBACK}> I am one of many 'fans' of bobby's work... and yes I have read many threads and have implemented many of contributions that bobby had coded. I admire what he is doing and have done. I hope that even if he does give his persute to rest, that he'd visit us and give us guidance once in a while!! :rolleyes: When I started using oscommerce, I did not have any knowledge of PHP at all.. I barely know HTML, but I was determined. One thing that I know I'm good at is research and teaching myself... It has been about 8 months, and I know a lot about coding... (bobby's threads had a lot to do with it.) But right now, I'm stuck... I need optimization, and I have done a ton that I can do. Bobby's rule is that he is willing to help but he will not do it for you. I really respect that. But like I said, I'm stuck.. I think that his contribution to UNION Query Product Listing will help... I have read and read about union query but was unable to implement it to the site.. trial after trial... I do not know what to do any more.. I need help!! Bobby?? :'( I do not think that I have done all I can. One thing that I have learned about programing is that there's always another way to do it better... I am still searching for it. Anyway, I don't mean to give you a sobe story but just wish me luck! See you around. Link to comment Share on other sites More sharing options...
Guest Posted May 1, 2005 Share Posted May 1, 2005 I am one of many 'fans' of bobby's work... and yes I have read many threads and have implemented many of contributions that bobby had coded. I admire what he is doing and have done. I hope that even if he does give his persute to rest, that he'd visit us and give us guidance once in a while!! :rolleyes: When I started using oscommerce, I did not have any knowledge of PHP at all.. I barely know HTML, but I was determined. One thing that I know I'm good at is research and teaching myself... It has been about 8 months, and I know a lot about coding... (bobby's threads had a lot to do with it.) But right now, I'm stuck... I need optimization, and I have done a ton that I can do. Bobby's rule is that he is willing to help but he will not do it for you. I really respect that. But like I said, I'm stuck.. I think that his contribution to UNION Query Product Listing will help... I have read and read about union query but was unable to implement it to the site.. trial after trial... I do not know what to do any more.. I need help!! Bobby?? :'( I do not think that I have done all I can. One thing that I have learned about programing is that there's always another way to do it better... I am still searching for it. Anyway, I don't mean to give you a sobe story but just wish me luck! See you around. <{POST_SNAPBACK}> Good luck mate. Your storey sounds very similar to mine, and I expect a few (thousand) others. I also looked at that Union Query and have googled my fingers off trying to find out how to implement it - and failed :'( :blush: Link to comment Share on other sites More sharing options...
galac Posted May 31, 2005 Share Posted May 31, 2005 Oupss ! My mainpage with Firefox : 5 kos with IE 6 : 31 kos ? Oh my god, IE 6 sux so much and files cant be gzip compressed - or is it me ? Link to comment Share on other sites More sharing options...
esquat Posted June 2, 2005 Share Posted June 2, 2005 I hacked the compress_buffer function a little more. Here's my version: # Return the compressed buffer function compress_buffer ($buffer) { # strip blank lines (blank, with tab or whitespaces) $buffer = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/","\n",$buffer); # join lines $buffer = str_replace("[\r\n]", ' ', $buffer); # strip whitespace between > and < return preg_replace('/\>[\s\t]+\</', '> <', $buffer); } I was having quite a lot of tabs and empty lines. Say good-bye to them. Good luck, Ted Link to comment Share on other sites More sharing options...
esquat Posted June 2, 2005 Share Posted June 2, 2005 For those where the compress_buffer() hack don't work, check your application_top.php and application_bottom.php. Especially the latter. On any CRE Loaded shop there is a line if ( ((PHP_VERSION < '4.0.4') && (PHP_VERSION >= '4')) ) { which effectively prohibits a call to tep_gzip_output() unless you use php versions 4.0.0 through 4.0.3 Good luck, Ted Link to comment Share on other sites More sharing options...
DiamondSea Posted July 20, 2005 Share Posted July 20, 2005 In your post you wrote: STS - Simple Template SystemI wanted to give special attention and space to this contribution since it is one of the worse offenders for queries and is also one of the more popular template systems available for osCommerce. If you have a significant number of categories on your store this contribution will kill your page performance. It performs a full table scan on each page request. If you have more than a few hundred categories it will increase your page load time by 200-300% based on server specifications. I'm all for optimizing STS. I hadn't considered sites having hundreds of categories (the ones I make are usually under 30), and I hadn't optimized the code for it. I'll fix that for the next version. As to the "full table scan", which function in general are you talking about, or is it all of them ($catmenu, $categorybox, $cat_XXX, $urlcat_XXX)? Thanks, - Brian Simple Template System (STS) Layout your site with 1 (or more) HTML file! Download STS: http://www.oscommerce.com/community/contributions,1524 Support: http://www.oscommerce.com/forums/index.php?showtopic=58541 Link to comment Share on other sites More sharing options...
azer Posted July 29, 2006 Share Posted July 29, 2006 id love to see benchmark for pages loading with or without tohose gzip optimisation , i t would help us see the saving for each modification made , I got no clue what indicator i got on the osc shop to be able to mesure the performance , the only contirb i installed is a loading time that tells me in second how long it took to load the page , but it s not at all accurate by the way , couldyou give us more details on this , the (primary) can give translation difference : SESSIONSIf you store the sessions in the database consider adding a (primary) multi-column index on sesskey and expiry columns. This will take up more physical space but will be much faster and will be a const query type. a member of the french communauty explain us , addind a primary index on 'expiry' would be enough to enhance the performance on this kind of queries : function _sess_read : $value_query = tep_db_query("select value from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "' and expiry > '" . time() . "'"); function _sess_gc : tep_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . time() . "'"); MS2 Link to comment Share on other sites More sharing options...
azer Posted July 29, 2006 Share Posted July 29, 2006 I hacked the compress_buffer function a little more. Here's my version: ?# Return the compressed buffer ?function compress_buffer ($buffer) { ? ?# strip blank lines (blank, with tab or whitespaces) ? ?$buffer = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/","\n",$buffer); ? ?# join lines ? ?$buffer = str_replace("[\r\n]", ' ', $buffer); ? ?# strip whitespace between > and < ? ?return preg_replace('/\>[\s\t]+\</', '> <', $buffer); ?} I was having quite a lot of tabs and empty lines. Say good-bye to them. Good luck, Ted for the moment i had this line : # Return the compressed buffer return str_replace("\n", ' ', preg_replace('/\>\s+\</', '> <', $buffer)); i tired with your code on many pages , but i see no real time load saving , almost the same, are you sure it would be better ? if yes , then i put your code , maybe when the website would be bigger ill see the enhancement :huh: :rolleyes: MS2 Link to comment Share on other sites More sharing options...
roughrider Posted November 20, 2006 Share Posted November 20, 2006 I've searched the whole web trying to find out what can be done to for this problem. "Adding or updating items means I'm losing customers because everytime I hit update, a potential customer has to wait anywhere from 10secs to a couple of mins or more for a page to load" My site is fast otherwise, I have had my dedicated server increased to 2gb of ram but has made no difference. This must be a common problem, I have 30,000 items but had the same problem with only a few hundred & when on a shared sever.. Other than adding or updating itmes in the middle of the night, what can I do?? I don't know how to fix queries or mysql etc but I know someone that could if only we knew what needs fixing. Thanks Ride It Like You Stole It Link to comment Share on other sites More sharing options...
mpiscopo Posted November 20, 2006 Share Posted November 20, 2006 Arnie, Do you have the "Customer who purchased this also purchased this" module loading for product details? I have a problem with it once the number of orders grew - problem was that the table was not properly indexed. Link to comment Share on other sites More sharing options...
roughrider Posted November 20, 2006 Share Posted November 20, 2006 No I don't & I've turned off other stuff, getting nowhere fast :( Ride It Like You Stole It Link to comment Share on other sites More sharing options...
roughrider Posted November 20, 2006 Share Posted November 20, 2006 Fixed it, after a year of problems I'm sorted. It was down to SEO URLS contrib, don't ask me why but I set "Enable SEO cache to save queries?" to false and now it loads every page no matter what I do in a split second ... Yipeeeeeee Ride It Like You Stole It Link to comment Share on other sites More sharing options...
shpy Posted November 26, 2006 Share Posted November 26, 2006 SESSIONSIf you store the sessions in the database consider adding a (primary) multi-column index on sesskey and expiry columns. This will take up more physical space but will be much faster and will be a const query type. Please explaint more. I don't understand it. I don't know how to optimize this. Paint for VietNamese : Link to comment Share on other sites More sharing options...
shpy Posted December 9, 2006 Share Posted December 9, 2006 I hacked the compress_buffer function a little more. Here's my version: # Return the compressed buffer function compress_buffer ($buffer) { # strip blank lines (blank, with tab or whitespaces) $buffer = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/","\n",$buffer); # join lines $buffer = str_replace("[\r\n]", ' ', $buffer); # strip whitespace between > and < return preg_replace('/\>[\s\t]+\</', '> <', $buffer); } I was having quite a lot of tabs and empty lines. Say good-bye to them. Good luck, Ted How do this function work ? I had add this function. I don't know when gzip run, it work or not ? But when i view source (after the code page had send by Gzip) , the code page is not removed the white spaces! Paint for VietNamese : Link to comment Share on other sites More sharing options...
concorde44 Posted December 19, 2006 Share Posted December 19, 2006 Hi, for me too, after having a look at the source code of the page, no lines/space wrap. Does it mean the gzip function is not working ? how to be certain it is applied on my website ? Thanks. Seb Osc 2.2 MS2 Link to comment Share on other sites More sharing options...
sargenle Posted January 7, 2007 Share Posted January 7, 2007 So. What .php files are the biggest hogs in terms of Php to Mysql queries and population with excessive process times? Leon Link to comment Share on other sites More sharing options...
Jan Zonjee Posted January 7, 2007 Share Posted January 7, 2007 So. What .php files are the biggest hogs in terms of Php to Mysql queries and population with excessive process times? Don't ask, read :) Link to comment Share on other sites More sharing options...
voided Posted February 4, 2008 Share Posted February 4, 2008 the reason the new changes don't do anything in gzip_compression.php is because you need to remove 1 line and add an include in application_bottom.php in application_bottom.php ad this <?php /* $Id: application_bottom.php,v 1.14 2003/02/10 22:30:41 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ // close session (store variables) tep_session_close(); if (STORE_PAGE_PARSE_TIME == 'true') { $time_start = explode(' ', PAGE_PARSE_START_TIME); $time_end = explode(' ', microtime()); $parse_time = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3); error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' - ' . getenv('REQUEST_URI') . ' (' . $parse_time . 's)' . "\n", 3, STORE_PAGE_PARSE_TIME_LOG); if (DISPLAY_PAGE_PARSE_TIME == 'true') { echo '<span class="smallText">Parse Time: ' . $parse_time . 's</span>'; } } if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded == true) && ($ini_zlib_output_compression < 1) ) { tep_gzip_output(GZIP_LEVEL); } ?> Designrfix.com | Graphic Design Inspiration & Web Design Resources - @designrfix Link to comment Share on other sites More sharing options...
roughrider Posted October 18, 2008 Share Posted October 18, 2008 Arnie, The problem is in SEO URLs, Enable SEO cache to save queries? set to true, set it to false & all is working great. Ride It Like You Stole It Link to comment Share on other sites More sharing options...
Guest Posted March 10, 2009 Share Posted March 10, 2009 Set your cache directory settings to this filepath to keep it from being stored in the "/tmp" folder which will cause issues. Hi there, just to clarify... do you mean to set up a folder outside the httpdocs folder. I have a writable folder called private outside of this folder. If I set the folder to /var/www/vhosts/tvr.co.za/private/ I get this error... Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/var/www/vhosts/tvr.co.za/private/) is not within the allowed path(s): (/var/www/vhosts/tvr.co.za/httpdocs:/tmp) in /var/www/vhosts/tvr.co.za/httpdocs/admin/cache.php on line 26 .... how do I set this up? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.