Bug related to APC, solved

indigoe
Posts: 3
Joined: Sun Mar 04, 2012 10:51 pm

Bug related to APC, solved

Postby indigoe » Sun Mar 04, 2012 11:27 pm

It appears that loading the database into memory will fail silently if there is not enough room left in APC cache.

This resulted in a lot of "There is no device with id [generic] in wurfl" errors and was a bit tricky to track down.

The default cache size is 32MB set by apc.shm_size in php.ini. Increasing this to 64MB minimum will solve the problem. I recommend mentioning this somewhere in the documentation.

I updated the save() function in Storage/Apc.php

Code: Select all

    public function save($objectId, $object) {
        $value = apc_store($this->encode($this->apcNameSpace(), $objectId), $object, $this->expire());
        if ($value === false)
        {
        	throw new WURFL_Xml_PersistenceProvider_Exception ("Error saving variable in apc cache. Cache may be full.");
        }
    }

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: Bug related to APC, solved

Postby kamermans » Sun Mar 04, 2012 11:37 pm

Thanks for the info - we will include a warning about using volatile storage as a persistence mechanism in the documentation, and give a recommended cache size!
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!


Who is online

Users browsing this forum: No registered users and 8 guests