Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Home page taking about 60 seconds to load

Discussion of Ken True's web site templates

Moderator: saratogaWX

Supercell
Posts: 16
Joined: Sat Oct 13, 2012 9:37 pm
Weather Station: Vue + B-L Sunrecorder
Operating System: Win7
Location: Dublin, Ireland

Home page taking about 60 seconds to load

Postby Supercell » Sun Jul 30, 2017 6:04 pm

I can't figure out why its happened, maybe someone could kindly take a look for me ?
Suddenly my home page is taking around 60 seconds to load, other pages load fine.
Have used the version checker and updated everything but something, i dont know what, is taking a very long time to load.

Website is www.dublinweather.eu

Anyone any ideas?

Thanks.
Image

User avatar
saratogaWX
Posts: 835
Joined: Wed May 06, 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows XP SP3
Location: Saratoga, CA, USA
Contact:

Re: Home page taking about 60 seconds to load

Postby saratogaWX » Sun Jul 30, 2017 10:43 pm

Looking at the view-source of your home page shows part of the problem in
<!-- module wrnWarningv3.php = version: 3.0c 2014-08-24 -->
<!-- warnings and other info goes here -->
<!--
Severe weatherdata (./cache/warningIE004) cache times:
cache time = 2017-07-31T00:18:13+02:00 from unix time 1501453093
current time = 2017-07-31T00:34:40+02:00 from unix time 1501454080
difference = 987 (seconds)
diff allowed = 900 (seconds) -->
<!-- Severe weatherdata loaded from http://www.meteoalarm.eu/en_UK/0/0/IE004.html -->
<!-- Severe weatherdata (./cache/warningIE004) saved to cache -->

It looks like access to meteoalarm.eu was taking longer than expected, and
<!-- WU-forecast.php (ML) Version 3.03 - 22-Feb-2017 on PHP 5.3.3 -->
<!-- temps in C -->
<!-- WU_API Raw URL='http://www.wunderground.com/global/stations/03967.html' -->
<!-- WU API New URL='http://api.wunderground.com/api/6f2b3bd065082e77/forecast10day/geolookup/lang:EN/q/zmw:00000.1.03967.json' -->
<!-- loading from https://api.wunderground.com/api/6f2b3b ... 03967.json. -->
<!-- curl fetching 'https://api.wunderground.com/api/6f2b3bd065082e77/forecast10day/geolookup/lang:EN/q/zmw:00000.1.03967.json' -->
<!-- HTTP stats: RC=200 dest=
Times: dns=0.232 conn=0.233 pxfer=0.253 get=0.322 total=0.575 secs -->
<!-- RC=200 OK, bytes=26340 -->

shows another 0.5 seconds (not bad at all), and
<!-- get-USNO-sunmoon.php - Version 2.04 - 11-Nov-2015 -->
<!-- local date changed v.s. cache date .. reloading from USNO -->
<!-- refetch seconds=1 -->
<!-- loading ./cache/USNO-moondata.txt from http://199.211.133.93/rstt/oneday?date= ... 13377&tz=1 -->
<!-- GET /rstt/oneday?date=07/30/2017&coords=53.24858,-6.13377&tz=1 HTTP/1.1
Host: 199.211.133.93 Port: 80 IP=199.211.133.93-->
<!-- HTTP stats: dns=0.000 conn=0.097 put=0.000 get(37 blocks)=18.146 close=0.000 total=18.244 secs -->
<!-- fetch function elapsed= 18 secs. -->
added another 18 seconds to the page load.

So.. I think delays at meteoalarm.eu and api.usno.navy.mil (for alarms and moondata) are the primary cause of slow page load at this time.

User avatar
Toxic17
Posts: 543
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: Home page taking about 60 seconds to load

Postby Toxic17 » Sun Jul 30, 2017 11:31 pm

loading within a second for me though api.usno.navy.mil has been offline for 2-3 days so far. think it maybe back again now though.
Regards Simon

https://www.conligwx.org
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

Supercell
Posts: 16
Joined: Sat Oct 13, 2012 9:37 pm
Weather Station: Vue + B-L Sunrecorder
Operating System: Win7
Location: Dublin, Ireland

Re: Home page taking about 60 seconds to load

Postby Supercell » Mon Jul 31, 2017 9:41 am

Was working fine again for a time yesterday and this morning but is slow again.
Thanks for looking at that for me.

