As you might (or might not) know, I’m the author of a tool called jSunnyReports.
It’s a fairly dumb tool. It:
- Loads cache files
- Reads new and changed inverterdata
- Parses everything
- Writes JSON
- Writes HTML
- Saves the cache
…and that’s it.
It’s not elegant. Probably not even clean code by modern standards. But I did spend a ridiculous amount of time on multithreading and optimization.
Why am I telling you this?
Because while trying to save my poor Intel 660p SSD from early death, I noticed something odd: JSR took 7.5 seconds per run to do its thing.
It runs every minute.
That’s 10% CPU time — for something so simple.
But then I remembered: I created the VM in a “conservative mood”.
Gave it 2GB RAM and just one virtual CPU.
Yes. One.
Spoiler: adding a second core dropped the runtime to 4.5 seconds.
That’s 40% faster — and nearly an hour of CPU time saved per day.
Network vs Ramdisk

First attempt: I created a ramdrive inside the VM, expecting it to reduce disk writes. Spoiler: it didn’t. Turns out I had forgotten that jSunnyReports was still writing all JSON and HTML output to /var/www/lumin8 — which wasn’t on the ramdisk.
Second attempt: I moved the /www directory to a ramdrive on the physical host, and mounted it inside the VM as an NFS share. That worked. Disk writes dropped to nearly zero.
But… it introduced continuous internal network traffic, as every file save triggered NFS communication with the host.
Third attempt was the charm. This evening I moved everything back to a local ramdisk inside the VM. Still zero disk writes — and now also zero network traffic.
Optimization complete. For now
Second CPU

The load before that huge bump was the baseline with a single virtual CPU.
The mountain in the middle? That’s me forgetting a symlink — triggering a full reload in jSunnyReports.
After fixing that, I shut down the VM, added a second virtual CPU, and brought it back up.
Optimization complete. For now.
Moral of the story?
Even though I have more than enough CPU power, memory, and network capacity — I love these kinds of tweaks and optimizations.
If I can uncover this much unnecessary load on my tiny home server, imagine the computing power and electricity we could save if we all spent just a little more time optimizing our platforms and code.
Just because it works, doesn’t mean it’s efficient.
And… Even dumb tools deserve good hardware. 🙂
Brain out!