Upgrading RRD upgrade from 2.0 causes Out of Memory on 128MB embedded systems
|Affected version:||2.1||Affected Architecture:|
It turns out that the current upgrade code when coming from a 2.0 config (version 8.0) will cause the RRD upgrade to run in the 080_081 step. This causes the restore page to throw a internal server error because PHP goes out of memory on a 128MB system. Navigate to the upgrade page again and the system reboots with the 2.0 config still in place.
On next boot the config will be upgraded from 2.0 and it performs the RRD ugprade in the 1st step. This causes PHP to get killed with a Out of Memory condition (OOM). This has the rather nasty side effect of killing boot and thus a system without interfaces dead in the water.
My proposal is to put this RRD modification code into atleast a seperate upgrade script to prevent a OOM and effectively kill the system.
Another huge drawback of using PHP to upgrade the RRD files currently is that it is dog slow to perform this on a Alix, which can easily take 20 minutes, regardless of the memory issue.
I've also confirmed with a bare config that a 128MB system can barely boot safely. With a 128MB install and no swap it succeeds, lower this to a 120MB and it already fails to start everything at boot with a OOM. Bring it down to a 100 and it fails to boot for the better part and does not bring up all interfaces correctly.
Ideally we would have a seperate program to convert the RRD files in another language from PHP for speed and memory usage.
Install Plan B for upgrading the RRD files to the newer format to add IPv6 fields.
We now perform a search and replace on the XML contents to add fields instead of reading the XML into a PHP array.
A conversion with a 2.0 config on a 128MB VM without swap is succesful, needs more testing.