Edit: Found viewtopic.php?f=25&t=15917 which says to rename get-USNO-sunmoon.php which did the trick for now, thanks for the heads up!
Image

User avatar
Toxic17
Posts: 543
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: Home page taking about 60 seconds to load

Postby Toxic17 » Mon Jul 31, 2017 9:50 pm

Supercell wrote:Was working fine again for a time yesterday and this morning but is slow again.
Thanks for looking at that for me.

Edit: Found viewtopic.php?f=25&t=15917 which says to rename get-USNO-sunmoon.php which did the trick for now, thanks for the heads up!


mine was loading ok just with errors regarding the USNO stuff. I got an email back from them and they said they were looking into the issue.

I removed the errors by adding the following on lines 359 and 369 of get-USNO-sunmoon.php

Code: Select all

error_reporting(0);


btw if you wanna tweak the speed - check your website with https://gtmetrix.com/

also this report:

https://tools.pingdom.com/#!/ereTSL/htt ... weather.eu
Regards Simon

https://www.conligwx.org
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

drat
Posts: 9
Joined: Mon Jun 29, 2009 1:45 am
Weather Station: VP2

Re: Home page taking about 60 seconds to load

Postby drat » Tue Aug 01, 2017 2:45 pm

Mine is also taking over 30 seconds to load. Comes and goes. Last night it was fine but this morning it's back to loading slowly.

http://weather.pmhahn.com

Paul

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Home page taking about 60 seconds to load

Postby mcrossley » Tue Aug 01, 2017 2:50 pm

What data is this script downloading, could you not just calculate it PHP locally - by using a library is necessary. It would free you from the dependency on the USNO...

User avatar
Toxic17
Posts: 543
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: Home page taking about 60 seconds to load

Postby Toxic17 » Tue Aug 01, 2017 4:07 pm

mcrossley wrote:What data is this script downloading, could you not just calculate it PHP locally - by using a library is necessary. It would free you from the dependency on the USNO...



mark something like so:
USNO-moondata.txt

Code: Select all

HTTP/1.1 200 OK
Date: Sun, 30 Jul 2017 19:02:06 GMT
Server: Apache
Access-Control-Allow-Origin: *
Connection: close
Transfer-Encoding: chunked
Content-Type: application/json

29a
{
"error":false,
"apiversion":"2.0.0",
"year":2017,
"month":7,
"day":30,
"dayofweek":"Sunday",
"datechanged":false,
"lon":-5.671925,
"lat":54.634059,
"tz":1,

"sundata":[
            {"phen":"BC", "time":"04:44"},
            {"phen":"R", "time":"05:30"},
            {"phen":"U", "time":"13:29"},
            {"phen":"S", "time":"21:27"},
            {"phen":"EC", "time":"22:13"}],

"moondata":[
            {"phen":"S", "time":"00:08"},
            {"phen":"R", "time":"14:04"},
            {"phen":"U", "time":"19:22"}],

"nextmoondata":[
            {"phen":"S","time":"00:30"}],

"closestphase":{"phase":"First Quarter","date":"July 30, 2017","time":"16:23"}
}
0



more info here: viewtopic.php?f=25&t=16189

If all of the affected can email NAVOBSY_AA-Help <navobsy_aa-help.fct@navy.mil> and request them to fix there server it may speed things up.
Regards Simon

https://www.conligwx.org
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Home page taking about 60 seconds to load

Postby mcrossley » Tue Aug 01, 2017 4:23 pm

So, looking at your home page the data displayed is...

Sunrise: 05:34
Sunset: 21:24
Moonset: 00:55
Moonrise: 16:14
Waxing Gibbous
Waxing Gibbous, Moon at 9 days in cycle
69% Illuminated

Isn't all that available in the Cumulus web tags anyway - no need to add a dependency on a third party? So you could use a custom version of the get-USNO-sunmoon.php script that just parses the tags. I can see that the template may use an external source for either consistency, or for packages that do not provide the data.

I'm probably missing something though, Ken will have a reason for using the USNO data.

User avatar
saratogaWX
Posts: 835
Joined: Wed May 06, 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows XP SP3
Location: Saratoga, CA, USA
Contact:

Re: Home page taking about 60 seconds to load

Postby saratogaWX » Tue Aug 01, 2017 5:12 pm

