# yum --enablerepo=axivo update memcached
# yum info memcached
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centost5.centos.org
* extras: centosz3.centos.org
* updates: centost5.centos.org
Installed Packages
Name : memcached
Arch : x86_64
Epoch : 1
Version : 1.4.18
Release : 1.el6
Size : 166 k
Repo : installed
From repo : axivo
Summary : High-performance memory object caching system
URL : http://www.memcached.org/
License : BSD
Description : Memcached is a high-performance, distributed memory object caching system,
: generic in nature, but intended for use in speeding up dynamic web applications
: by alleviating database load.
--- a/items.c
+++ b/items.c
@@ -764,6 +764,7 @@ static void item_crawler_evaluate(item *search, uint32_t hv, int i) {
static void *item_crawler_thread(void *arg) {
int i;
+ pthread_mutex_lock(&lru_crawler_lock);
if (settings.verbose > 2)
fprintf(stderr, "Starting LRU crawler background thread\n");
while (do_run_lru_crawler_thread) {
@@ -827,8 +828,8 @@ static void *item_crawler_thread(void *arg) {
STATS_LOCK();
stats.lru_crawler_running = false;
STATS_UNLOCK();
- pthread_mutex_unlock(&lru_crawler_lock);
}
+ pthread_mutex_unlock(&lru_crawler_lock);
if (settings.verbose > 2)
fprintf(stderr, "LRU crawler thread stopping\n");
--- a/items.c
+++ b/items.c
@@ -769,9 +769,6 @@ static void *item_crawler_thread(void *arg) {
fprintf(stderr, "Starting LRU crawler background thread\n");
while (do_run_lru_crawler_thread) {
pthread_cond_wait(&lru_crawler_cond, &lru_crawler_lock);
- STATS_LOCK();
- stats.lru_crawler_running = true;
- STATS_UNLOCK();
while (crawler_count) {
item *search = NULL;
@@ -918,6 +915,9 @@ enum crawler_result_type lru_crawler_crawl(char *slabs) {
}
pthread_mutex_unlock(&cache_lock);
pthread_cond_signal(&lru_crawler_cond);
+ STATS_LOCK();
+ stats.lru_crawler_running = true;
+ STATS_UNLOCK();
pthread_mutex_unlock(&lru_crawler_lock);
return CRAWLER_OK;
}
andI'm running on 1.4.18 without issues.
Yes, there is a bug, you have to fix the mutex/stats_lock's during the crawler lock loop.
Code:# yum --enablerepo=axivo update memcached # yum info memcached Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centost5.centos.org * extras: centosz3.centos.org * updates: centost5.centos.org Installed Packages Name : memcached Arch : x86_64 Epoch : 1 Version : 1.4.18 Release : 1.el6 Size : 166 k Repo : installed From repo : axivo Summary : High-performance memory object caching system URL : http://www.memcached.org/ License : BSD Description : Memcached is a high-performance, distributed memory object caching system, : generic in nature, but intended for use in speeding up dynamic web applications : by alleviating database load.
Build Tests
Patches
Code:--- a/items.c +++ b/items.c @@ -764,6 +764,7 @@ static void item_crawler_evaluate(item *search, uint32_t hv, int i) { static void *item_crawler_thread(void *arg) { int i; + pthread_mutex_lock(&lru_crawler_lock); if (settings.verbose > 2) fprintf(stderr, "Starting LRU crawler background thread\n"); while (do_run_lru_crawler_thread) { @@ -827,8 +828,8 @@ static void *item_crawler_thread(void *arg) { STATS_LOCK(); stats.lru_crawler_running = false; STATS_UNLOCK(); - pthread_mutex_unlock(&lru_crawler_lock); } + pthread_mutex_unlock(&lru_crawler_lock); if (settings.verbose > 2) fprintf(stderr, "LRU crawler thread stopping\n"); --- a/items.c +++ b/items.c @@ -769,9 +769,6 @@ static void *item_crawler_thread(void *arg) { fprintf(stderr, "Starting LRU crawler background thread\n"); while (do_run_lru_crawler_thread) { pthread_cond_wait(&lru_crawler_cond, &lru_crawler_lock); - STATS_LOCK(); - stats.lru_crawler_running = true; - STATS_UNLOCK(); while (crawler_count) { item *search = NULL; @@ -918,6 +915,9 @@ enum crawler_result_type lru_crawler_crawl(char *slabs) { } pthread_mutex_unlock(&cache_lock); pthread_cond_signal(&lru_crawler_cond); + STATS_LOCK(); + stats.lru_crawler_running = true; + STATS_UNLOCK(); pthread_mutex_unlock(&lru_crawler_lock); return CRAWLER_OK; }
# yum info php-pecl-memcached
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.bhs.mirrors.ovh.net
* extras: centos.bhs.mirrors.ovh.net
* updates: www.cubiculestudio.com
Installed Packages
Name : php-pecl-memcached
Arch : x86_64
Version : 2.2.0
Release : 1.el6
Size : 375 k
Repo : installed
From repo : axivo
Summary : Extension for interfacing with memcached via libmemcached library
URL : http://pecl.php.net/package/memcached
License : PHP and MIT
Description : This extension uses libmemcached library to provide API for communicating with
: memcached servers. Memcached is a high-performance, distributed memory object
: caching system, generic in nature, but intended for use in speeding up dynamic
: web applications by alleviating database load.
That's great!@RoldanLT, I will post it as part of my "10 Minutes Setup" tutorial, soon available at AXIVO for Red Hat/CentOS 6.5 64 bits. Yes, you can set a server ready for a web aplication like XenForo in 10 minutes.
For your knowledge, those options are not new in 2.2.0 but made surface since 2.1.0 if I'm not mistaken... anyways, they are part of AXIVO rpm since 2.1.0... which reminds me to document them better into config file.
Finally they released fix for my problemDoes anybody here using both the latest Memcached Server 1.4.18 and XenForo 1.3?
I'm using it since yesterday but memcached server randomly stop's or not responding.
So I just reverted to v1.4.17 for now.
Memcached 1.4.20 Release Notes
Date: 2014-5-11
http://www.memcached.org/files/memcached-1.4.20.tar.gz
Overview
Just one tiny change to fix a regression causing threads to lock up and spin max CPU.
1.4.18 and 1.4.19 were affected. 1.4.17 and earlier were not affected. If you are on .18 or .19 an upgrade to 1.4.20 is strongly advised.
Thanks to commando.io for reporting the bug initially and putting up with me being blind for a few weeks.
Fixes
- Fix a race condition causing new connections to appear closed, causing an inifinte loop.
The fix was out since 1.4.18, I post it above.Finally they released fix for my problem
How much RAM are you currently using?I have a small VPS, with 512MB Ram + 512mb as vSwap, so 1 GB Ram. Is it worth to install memcached on this VPS?
If you are just using a single server, no.I have a small VPS, with 512MB Ram + 512mb as vSwap, so 1 GB Ram. Is it worth to install memcached on this VPS?
Love your status widgets
How is it going ?@RoldanLT, I will post it as part of my "10 Minutes Setup" tutorial, soon available at AXIVO for Red Hat/CentOS 6.5 64 bits. Yes, you can set a server ready for a web aplication like XenForo in 10 minutes.
We use essential cookies to make this site work, and optional cookies to enhance your experience.