Author Topic: CPU overusage.  (Read 1171 times)

0 Members and 1 Guest are viewing this topic.

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1019
    • Southern Maryland Weather
CPU overusage.
« on: January 14, 2017, 01:28:39 PM »
Hello All,
  I am hoping some of you PHP/AJAX gurus can assist me with this issue.

I am using the AJAX script to update my main website page with the latest data from my VWS files.

I received a notice the other day when we got nailed with a big snowstorm here in So. MD that my site had gone WAYYYYYYYYYYYYYYY over my CPU limit (100 minutes/day)  for the day. They restricted my site to just 5 simultaneous processes.

I was told that 2 PHP scripts were the cause of the issue.

I modified one of those to use static data that VWS creates..

The one which contains the live update is still running...

Is there something I am missing here with the script that would cause such over usage?

Thanks!

Jim

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9280
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: CPU overusage.
« Reply #1 on: January 14, 2017, 02:00:28 PM »
Hi Jim,
I'm a bit confused.  AJAX (JavaScript) runs in a browser and just reads a file from the site (and shouldn't cause a 'CPU Overload').

Do you have a script that is invoked by VWS to push the current conditions to the website (via a GET-mode URL) like the WeatherFlash update script?  Is that the script causing the issue?

It would help if you posted the (expurgated of user:pass info) code of the script(s) that seemed to be causing the issue, along with how they are invoked (by the website page or cron or VWS)

Best regards,
Ken
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 SoMDWx

  • Forecaster
  • *****
  • Posts: 1019
    • Southern Maryland Weather
Re: CPU overusage.
« Reply #2 on: January 14, 2017, 02:45:49 PM »
Ken,

The file is a PHP files which invokes the ajaxVWSwxs.js.  I can send both files to you if you wish.

Jim
« Last Edit: January 14, 2017, 02:48:26 PM by SoMDWx »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9280
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: CPU overusage.
« Reply #3 on: January 14, 2017, 03:19:00 PM »
Ken,

The file is a PHP files which invokes the ajaxVWSwxs.js.  I can send both files to you if you wish.

Jim
Sure... you can attach them in a PM or email to webmaster at saratoga-weather.org
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 SoMDWx

  • Forecaster
  • *****
  • Posts: 1019
    • Southern Maryland Weather
Re: CPU overusage.
« Reply #4 on: January 14, 2017, 03:33:51 PM »
email sent.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9280
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: CPU overusage.
« Reply #5 on: January 14, 2017, 05:29:52 PM »
Gotit.. fixed one script for you.. see email.

Problem was a script was accessing an external website each time it was loaded.. that can cause backups as multiple outbound connections for the same data can be generated.  Changed the script to use caching and auto-refresh at 1800 seconds for the result. 

Best regards,
Ken
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 SoMDWx

  • Forecaster
  • *****
  • Posts: 1019
    • Southern Maryland Weather
Re: CPU overusage.
« Reply #6 on: January 14, 2017, 08:37:57 PM »
Thanks so much!  Will be watching resource numbers over the next several days to gauge...

Jim