X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=src%2F_posts%2F2016-02-10-light-in-realraum-is-now-faster.html;fp=src%2F_posts%2F2016-02-10-light-in-realraum-is-now-faster.html;h=0000000000000000000000000000000000000000;hb=afbb02fc33e2a7afc03c52d3293778510394b57e;hp=2f9b9ec221a8b4e315b9199f94f53b8817322dac;hpb=8828a2e98fffe3a3e952d1841bbc0579710a269c;p=homepage.git diff --git a/src/_posts/2016-02-10-light-in-realraum-is-now-faster.html b/src/_posts/2016-02-10-light-in-realraum-is-now-faster.html deleted file mode 100644 index 2f9b9ec..0000000 --- a/src/_posts/2016-02-10-light-in-realraum-is-now-faster.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -layout: post -status: publish -published: true -title: Light in realraum is now faster -author: - display_name: xro - login: xro - email: xro@realraum.at - url: '' -author_login: xro -author_email: xro@realraum.at -wordpress_id: 474 -wordpress_url: http://wp.realraum.at/?p=474 -date: '2016-02-10 06:28:54 -0600' -date_gmt: '2016-02-10 05:28:54 -0600' -categories: -- Projekte -- english -tags: [] -comments: [] ---- -

licht.realraum.at, went FTLw today. That is... it became much Faster Than Last week. :-)

-

Since the Raspbian image upgrade and move to a bigger (but slower) SDcard, licht.realraum.at had become truly sluggish. To the point that pressing a button to turn on the light or change the stereo volume could take up to 6 seconds until something happened. (Obviously we disabled the swap-file long ago.)

-

The problem was quickly identified. Processes don't load quickly enough.
-The fact that the whole systems was a dunghill of bashscript cgi-scripts and python helper scripts also did not help. At all.

-

First attempt to rectify this: rewrite the python helper rf433ctl.py. Formerly it was a simple script that would be called by the cgi-script and send the appropriate bytes down to the teensy.
-Each call to it, however now took forever. So. I rewrote it as a daemon that would constantly stay in memory and be nudged by other instances of it via RPC. The idea being, if it's already completely in memory, loading a second instance should be faster. Right? Wrong!. Unfortunately that did not work out at all.

-

Second attempt to rectify this: Remove the kiosk functionality and thus memory-hog midori from licht. Thankfully a very nice person gifted us a RaspberryPi per (almost) anonymous letter, so we had the necessary hardware on-hand to split the functionality onto two separate boxes: licht.realraum.at and smallkiosk.realraum.at
-Unfortunately, even freeing up 60% of memory did not even put a dent into the problem.

-

So.. third and last attempt. Hit it with go ;-> In a 3 hour session, I rewrote the whole dunghill as a monolithic golang daemon/webserver/tty-handler which, once loaded, always stays in memory. Then I got rid of lighthttpd and the python scripts. Result... Speedup from 6s to <=0.05s !!

-

Should have done this right away really...