When I first did the template set (for Weather-Display) back in 2008, it used the variables provided by WD for the astronomy events in the display.

As I added other weather software (with the V3 of the templates), some didn't provide any astronomical info (or provided a sparse set), so the get-USNO-sunmoon.php was added to support the moon phase info with a 'gold standard' data based solely on lat/long of the station. It provided an easy way to get that data (except in recent times with the instability of the api.usno.navy.mil service).

Over the years, various software have added the info to their weather tags, but I've not kept up to release {software}tags.php/{software}-defs.php to leverage that .. just a bit lazy, I guess.

Yes, Cumulus and CumulusMX do provide those data (now) and so I could release an update that doesn't require use of get-USNO-sunmoon.php for that info. I've also been exploring various native-PHP algorithms to provide that data by calculation, but... the accuracy is a bit off (several minutes on moon rise/set, inaccuracies in the percent illumination and moon phase). If I find one that matches the USNO data within 1 minute and illumination within 1 percent, I'd convert, but I've not found that yet.

The USNO issues started in the last couple of months, and it's very vexing to see the service so under-mananaged. I and others continue to provide 'heads-up' feedback to hostmaster @ navy.mil and webmaster @ usno.navy.mil to get it fixed. I've even done phone calls to them.

So, when the USNO server hangs up, the best approach for now is to rename get-USNO-sunmoon.php temporarily (and lose the moon rise/set info on the dashboard and wxastronomy page temporarily). I'll look at the various weather software packages to see current capbilities, and try to update the tags/defs files as appropriate to remove the dependency on the USNO web service). One caveat though, the weather software may not produce the same accuracy as the USNO does (when working) for the lunar ephemeris info.

User avatar
Toxic17
Posts: 543
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: Home page taking about 60 seconds to load

Postby Toxic17 » Tue Aug 01, 2017 9:38 pm

Thanks Ken for the detailed info you have supplied.
Regards Simon

https://www.conligwx.org
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Home page taking about 60 seconds to load

Postby mcrossley » Tue Aug 01, 2017 9:46 pm

saratogaWX wrote:I've also been exploring various native-PHP algorithms to provide that data by calculation, but... the accuracy is a bit off (several minutes on moon rise/set, inaccuracies in the percent illumination and moon phase). If I find one that matches the USNO data within 1 minute and illumination within 1 percent, I'd convert, but I've not found that yet.

Yep, it's strange but there seems to be a dearth of decent astro libraries available for PHP, all the ones I have looked at have used a limited number of terms - which was fine for the use I wanted (drawing graphics) - but none of complex versions available for Java/C/C++ etc. I rolled my own and borrowed bits for a javascript based app I wrote years ago.

User avatar
saratogaWX
Posts: 835
Joined: Wed May 06, 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows XP SP3
Location: Saratoga, CA, USA
Contact:

Re: Home page taking about 60 seconds to load

Postby saratogaWX » Tue Aug 01, 2017 11:42 pm

I've borrowed bits too from older scripts (JavaScript, basic, PHP) and also tried Jachym's scripts .. compared side-to-side with the USNO data, they all are not as accurate as the USNO, but the USNO doesn't publish it's algorithm/code for production.

I've even bought the Astronomical Algorithms book by Jean Meeus -- but, the math was not necessarily easy to reduce to computer code :(

I'd love to find a good library function for this.. it would decrease the dependency of the template for external data sources (and their sometimes-vagaries).

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Home page taking about 60 seconds to load

Postby mcrossley » Wed Aug 02, 2017 10:52 am

I coded Meeus up too - or the missing bits that I couldn't grab elsewhere, I also added in delta-T corrections the calcs came out within 1 minute of my standard sources - Skymap Pro and USNO.

Maybe I'll have a go at porting all that JS to PHP sometime. It ain't pretty though, some native JS, ported Java, and some "barely" converted BASIC!

Supercell
Posts: 16
Joined: Sat Oct 13, 2012 9:37 pm
Weather Station: Vue + B-L Sunrecorder
Operating System: Win7
Location: Dublin, Ireland

Re: Home page taking about 60 seconds to load

Postby Supercell » Thu Aug 03, 2017 8:02 am

Thanks Ken, speaking personally, being mainly interested in the weather, moon times off by a few minutes isn't something that would bother me really.
Image


Return to “Saratoga Templates”

Who is online

Users browsing this forum: Bing [Bot] and 5 guests