Author Topic: Cron Job help  (Read 1364 times)

0 Members and 1 Guest are viewing this topic.

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 440
    • Penn Lake Weather
Cron Job help
« on: September 26, 2017, 08:06:22 AM »
Recently change, server - providers, but noticed a lag time when accessing my site --- so after trying to figure out what was going on, I now believe the cron job is the problem.

pennlake.us
PHP 7.1

So here is the Cron job in my c-panel     ---    The service provider set this up for me.

Current Cron Jobs

Minute   Hour   Day   Month   Weekday   Command   Actions
*/5   *   *   *   *   php /home/hogan2/pennlake.us/nws-alerts.php >/dev/null 2>&1    Edit      Delete
Home
Trademarks
Documentation
cPanel, Inc.  66.0.23


Here is the result from running  ---  http://www.pennlake.us/cache/nws-notes.txt

It looks to me like eventually it gets the information but after all the errors it takes  21 seconds to load???
I guess my question - code problem or server problem???


Script characteristics on last page load:
Last update: Tue 09-26-2017 06:45 EDT
nws-alerts.php - V1.41 - 07-Mar-2017
Cron job enabled
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ047
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC079
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ047
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC079
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ054

6:45:01
Error: Operation timed out after 2001 milliseconds with 0 bytes received
Source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC025
First attempt in getting preliminary URL failed
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC025
Second attempt successful


6:45:05
Error: Operation timed out after 2001 milliseconds with 0 bytes received
Source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ053
First attempt in getting preliminary URL failed
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ053
Second attempt successful

XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC037
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ044

6:45:09
Error: Operation timed out after 2000 milliseconds with 0 bytes received
Source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC069
First attempt in getting preliminary URL failed

6:45:12
Error: Operation timed out after 2001 milliseconds with 0 bytes received
Source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC069
Second attempt failed & skipped

XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ055
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC089

6:45:16
Error: Operation timed out after 2001 milliseconds with 0 bytes received
Source: https://alerts.weather.gov/cap/wwaatmget.php?x=NYZ038
First attempt in getting preliminary URL failed
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=NYZ038
Second attempt successful

XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=NYC043
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ058
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC107
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ042
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC113
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ043
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC131
Cache file updated: Tue 09-26-2017 6:45 am
Alert box data file updated
Icon data file updated
Alert logging enabled
Total process time: 21.5386 seconds

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 440
    • Penn Lake Weather
Re: Cron Job help
« Reply #1 on: September 26, 2017, 08:11:35 AM »
So after several tries running http://www.pennlake.us/cache/nws-notes.txt

So NWS problem, my code or my provider???

Thanks for any help.

Script characteristics on last page load:
Last update: Tue 09-26-2017 08:05 EDT
nws-alerts.php - V1.41 - 07-Mar-2017
Cron job enabled
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ047
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC079
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ047
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC079
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ054
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC025
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ053
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC037
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ044
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC069
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ055
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC089
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=NYZ038
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=NYC043
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ058
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC107
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ042
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC113
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ043
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC131
Cache file updated: Tue 09-26-2017 8:05 am
Alert box data file updated
Icon data file updated
Alert logging enabled
Total process time: 32.2650 seconds

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1825
    • Maumelle Weather
Re: Cron Job help
« Reply #2 on: September 26, 2017, 08:39:49 AM »
I have 4 Zones I update every 5 minutes. Process times run anywhere from 1.5 to 8 seconds on the CRON job for it. Your times look about right for the 20 Zones you are updating, and this will vary greatly based on NWS load, etc.

Hope this helps,


John
GR2AE, GR3, Cumulus

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 440
    • Penn Lake Weather
Re: Cron Job help
« Reply #3 on: September 26, 2017, 09:46:54 AM »
Thanks for the reply John!

Do you know if that many Timeout Errors are normal?

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 440
    • Penn Lake Weather
Re: Cron Job help
« Reply #4 on: September 26, 2017, 09:54:23 AM »
Hey John -- Your comment about 20 locations just made me aware of this:  -- i rally only have 10 places but like 20 listing, but ..... Each listing has to codes is that right???

example: This is the same place -- one is a PAZ and the other a PAC  -- Am I suppose to have 2???
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAZ043
XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=PAC131

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1825
    • Maumelle Weather
Re: Cron Job help
« Reply #5 on: September 26, 2017, 10:02:55 AM »
The XML listing is most likely correct. If the script does not find a county listing, it will default to the Zone listing, I believe. Curly and/or Ken can explain this. Also, the time out errors can be either the script itself timing out, or the CRON job itself is timing out.

I actually use a paid CRON service for my CRONS (costs me $20/yr). My website provider only allows 3 CRONS, to be run every 15 minutes, which is far too slow for NWS Alerts, especially during severe weather. My normal NWS Alerts Crons run at 5 minute intervals. When there is severe weather in the state, I have a separate cron I activate to run every 2 minutes, which is as fast the NWS updates their ATOM service.
GR2AE, GR3, Cumulus