- Posts: 7
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Is APCu supported?
- zfocuz
- Topic Author
- Offline
- New Member
I've tried to activate it on my development server by changing line 146 in
to/application/config/internal.php
'class' => defined('YII_DEBUG') && YII_DEBUG ? 'system.caching.CDummyCache' : 'CApcCache',
I also changed line 32 in
to/framework/caching/CApcCache.php
public $useApcu=true;
After testing I've found some significant changes in LimeSurvey's performance both bad and good. The following things changed:
- The pagination on /admin/survey/sa/listsurveys is much faster. Loading a next page used to took a few seconds now it's almost instant
- Loading any admin page will take longer but revisiting these pages is much faster
- Visiting and navigating a survey (frontend) is so much faster its unbelievable!
- Visiting a survey through the admin pages (backend) takes longer and seems to not use caching at all(?)
I've used APCu INFO to test the usage of APCu and it seems to be working for most of the pages. Some admin pages (like the viewing of a survey) only generate misses and are actualy slower but overall performance is increased. Some admin pages also seem to clear the memory (maybe by overloading?) but I've not been able to prove this.
I was wondering why there is no official documentation on caching and why there are no caching settings in LimeSurvey? LimeSurvey is resource hungry and spends a lot of time doing I/O, so caching using memory should be a welcome feature. Is this an officialy supported caching mechanic or are there some significant downsides I've not yet discovered?
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13910
- Thank you received: 2546
Else : NEVER update an included file : you can do in your config.php file (if it's broke : report the bug).
manual.limesurvey.org/Optional_settings#Yii_settings
And we always happy to have more help for update our manual: please help us …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
- zfocuz
- Topic Author
- Offline
- New Member
- Posts: 7
- Thank you received: 0
return array( 'components' => array( 'db' => array(), 'cache'=>array( 'class' => 'CApcCache', 'useApcu' => true ), ) )
But as I understand from your comment LimeSurvey still uses some other caching mechanics (like file caching inside the /tmp folder)?
Is it safe to use APCu or other Yii caching mechanics to speed up certain parts of LimeSurvey? I've done some tests and everything seems to work fine.
Also do you have any clue as to why switching to APCu caching seems to decrease loading time for survey pages in the backend (e.g. /admin/survey/sa/view/surveyid/123456)? Are these pages cached? or is there some check that takes a long time?
I think this is important information as caching could significantly increase LimeSurvey's speed and stability in certain situations. I might write something for the documentation when I find out exactly how this works.
- zfocuz
- Topic Author
- Offline
- New Member
- Posts: 7
- Thank you received: 0
Visiting an survey page in the backend (e.g. /admin/survey/sa/view/surveyid/123456) directly by typing the url into the browsers address bar is much faster than accessing it trough the overview page (/admin/survey/sa/listsurveys). I'm not sure if this has anything to do with caching or if this might be related to a bug. Can someone tell me if there is a difference in the processing of the page depending on how you access it? or can someone direct me into the direction of the script involved?
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13910
- Thank you received: 2546
But in Yii : you need to ask to use cache. And if i remind : we use it only for DB Caching actually.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
- zfocuz
- Topic Author
- Offline
- New Member
- Posts: 7
- Thank you received: 0
Not really sure what you are pointing at? Regarding if it is safe to use APCu caching and LimeSurvey or if you have any clue as to why APCu caching might speed up certain parts of the admin pages but not the admin survey page?DenisChenu wrote: About LS and caching, not really.
Is this what the /tmp folder is all about? These are pre-generated survey templates right?DenisChenu wrote: We have some project to use caching for survey generation (expression manager take a lot of time and need caching).
Is there a global setting that dictates what kind of caching we do? Atm my LimeSurvey is using huge amounts of I/O time and caching to APCu instead of the database might be usefull if at all possible.DenisChenu wrote: But in Yii : you need to ask to use cache. And if i remind : we use it only for DB Caching actually.
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13910
- Thank you received: 2546
It's safe to use any of cache system you want, but cache are not used a lot in LimeSurvey.zfocuz wrote:
Not really sure what you are pointing at? Regarding if it is safe to use APCu caching and LimeSurvey or if you have any clue as to why APCu caching might speed up certain parts of the admin pages but not the admin survey page?DenisChenu wrote: About LS and caching, not really.
pre-generated survey templates is another system , and tmp folder is just here for old system compatibility. It's not really caching.zfocuz wrote:
Is this what the /tmp folder is all about? These are pre-generated survey templates right?DenisChenu wrote: We have some project to use caching for survey generation (expression manager take a lot of time and need caching).
No, except the one you already update.zfocuz wrote:
Is there a global setting that dictates what kind of caching we do? Atm my LimeSurvey is using huge amounts of I/O time and caching to APCu instead of the database might be usefull if at all possible.DenisChenu wrote: But in Yii : you need to ask to use cache. And if i remind : we use it only for DB Caching actually.
In fact there are some part where i think we must use cache : inside github.com/LimeSurvey/LimeSurvey/blob/9b...mon_helper.php#L1780 for example. We DO each times a big part for a lot of user, we must improve this by doing some part in cache. But here need dev
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
- zfocuz
- Topic Author
- Offline
- New Member
- Posts: 7
- Thank you received: 0
I see some performance improvements but the amount of data cached is really small indeed.
It would indeed be nice to have caching on some of these heavy scripts that slow LimeSurvey down. It would make it easier to host LimeSurvey on shared hosting platforms without running into problems (mainly I/O and CPU) with big surveys.
I guess this is on the feature request list already, not sure if it has any priority.
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13910
- Thank you received: 2546
Or better : new pull request
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.