Jump to content



Photo
* * * * * 2 votes

oscommerce suddenly running very slow?


This topic has been archived. This means that you cannot reply to this topic.
7 replies to this topic

#1   FWR Media

FWR Media
  • Members
  • 6,839 posts

Posted 11 October 2007 - 10:55

I identified today the main reason that my oscommerce sites had become very slow loading so below is the solution in the hope that it helps someone.

Do I have this problem?
Check the images on non secure pages, if they are loading as https then you have the same problem. Also viewing source will show that the base href for non secure pages is https.



In catalog/includes/application_top.php the following line sets the request type SSL or not.

// set the type of request (secure or not)
$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

For whatever reason my server was always returning ON even when not an SSL request.

This causes the base href of non secure pages to be https and causes ALL images to load as https://www.mysite.com/thisimage.php causing massive slowdown.

Changing the line to ...

// set the type of request (secure or not)
$request_type = (getenv('SERVER_PORT') == '443') ? 'SSL' : 'NONSSL';

Works, at least on my server.

Hope this helps someone.

#2   FWR Media

FWR Media
  • Members
  • 6,839 posts

Posted 28 November 2007 - 10:51

it is also necessary to make this change in ...

catalog/includes/functions/general.php

tep_redirect

if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page

change to

if ( (ENABLE_SSL == true) && (getenv('SERVER_PORT') == '443') ) { // We are loading an SSL page


#3   aryaji

aryaji
  • Members
  • 2 posts

Posted 08 February 2010 - 10:03

great... !! thank for your post

#4   b2995

b2995
  • Members
  • 41 posts

Posted 04 September 2010 - 03:18

OMGoodness! What a difference this little change made!!!

#5   Pilotshop

Pilotshop
  • Members
  • 1 posts

Posted 29 March 2011 - 21:26

I too was struggling with this. SSL was not my problem, it was a poorly optimized mysql. top showed mysqld was continusouly pegged at 100%+ sometimes almost 200% and response time was dreadfully. slow. Google clocked us at an average 11.9 seconds per page, some pages taking more than 30 seconds to load. For an ecommerce site, that kind of response is death. I tried the SSL trick, but found our pages were not loading https until checkout (which is what you want). It was clear that mysql was the problem. I tried optimizing all of the tables (I wrote a short php script to do this) but no joy. Then I thought perhaps I had a semaphore problem with ibdata - according to SHOW ENGINE INNODB STATUS that was most likely not the case. Then I sat and watched what queries were exactly being executed using SHOW FULL PROCESSLIST repeatedly and using copy and paste executing those queries so I could see how long they were taking. Any query that took longer than .5 seconds (some were over 10 seconds!) grabbed my attention. I noted from the query all of the fields that were either involved in a JOIN or WHERE clause and made sure that field had an index created for it in the appropriate tables. I ended up creating about 10 indexes that were not already present and now my site flies. Well, as much as can be expected for a site with 8000+ products and 350+ categories utilizing most of the features available (visit www.pilotshop.com for details). If there was a better way, I'd like to hear it.
Tom

#6   shsram

shsram
  • Members
  • 40 posts

Posted 19 April 2011 - 16:50

I too was struggling with this. SSL was not my problem, it was a poorly optimized mysql. top showed mysqld was continusouly pegged at 100%+ sometimes almost 200% and response time was dreadfully. slow. Google clocked us at an average 11.9 seconds per page, some pages taking more than 30 seconds to load. For an ecommerce site, that kind of response is death. I tried the SSL trick, but found our pages were not loading https until checkout (which is what you want). It was clear that mysql was the problem. I tried optimizing all of the tables (I wrote a short php script to do this) but no joy. Then I thought perhaps I had a semaphore problem with ibdata - according to SHOW ENGINE INNODB STATUS that was most likely not the case. Then I sat and watched what queries were exactly being executed using SHOW FULL PROCESSLIST repeatedly and using copy and paste executing those queries so I could see how long they were taking. Any query that took longer than .5 seconds (some were over 10 seconds!) grabbed my attention. I noted from the query all of the fields that were either involved in a JOIN or WHERE clause and made sure that field had an index created for it in the appropriate tables. I ended up creating about 10 indexes that were not already present and now my site flies. Well, as much as can be expected for a site with 8000+ products and 350+ categories utilizing most of the features available (visit www.pilotshop.com for details). If there was a better way, I'd like to hear it.
Tom


Hi, Im getting similar problems with my site loading. I have over 12000 products can you shed some light on to achieve faster loading time. www.desirablescents.biz

Edited by Jan Zonjee, 19 April 2011 - 17:43.


#7   ckouris84

ckouris84
  • Members
  • 7 posts

Posted 04 May 2011 - 04:58

I too was struggling with this. SSL was not my problem, it was a poorly optimized mysql. top showed mysqld was continusouly pegged at 100%+ sometimes almost 200% and response time was dreadfully. slow. Google clocked us at an average 11.9 seconds per page, some pages taking more than 30 seconds to load. For an ecommerce site, that kind of response is death. I tried the SSL trick, but found our pages were not loading https until checkout (which is what you want). It was clear that mysql was the problem. I tried optimizing all of the tables (I wrote a short php script to do this) but no joy. Then I thought perhaps I had a semaphore problem with ibdata - according to SHOW ENGINE INNODB STATUS that was most likely not the case. Then I sat and watched what queries were exactly being executed using SHOW FULL PROCESSLIST repeatedly and using copy and paste executing those queries so I could see how long they were taking. Any query that took longer than .5 seconds (some were over 10 seconds!) grabbed my attention. I noted from the query all of the fields that were either involved in a JOIN or WHERE clause and made sure that field had an index created for it in the appropriate tables. I ended up creating about 10 indexes that were not already present and now my site flies. Well, as much as can be expected for a site with 8000+ products and 350+ categories utilizing most of the features available (visit www.pilotshop.com for details). If there was a better way, I'd like to hear it.
Tom


Hi Tom,

I have visited your site and I can tell that you've done a terrific job on optimization. I have been trying to do the same with indexing all intensively used table joins and I will eventually have over 180K items on our site, in which 60K will be in stock and available. Now aside from us using a heavily modded Year/Make/Model lookup, the site is pretty much stock and it loads decent on FireFox, Chrome & Safari...however in Internet Explorer (using 8), it loads very slow and I cannot figure out why.

Do you know of any ideas to help?


Thank you!


PS: Excellent site you got there. I will recommend it to a friend of the family, as he is a pilot for American Airlines...

-Chris

#8   pmdstudio

pmdstudio
  • Members
  • 1 posts

Posted 30 August 2011 - 20:55

To all OsCommerce hackers: Guys, very soon I will be behind you, and you'll have to kneel !!!

P.S I've found a way to track them.