Yesterday’s post was about web server performance. Here’s the latest build of JeeMon with the same page:
That’s nearly 17 seconds to render the page now, versus 5 yesterday… whoops!
Here’s why I call this major progress anyway:
- The “electricity.html” page no longer contains plot data values and is half its previous size.
- All plot values are obtained via Ajax calls, running (mostly) in parallel.
- This opens up the path to unobtrusive refreshes and automatic plot updates.
- All plots now contain meaningful data, the previous version used some bogus values.
As you can see in the above graph, over 15 seconds is spent in waiting for the server to return all plot data.
And the reason this now takes so long is very simple: all values are calculated on-the-fly by the server from stored 5-minute values. That’s over 100,000 aggregated values to generate a simple 52-week bar graph!
All this should sort itself out once I start caching hourly and daily results in the database. For now, only the raw readings and the 5-minute aggregated counts get stored. The finecky bit is to make all aggregations / calculations consistent across arbitrary JeeMon restarts.
Here’s the latest version of the generated page: