Author Topic: WC background workload  (Read 5209 times)

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Re: WC background workload
« Reply #15 on: October 04, 2015, 10:27:26 AM »
Finally, MenuMeters is pretty good - http://www.ragingmenace.com/software/menumeters/ - everything here runs these (doesn't run on 10.11 however, possibly due to system integrity protection?).

I have done the workaround described here and it works for me!

Cheers,
Reinhard

Superb!

xairbusdriver

  • Storm
  • *****
  • Posts: 3128
Re: WC background workload
« Reply #16 on: October 11, 2015, 03:48:51 AM »
Found a something interesting after updating WC! While I was not seeing any errors on my site, I decided to see how things were going with Console. What greeted me, limited to WC messages, was about 50% error messages! :o

Things were scrolling by so fast I could barely grab fewer than 100 lines! I pasted them into a TextEdit window so I could keep from getting dizzy! [rolleyes2] What I saw was WC trying to access files from an incorrect directory!

After several attempts to correct things, mainly by changing the Custom Web -> Set HTML Source, did nothing to help. Console was still reporting that WC was looking at the wrong directory. I finally Quit WC, changed its plist name, and restarted.

The great news is that WC still knew about my Custom Gauges and Graphs! [cheer] Obviously, that info is stored elsewhere. Unfortunately, Console indicated that this had made absolutely no improvement in the error logging! [banghead]

By now I knew WC was not deciding, on its own, where to look for the files it wanted to modify/upload/use. I knew this because I had completely eliminated the directory that Console was reporting that WC was attempting to use! I had decided to "clean up" the paths on the drive by eliminating nearly duplicate folders. That's why I knew WC must have stored the path somewhere. You've all probably guessed where I had screwed up...

I finally figured out that I had failed (again?!) to realize what all the Preferences tabs were recording. When I finally looked at the Additional Files list, I could see that the incorrect path was still in those settings! No need to rename/move the plist, all I needed to do was edit the six files in the Additional Files list! DUH!! [rolleyes2] [computer]

All those ererz were caused by my own "house cleaning"!

Just as importantly to fixing this mistake, I also found that WC was wasting lots of cpu cycles and electrons by uploading some 30+ png's!

