- Posts: 6
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to enable memcached
- SvenFlock
- Topic Author
- Offline
- New Member
I found the following information at the setup guide that it is possible to enable memcached for LimeSurvey:
LimeSurvey uses the Yii file cache by default, but it can be configured to use other cache engines. Possible other caches are:
Memcached
Redis
WinCache
XCache
Please see the Yii documentation for full description.
I have fully installed and configured memcached on my server. However, I do not find any details in the documentation how to use that cache in LimeSurvey.
Can you tell me how to switch from Yii to memcached?
Thanks
- Joffm
- Offline
- LimeSurvey Community Team
- Posts: 12888
- Thank you received: 3965
www.yiiframework.com/doc/guide/2.0/en/caching-data
In LimeSurvey have a look at "framework/caching/CMemCache.php" and of course "config.php".
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
- jelo
- Offline
- Platinum Member
- Posts: 5033
- Thank you received: 1257
www.yiiframework.com/doc/guide/1.1/en/
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
- SvenFlock
- Topic Author
- Offline
- New Member
- Posts: 6
- Thank you received: 1
didn't know that is is part of the Yii. I have never worked with it before and I am not a PHP coder.
I looked at the CMemCache.php file and set
public $useMemcached=true;
However, I do not know where to set the servers.
www.yiiframework.com/doc/api/1.1/CMemCache shows an array definition. But I don't know where to insert it. On first look, it doesn't look like PHP syntax.
A few lines lower, there is some fallback if no servers have been found that it will use localost:
$cache->addServer('localhost',11211);
As grep tells me that memcached is running on that port
root 21918 0.0 0.0 12712 928 pts/1 S+ 08:43 0:00 grep memcached
memcache 22441 0.0 0.0 348996 15408 ? Ssl Feb02 0:20 /usr/bin/memcached -m 512 -p 11211 -u memcache -l 127.0.0.1
I can assume that is now working?
Is there a log or an endpoint to check if the config works and memcached is currently used?
- Joffm
- Offline
- LimeSurvey Community Team
- Posts: 12888
- Thank you received: 3965
IMO you have to add this to your config.php.To use CMemCache as the cache application component, configure the application as follows,
Otherwise your hardcoded setting in CMemCache.php will be overwritten with each update.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13597
- Thank you received: 2487
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.
- SvenFlock
- Topic Author
- Offline
- New Member
- Posts: 6
- Thank you received: 1
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13597
- Thank you received: 2487
YOU must setup memcached before,SvenFlock wrote: So I just copy the array definition the config.php at any place?
github.com/memcached/memcached/wiki/TutorialCachingStory
But here : it's not LimeSurvey related question …
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.
- jelo
- Offline
- Platinum Member
- Posts: 5033
- Thank you received: 1257
Did you read the starting post?DenisChenu wrote: YOU must setup memcached before,
github.com/memcached/memcached/wiki/TutorialCachingStory
I have fully installed and configured memcached on my server.
Many users stumble when the configfiles have arrays.
The question is where and how to place the memcached settings array inside config.php
* array( * 'components'=>array( * 'cache'=>array( * 'class'=>'CMemCache', * 'servers'=>array( * array( * 'host'=>'server1', * 'port'=>11211, * 'weight'=>60, * ), * array( * 'host'=>'server2', * 'port'=>11211, * 'weight'=>40, * ), * ), * ), * ), * )
To reframe the question: Can anybody provide a LimeSurvey config.php example where memcached is used via Yii?
I don't use memcached, so I won't feel qualified to provide a tested working example.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13597
- Thank you received: 2487
Yes,jelo wrote:
Did you read the starting post?DenisChenu wrote: YOU must setup memcached before,
github.com/memcached/memcached/wiki/TutorialCachingStoryI have fully installed and configured memcached on my server.
But when reading
I think user must review the installation … he must know the port, the server etc …So I just copy the array definition the config.php at any place?
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.
- jelo
- Offline
- Platinum Member
- Posts: 5033
- Thank you received: 1257
DenisChenu wrote:
I think user must review the installation … he must know the port, the server etc …So I just copy the array definition the config.php at any place?
The only question I see is where to place the memcached array inside the config.php generated by LimeSurvey.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13597
- Thank you received: 2487
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.