Caching with Memcache taking time

rediff
Posts: 3
Joined: Fri Jan 18, 2013 6:35 am

Caching with Memcache taking time

Postby rediff » Fri Jan 18, 2013 6:42 am

Hi,

I am trying to setup WURFL API v1.4.4 and when chose caching as memcache it is taking much time to respond but this issue was not seen when file was chosen as caching.

Useragent queried: Mozilla/5.0 (Linux; U; Android 2.3.4; en-gb; GT-S5830 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
$wurflConfig->cache('memcache', array('host' => "127.0.0.1",'port'=>'11211','namespace'=>'wurfl','expiration' => 36000));
Calls made to memcache
[Fri Jan 18 17:04:10 2013] [error] [client xx.xx.xx.xx] WURFL_:wurfl:UserAgentHandlerChain
[Fri Jan 18 17:04:10 2013] [error] [client xx.xx.xx.xx] WURFL_:wurfl:FCACHE_WURFL_WURFL_LOADED
[Fri Jan 18 17:04:32 2013] [error] [client xx.xx.xx.xx] WURFL_:wurfl:FCACHE_generic
[Fri Jan 18 17:04:32 2013] [error] [client xx.xx.xx.xx] WURFL_:wurfl:FCACHE_WURFL_LAST_MODIFICATION_TIME
[Fri Jan 18 17:04:32 2013] [error] [client xx.xx.xx.xx] WURFL_:wurfl:FCACHE_WURFL_XML_INFO
[Fri Jan 18 17:04:32 2013] [error] [client xx.xx.xx.xx] WURFL_:wurfl:f8fa37d97aa8866fb092964065242ed7
[Fri Jan 18 17:04:32 2013] [error] [client xx.xx.xx.xx] WURFL_:wurfl:DEV_samsung_gt_s5830_ver1_suban23

As you can see it is taking 22seconds between FCACHE_WURFL_WURFL_LOADED and FCACHE_generic

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

Re: Caching with Memcache taking time

Postby kamermans » Fri Jan 18, 2013 10:16 am

Does this happen on every request, or just the first request? Also, are you on linux, and which versions of PHP and Memcache are you running, and how much Memcache memory is available? Are you using File for persistence and Memcache for cache?
Thanks,

Steve Kamerman
ScientiaMobile

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

rediff
Posts: 3
Joined: Fri Jan 18, 2013 6:35 am

Re: Caching with Memcache taking time

Postby rediff » Sat Jan 19, 2013 12:53 am

Yes am installing on Linux with PHP 5.2.13. with file for persistence and memcache for cache.

Memcache memory in my development environment is set to 250MB which I increased to 1024MB and this issue is resolved.

What is the memory size we need to set so that we will not encounter issue like this in future?

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

Re: Caching with Memcache taking time

Postby kamermans » Sat Jan 19, 2013 10:20 pm

Thanks for the reply. I imagine the issue is that your cache is also being used by other systems and other data is forcing WURFL data out of memcache while it's being loaded or something similar. Technically, this should not be a problem since all the cache lookups will be misses (obviously not ideal), then the requests will go to the filesystem. I'll need to try to reproduce the problem with different amounts of memcache memory to be sure, but I imagine 50MB would store all the WURFL devices with plenty of room for cache requests. Note that we will be adding a feature in the next minor release to allow to specify which WURFL capabilities are loaded. If you choose to load only those capabilities that you need, the memory usage can be significantly decreased.
Thanks,

Steve Kamerman
ScientiaMobile

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

rediff
Posts: 3
Joined: Fri Jan 18, 2013 6:35 am

Re: Caching with Memcache taking time

Postby rediff » Sat Jan 19, 2013 11:03 pm

Memcache is not used for any other applications and also it was restarted before the testing. I will also try and simulate the same again.

Also we are just using 5 capabilities and would love to have that update sooner so that it will not unnecessarily use up memory.

We will be using membase/couchbase for our production environment and we have created a bucket of 4GB to be on safer side.

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

Re: Caching with Memcache taking time

Postby kamermans » Sun Jan 20, 2013 8:48 pm

The capability filter has not yet been ported to this API, but I can send you the pre-release including the filter later this week if you'd like.
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 1 guest