On my 'web cam' page, I also display two random images from a group stored on the server. But they are 'static' images, I may add/change them occasionally, but they don't need to be uploaded every two minutes! Apparently, WC looks at everything in the directory set in the "...HTML Source" pref. I have now removed those images and several php and html files that don't need updating regularly. This will, hopefully, very much lighten the workload on WC as well as drastically cut the bandwidth needed to update the site. How do I apologize to software for over-working it?! [lol] :P :( :-\
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

Randall75

  • Storm
  • *****
  • Posts: 1332
  • CWOP-CW6734 WeatherUnderground-KOHNEWAR6
    • CW6734
    • KOHNEWAR6
    • Randy's Weather On The Hill
  • Station Details: Davis Vantage Pro 2 Plus.iMac i5 OS High Sierra 10.13.6 8GB Ram, WeatherCat 3,Logitech 9000 Pro Web Cam
Re: WC background workload
« Reply #17 on: October 11, 2015, 12:32:11 PM »
Hi xairbusdriver
 Any time you trash a plist you must all so restart your computer it is still in cache and won't change if you don't restart your machine


cheer


 [cheers1]



xairbusdriver

  • Storm
  • *****
  • Posts: 3128
Re: WC background workload
« Reply #18 on: October 11, 2015, 02:23:10 PM »
Well, I seldom "trash" any file for testing purposes. Who wants to use something that's been in the trash?! :o Simply renaming it suffices. And it's easier to see the new one created if you just change the end of the name a bit; the new one will usually show up right next to the old one.

However, I agree with your analysis, even though that was not a problem in this case. The plist was fine, I just was too slow in spotting what needed to be changed... a much too frequent problem in my life! [banghead] I couldn't see the trees for the forest! [blush]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

xairbusdriver

  • Storm
  • *****
  • Posts: 3128
Re: WC background workload
« Reply #19 on: October 11, 2015, 10:12:34 PM »
While observing WC in Console for another purpose, I noticed that it was still uploading html files that are basically static. While they have images (gauges, graphs, and movie) in them, the html/php never changes. It's a small but needles waste of cpu cycles and electron movements. It probably makes less than .0001 mico-seconds difference to WC, but I need all the efficiency I can get due to other misteakes eye maik! [banghead]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Best to avoid uploading static files (Re: WC background workload)
« Reply #20 on: October 11, 2015, 10:37:09 PM »
Dear X-Air and WeatherCat web spinners,

While observing WC in Console for another purpose, I noticed that it was still uploading html files that are basically static. While they have images (gauges, graphs, and movie) in them, the html/php never changes. It's a small but needles waste of cpu cycles and electron movements. It probably makes less than .0001 mico-seconds difference to WC, but I need all the efficiency I can get due to other misteakes eye maik! [banghead]

You are correct that the load on your Mac is no problem.  However, uploading the same files over and over eventually lead to a lot of uploaded data.  Some web hosting providers have limited on the amount of data you can upload and in the old days even ISPs had such limits.

That is one of the best reasons to have a web template that dynamically updates instrument data instead of depending on uploading.  My website is being uploaded far more often than really makes sense.  That's why I want to also switch to some sort of Custom CGI setup on my web template like high-performance templates are doing.  Oh well, perhaps if we get a really strong El Nin? I'll be stuck in the house long enough to take that project on.

Cheers, Edouard

xairbusdriver

  • Storm
  • *****
  • Posts: 3128
Re: WC background workload
« Reply #21 on: October 12, 2015, 10:51:29 PM »
Quote
uploading the same files over and over eventually lead to a lot of uploaded data.
In order to help Stu track down a minor "logged" error in Console, I edited out the file that I had created to get my Gauges created. The file is cleverly named "upload-gauges.html". It's a page that is not designed to ever be displayed, just an html file (could just as well be .txt. .php, etc.) containing the WC 'tags' for each gauge and 'encourages' WC to create and upload those images. I have similar files for the custom graphs and the movie. While my pages are already rather small since there are several embedded php scripts that insert html when the browser requests the page, I simply wanted to reduce the workload on WC by not uploading ("over and over") 2,000 characters when 200 would suffice.

By commenting out the html lines for half the gauges, I was attempting to stop WC from creating them. I even created/uploaded 'broken' images for the server so the browser didn't just display the normal 'broken' image icon.

I refreshed the 'gauges' page and reveled in seeing the 'broken' gauges. Much to my surprise, the next time WC updated things, I see that the actual gauges are back! Why? I double-checked the uploaded version of the "upload-gauges.html" file to confirm that the commented out line were still there. I had even 'crippled' the lines by changing the format/spelling of the tags I was trying to block.

Doing a multi-file search with BBEdit resulted in a new (for me) discovery! WC comes with a folder called "WeatherCat_all_tags" file. Inside the folder is an html file called "index". It has not been uploaded, fortunately, my "index.html" file is still on the server. I have thought this was simply a method of displaying the "WeatherCat Tags" list as a table.I don't believe this html file has anything to do with my question. The next paragraph seems to confirm that.

I have moved that folder out of the one that WC uses to access the "Additional Files" list. However, the images are still being created and placed in ~/Library/Application Support/WeatherCatCustomWeb, thus, they are uploaded to my server.

My question: How do I stop these gauges from being created without deleting them from my Tools->Custom Gauges area. I assume their details are in the <key>windowPositions1|2|3|4|5</key> dictionary, at least the ones with variations of the <string>276 182 177 122 0 0 1280 777 </string> entries. OTOH, those entries all have the same "122 0 0 1280 777" values, and the "177" is either that value or "377". [banghead]

The whole point of this exercise is to change the actions of WC to see how that change might affect the minor "logged" error.
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

xairbusdriver

  • Storm
  • *****
  • Posts: 3128
Re: WC background workload
« Reply #22 on: October 13, 2015, 10:04:51 PM »
I think I've discovered where the second upload of custom gauges was happening... sort of.

The partial "...HTML Source" setting in WC prefs is /WeatherCat 2.2/Web Templates/Mid-South. In that directory, until an hour ago were 7 files. 6 were files that needed updating constantly and they were all in the "Additional Files" list. However, there was a renamed file that was a copy of the gauges upload file; it was named "upload-gauges-original.html". The file it was a copy of had the last 6 WC gauge tags commented out. That, I thought would prevent those gauges from even being created, much less uploaded. I was wrong... again. [banghead]

As part of my investigation, I moved that duplicate, but renamed html file out of that path. WC promptly 'forgot' about it! The edited file, with the commented out tags, was now the only "gauges" used by WC, and it created/uploaded only the correct ones! [cheer]

Now for the kicker! After confirming this extra file was being used when I didn't want it, and not seeing any change in the "logged error" I was trying to figure out, I put that renamed, full of 15 WC gauge tags back into folder with the other 6 files. So far, WC has still ignored that file and is creating/uploading only the gauges in the file in the "Additional Files" list.

This behavior is exactly what I think should happen. But the question remains as to why WC continued to use a file that had not been specified in the "Additional Files" list, in the first place. [banghead] It appears that WC does not use the actual name of the file but a System (Unix) supplied code/number/identifier, instead. Even though I changed the name of the file, I made no other changes to it, nor did I delete the file with the original name from the "Additional Files" list. After I completely removed the file, WC could no longer 'see' it and was forced to re-inspect/re-build the list of files as set in the Prefs.

The conclusions above are strictly my own, and will probably be useless to anyone else, of course. [goofy] [runoff]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Need Stu's input (Re: WC background workload)
« Reply #23 on: October 13, 2015, 10:49:16 PM »
Dear X-Air and WeatherCat troubleshooters,

I definitely don't understand what you are observing there.  I guess we'll have to wait for Stu to take a look and see if he can figure this one out.

Edouard

xairbusdriver

  • Storm
  • *****
  • Posts: 3128
Re: WC background workload
« Reply #24 on: October 13, 2015, 11:26:16 PM »
Have also discovered that files in the "Set HTML Source" path were what was causing me to see 'plain FTP' entries in Console. I mentioned removing a file from that path above. Since that time (~1:30pm), there have been only "Aux. FTP" entries in Console. Absolutely all the 'plain FTP' entries are before that time.

Apparently, WC uses the 'plain FTP' method with files in that path that are not specified in the "Additional Files" list. Any files in that list use the "Aux. FTP" method. At least, that's what I'm seeing here. If that's the case, at least I now have cut way back on the uploading needs. ;D
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system