Author Topic: Saratoga - slow load times  (Read 471 times)

0 Members and 1 Guest are viewing this topic.

Offline kds

  • Member
  • *
  • Posts: 12
Saratoga - slow load times
« on: April 13, 2018, 09:53:31 PM »
I'm getting some really slow load times on my Saratoga template. It's been as much as 18 seconds but usually around 8-16 seconds on average. I'm using https://tools.pingdom.com/#!/dFjbnh/https://sanders.io/weather-saratoga/ to test. It looks like it's just waiting on the page to render.

I looked at the comments in the source and on the check-fetch-times script and I can't single anything out with long load times. Another wrinkle is that it happens usually only when no one recently visited the site, like a caching issue, but I don't have anything for caching enabled in my control panel. If I go about 30 minutes or more without visiting the site, it loads slow. If I refresh after a few minutes, it's fast.

What could be causing this? What can I check on my end?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga - slow load times
« Reply #1 on: April 13, 2018, 10:31:12 PM »
Looking at https://sanders.io/weather-saratoga/check-fetch-times.php?show=versions shows you need a few scripts updated.

Doing a view-source on your index page shows get-USNO-sunmoon.php
Quote
<!-- get-USNO-sunmoon.php - Version 3.01 - 20-Oct-2017 -->
<!-- refetch seconds=1 -->
<!-- loading ./cache/USNO-moondata.txt from http://api.usno.navy.mil/rstt/oneday?date=04/13/2018&coords=41.643194,-93.708921&tz=-5 -->
<!-- curl fetching 'http://api.usno.navy.mil/rstt/oneday?date=04/13/2018&coords=41.643194,-93.708921&tz=-5' -->
<!-- HTTP stats:  RC=200 dest=199.211.133.93 port=80 (from sce=69.163.152.142)
      Times: dns=7.515 conn=7.597 pxfer=7.597 get=0.360 total=7.957 secs -->
<!-- loading finished. -->

and a check-fetch-times.php shows
Quote
--checking UV Forecast from temis.nl --
Using Settings.php $SITE['UVscript'] entry for test.
URL: http://www.temis.nl/uvradiation/nrt/uvindex.php?lon=-93.708921&lat=41.643194
Cache: ./cache/uv-forecast.txt
 curl fetching 'http://www.temis.nl/uvradiation/nrt/uvindex.php?lon=-93.708921&lat=41.643194'
 HTTP stats:  RC=200 dest=145.23.254.72 port=80 (from sce=69.163.152.142)
      Times: dns=2.510 conn=2.647 pxfer=2.647 get=1.016 total=3.663 secs
RC=200 OK, bytes=6383

Together, they add 10+ seconds to the initial page load (when the cache files are refreshed).

The DNS times are very anomalous - DNS should return results in under 1 second (usually < 0.25 seconds).  I suspect your hoster's DNS setup is having a problem (overloaded or non-caching DNS servers?).

Do update your site with current scripts (the check-fetch-times.php can then accurately test the NWS forecast and not just a 302 redirect).

Then see if the times improve.  If not, contact your hoster and complain about slow DNS resolution times specifically for
api.usno.navy.mil
www.temis.nl

Since your get-USNO-sunmoon.php is at current version, you can add
Code: [Select]
$SITE['useUSNO'] = false; to Settings.php to force the script to use internal calculations and shave 8 seconds off your page-load due to the DNS issues with api.usno.navy.mil from your webserver.

Hope this helps...
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: Saratoga - slow load times
« Reply #2 on: April 14, 2018, 03:26:34 AM »
What could be causing this? What can I check on my end?

Hi,
I got very bad times when I switched to php pages.
I discussed it with my hoster and at the end they did dome tweaking / changes on the server and now everything is ok.
Of course that was my case , yours can differ.  I made a "test page" without any links coming from external pages so I could make my point it was on their server.
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline kds

  • Member
  • *
  • Posts: 12
Re: Saratoga - slow load times
« Reply #3 on: April 14, 2018, 03:27:26 PM »
Looking at https://sanders.io/weather-saratoga/check-fetch-times.php?show=versions shows you need a few scripts updated.

Doing a view-source on your index page shows get-USNO-sunmoon.php
Quote
<!-- get-USNO-sunmoon.php - Version 3.01 - 20-Oct-2017 -->
<!-- refetch seconds=1 -->
<!-- loading ./cache/USNO-moondata.txt from http://api.usno.navy.mil/rstt/oneday?date=04/13/2018&coords=41.643194,-93.708921&tz=-5 -->
<!-- curl fetching 'http://api.usno.navy.mil/rstt/oneday?date=04/13/2018&coords=41.643194,-93.708921&tz=-5' -->
<!-- HTTP stats:  RC=200 dest=199.211.133.93 port=80 (from sce=69.163.152.142)
      Times: dns=7.515 conn=7.597 pxfer=7.597 get=0.360 total=7.957 secs -->
<!-- loading finished. -->

and a check-fetch-times.php shows
Quote
--checking UV Forecast from temis.nl --
Using Settings.php $SITE['UVscript'] entry for test.
URL: http://www.temis.nl/uvradiation/nrt/uvindex.php?lon=-93.708921&lat=41.643194
Cache: ./cache/uv-forecast.txt
 curl fetching 'http://www.temis.nl/uvradiation/nrt/uvindex.php?lon=-93.708921&lat=41.643194'
 HTTP stats:  RC=200 dest=145.23.254.72 port=80 (from sce=69.163.152.142)
      Times: dns=2.510 conn=2.647 pxfer=2.647 get=1.016 total=3.663 secs
RC=200 OK, bytes=6383

Together, they add 10+ seconds to the initial page load (when the cache files are refreshed).

The DNS times are very anomalous - DNS should return results in under 1 second (usually < 0.25 seconds).  I suspect your hoster's DNS setup is having a problem (overloaded or non-caching DNS servers?).

Do update your site with current scripts (the check-fetch-times.php can then accurately test the NWS forecast and not just a 302 redirect).

Then see if the times improve.  If not, contact your hoster and complain about slow DNS resolution times specifically for
api.usno.navy.mil
www.temis.nl

Since your get-USNO-sunmoon.php is at current version, you can add
Code: [Select]
$SITE['useUSNO'] = false; to Settings.php to force the script to use internal calculations and shave 8 seconds off your page-load due to the DNS issues with api.usno.navy.mil from your webserver.

Hope this helps...

That did help, thanks!

I don't want to keep opening up new threads but now I have a question regarding nws-alerts. I read through the readme and configured everything accordingly, but I'm not able to get it to update. The cache folder is writable. I have been calling nws-alerts.php manually and through cron with no success. After I switched $noCron to false and included nws-alerts.php in the index, it's still not updating and then index.php stops loading right where I included nws-alerts.php. What am I doing wrong?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga - slow load times
« Reply #4 on: April 14, 2018, 03:31:38 PM »
I just did the check-fetch-times.php?show=versions on your site, and it shows you still have scripts to update on your website (maybe you didn't FTP them to the site?).  Do the updates on the site, and then let's debug the issue with nws-alerts.

And no worries about using this thread for additional issues you spot..
« Last Edit: April 14, 2018, 03:33:22 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP