litespeedtech / lsmcd Goto Github PK
View Code? Open in Web Editor NEWLiteSpeed Memcache Compatible Persistent HA replication Cache Server
License: GNU General Public License v3.0
LiteSpeed Memcache Compatible Persistent HA replication Cache Server
License: GNU General Public License v3.0
Hi
I'm using the default configs for lsmcd. In my node.conf
I've the following configs defined for LogLevel and LogFile:
LogLevel=notice
#LogLevel=dbg_medium
LogFile=/tmp/lsmcd.log
However, 2020-06-20 07:48:51.511 [NOTICE] [__root] Binary data is too long
is reported over and over again - many times every second. (Let's just say it was above 1GB. I spotted it while making some maintenance of the server ๐ฅ ๐ )
If I take a look at the source, I can find the logics - but I'm not really sure that it means.
lsmcd/src/memcache/lsmemcache.cpp
Line 1828 in baddf74
...
McBinStat LsMemcache::chkMemSz(MemcacheConn *pConn, int arg)
{
...
if (!chkItemSize(m_parms.val.len))
{
// memcached compatibility - remove `stale' data
LsShmHash::iteroffset iterOff;
if (arg == MC_BINCMD_SET)
{
if ((iterOff = pConn->getHash()->
findIteratorWithKey(m_hkey,&m_parms)).m_iOffset != 0)
pConn->getHash()->eraseIterator(iterOff);
}
LS_NOTICE("Binary data is too long\n");
return MC_BINSTAT_E2BIG;
}
...
}
What does the !chkItemSize(m_parms.val.len)
logics check, and what can I do to fix this? The log are growing every minute. I can log-rotate if I want, but there must be a problem with the setup, or something else.
Let me know if I need to provide anything else.
Dear All.
I Learn to use LSMCD as replacement of memcached, to speed up our WP Hosting.
I think there is one problem about it.
I'm writing a simple python script that will trigered by WHM event.
This script will create one new WP site for newly created account, including 'installing and configure' LSCache Wordpress Plugin.
Since I use LSMCD with SASL, this script also need to add user-password to LSMCD SASLdb for that user.
SASLdb is just a regular text file,
Imagine if I have more than 1 account created by WHM ..... there will be a File-Locking problem.
So, Is there any way for me to replace SASL database backend?
Sincerely
-bino-
Actualy, I post the same question at https://www.litespeedtech.com/support/forum/threads/lsmcd-sasl-database-backend.16940/
Hello
my lsmcd istance stops randomly.
my OS is Debian 11 and I followed this to install LSMCD
https://openlitespeed.org/kb/litespeed-memcached/
Here an extract from
sudo journalctl --unit lsmcd.service
Mar 01 20:31:47 myhost systemd[1]: Starting LiteSpeed LSMCD Daemon...
Mar 01 20:31:47 myhost lsmcdctrl[592]: cat: /tmp/lsmcd/lsmcd.pid: No such file or directory
Mar 01 20:31:49 myhost lsmcdctrl[533]: [OK] lsmcd: pid=595.
Mar 01 20:31:49 myhost lsmcdctrl[533]: Final rc: 0
Mar 01 20:31:49 myhost systemd[1]: Started LiteSpeed LSMCD Daemon. #<------------------ISSUED SYSTEMD START
Mar 02 06:41:36 myhost lsmcdctrl[4220]: [OK] lsmcd: stopped. #<------------------STOPPED HERE
Mar 02 06:41:36 myhost lsmcdctrl[4220]: Final rc: 0
Mar 02 06:41:36 myhost systemd[1]: lsmcd.service: Succeeded.
Mar 02 06:41:36 myhost systemd[1]: lsmcd.service: Unit process 4219 (lsmcd) remains running after unit stopped.
Mar 02 11:36:12 myhost systemd[1]: Starting LiteSpeed LSMCD Daemon...
Mar 02 11:36:13 myhost lsmcdctrl[6002]: [OK] lsmcd: pid=6020.
Mar 02 11:36:13 myhost lsmcdctrl[6002]: Final rc: 0
Mar 02 11:36:13 myhost systemd[1]: Started LiteSpeed LSMCD Daemon. #<------------------ISSUED SYSTEMD START
Mar 02 22:28:50 myhost lsmcdctrl[9620]: [OK] lsmcd: stopped. #<------------------STOPPED HERE
Mar 02 22:28:50 myhost lsmcdctrl[9620]: Final rc: 0
Mar 02 22:28:50 myhost systemd[1]: lsmcd.service: Succeeded.
Mar 02 22:28:50 myhost systemd[1]: lsmcd.service: Unit process 9619 (lsmcd) remains running after unit stopped.
Mar 02 23:06:13 myhost systemd[1]: Starting LiteSpeed LSMCD Daemon...
Mar 02 23:06:14 myhost lsmcdctrl[9914]: [OK] lsmcd: pid=9931.
Mar 02 23:06:14 myhost lsmcdctrl[9914]: Final rc: 0
Mar 02 23:06:14 myhost systemd[1]: Started LiteSpeed LSMCD Daemon. #<------------------ISSUED SYSTEMD START
my systemd.service
[Unit]
Description = LiteSpeed LSMCD Daemon
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
ExecStart = /usr/local/lsmcd/bin/lsmcdctrl start
ExecStop = /usr/local/lsmcd/bin/lsmcdctrl stop
#ExecReload= /usr/local/lsmcd/bin/lsmcdctrl restart
KillMode=none
PrivateTmp=false
# do not want to be limited in anyway
CPUAccounting=false
TasksAccounting=false
MemoryAccounting=false
[Install]
WantedBy=default.target
thanks, any help is appreciated!
HI,
I have no problem installing lsmcd, but have a problem installing Memcached Extension for PHP, based this document:
https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:lsmcd:install-memcached
Use apt-get install lsphp74-memcached
, but get error: E: Unable to locate package lsphp74-memcached
Anyone can help me? Thank you in advance
Debian11x64bit
OpenLiteSpeed 1.7.14
PHP7.4.27
Hi guys
I'm using LSMCD on a server with multiple WP sites (all sites are using LSMCD for object caching via the LSCache plugin).
Just wondering if running wp_cache_flush (https://developer.wordpress.org/reference/functions/wp_cache_flush/) on a single site will clear the entire LSMCD KV store, thereby clearing the object cache for every site?
Or does it only clear the object cache for the one site?
Cheers
When trying to update on CL7 to the latest version of lsmcd (we have a previous older version installed and was running fine), after make and install trying to start the updated service gives me the error:
Jan 11 07:21:29 XXXXX lsmcd[572485]: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql
Jan 11 07:21:29 XXXXX lsmcd[572485]: auxpropfunc error invalid parameter supplied
Jan 11 07:21:29 XXXXX lsmcd[572485]: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: ldapdb
Jan 11 07:21:29 XXXXX lsmcd[572485]: ldapdb_canonuser_plug_init() failed in sasl_canonuser_add_plugin(): invalid parameter supplied
Jan 11 07:21:29 XXXXX lsmcd[572485]: _sasl_plugin_load failed on sasl_canonuser_init for plugin: ldapdb
Jan 11 07:21:30 XXXXX lsmcd[572467]: start lsmcd [ ERROR ]
Jan 11 07:21:30 XXXXX systemd[1]: lsmcd.service: control process exited, code=exited status=255
Jan 11 07:21:30 XXXXX systemd[1]: Failed to start LSB: lsmcd.
Jan 11 07:21:30 XXXXX systemd[1]: Unit lsmcd.service entered failed state.
How can I fix this?
Hi,
I cannot use stats items with lsmcd
but it's working on native memcached
this error shown:
CLIENT_ERROR bad command line format
and getallkeys in php return empty array
i'm using php 7.3 and cetnos 7
I have compiled and installed LSMCD without errors in Ubuntu 14.04 LTS, installing automake-1.13
from .deb
. The problem is that when I run LSMCD it freezes on the first Memcached command. When this happens there are no errors even in the logs.
I followed the same installation procedure in CentOS 7, installing automake-1.13
from .rpm
, and it works fine.
Is there a procedure to correctly run LSMCD on Ubuntu/Debian systems?
Hi
I updated lsmcd two weeks ago, and it's filling up our /tmp
location every week, or so. So almost 7,6GB of data are used.
I've defined the logs to be located at LogFile=/tmp/lsmcd.log
with warn
-level, but there's no file present.
Are there a bug in the current version?
Or, is it somewhat related to the memory available on the server? I've upgraded it, so we've moved from 8GB to 16GB.
Hi @rperper
Is there any chance LSMCD can be updated to include Memcached 1.6's meta protocol and syscall batching features?
https://devclass.com/2020/03/09/memcached-1-6-puts-binary-protocol-to-bed/
I use regular Memcached on a few Apache servers and noticed a very significant performance increase with. 1.6.
Cheers
Hi there,
I downloaded from master branch and ran:
cd lsmcd
./configure
make install
got the following error. Seems to be a file missing? expat.h ?
Any advice?
ake[3]: Entering directory /lsmcd/src/util' g++ -DHAVE_CONFIG_H -I. -I../../src -I../../include -I../../src -I/usr/include -g -O2 -fstack-protector -MT xmlnode.o -MD -MP -MF .deps/xmlnode.Tpo -c -o xmlnode.o xmlnode.cpp xmlnode.cpp:13:19: fatal error: expat.h: No such file or directory #include <expat.h> ^ compilation terminated. make[3]: *** [xmlnode.o] Error 1 make[3]: Leaving directory
/lsmcd/src/util'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory /lsmcd/src/util' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory
/lsmcd/src'
make: *** [install-recursive] Error 1
in production environment ip must set to 127.0.0.1 or changed to servers static ip?
Setting LogLevel=notice to /usr/local/lsmcd/conf/node.conf is not honored and the /tmp/lsmcd.log still gets bombarded by ERROR messages such as
2021-11-06 21:54:03.636 [ERROR] [__root] Successful SASL authentication not performed
Relevant conf lines:
LogLevel=notice
LogFile=/tmp/lsmcd.log
Restarted lsmcd by
/usr/local/lsmcd/bin/lsmcdctrl stop
rm -rf /dev/shm/lsmcd
/usr/local/lsmcd/bin/lsmcdctrl start
Can you tell me why are ERROR messages getting included in the log and how to discern what user is trying to run as root
Thanks in advance.
root@lsmcd:~/lsmcd# make install
CDPATH="${ZSH_VERSION+.}:" && cd . && aclocal-1.13
/bin/bash: aclocal-1.13: command not found
Makefile:339: recipe for target 'aclocal.m4' failed
make: *** [aclocal.m4] Error 127
After checking the log file, I noticed this error every few hours:
2021-03-19 03:02:12.701 [ERROR] [__root] [SHM] [-1-11:0x1cebab0] FATAL ERROR alloc2 cross large page boundary, offset: 30FFC00, size: 1072. You must remove all of the files in /dev/shm/lsmcd and restart the lsmcd server
The offset and size differ every time. What's causing it?
Funny you should mention that. We've been doing some preliminary testing that seems to address the WP Cache problem by installing the libmemcached-awesome library and completely replacing the existing libmemcached library with it. It seems to have fixed the problem. If you don't mind giving something like that a try, we have an early cheat-sheet of instructions for it. We'd love to hear your experiences with it. Check out: https://docs.google.com/document/d/1GNZ3EOcOeBqYS19rl5rnGoh8I9N1BFU3htSn_IPaavg/edit?usp=sharing
Thanks,
Bob
Originally posted by @rperper in #26 (comment)
Hi guys
Sorry to post a question here, but I haven't been able to find the answer. Just wondering if there are still any benefits to using LSMCD over regular Memcached, now that Memcached supports SASL? (https://github.com/memcached/memcached/wiki/SASLHowto).
It's for a shared hosting environment running OLS.
Also, is current version of LSMCD based on version 1.6.x of Memcached?
Thanks!
Where is the uninstall.sh script that your documentation says it is included in the repository?
Note
If you wish to uninstall LSMCD, you can use the ./uninstall.sh script, found in the same directory.
Hey
how can i check installed version and how update to new release? just git new package and recompile ? how about our configuration ? should i backup before any new update?
New to lsmcd, wondering how to set/change the CACHESIZE as i would have done in /etc/sysconfig/memcached
with memcached. It appears the default is set to 1024, but is it possible to change?
Also, stats
command seems to differ from the memcached stats, where I get things like uptime, bytes read, etc.
lsmcd
Array
(
[pid] => 1459
[version] => 1.0.0
[pointer_size] => 64
[rusage_user] => 0.015967
[rusage_system] => 0.045063
[cmd_get] => 0
[cmd_set] => 124
[cmd_flush] => 0
[cmd_touch] => 0
[get_hits] => 0
[get_misses] => 0
[delete_misses] => 0
[delete_hits] => 4
[incr_misses] => 0
[incr_hits] => 0
[decr_misses] => 0
[decr_hits] => 0
[cas_misses] => 0
[cas_hits] => 0
[cas_badval] => 0
[touch_hits] => 0
[touch_misses] => 0
[auth_cmds] => 0
[auth_errors] => 0
)
memcached:
[pid] => 29178
[uptime] => 9120237
[time] => 1500575151
[version] => 1.4.4
[pointer_size] => 64
[rusage_user] => 67404.226999
[rusage_system] => 157157.292460
[curr_connections] => 20
[total_connections] => 306250738
[connection_structures] => 784
[cmd_get] => 8811703023
[cmd_set] => 887905901
[cmd_flush] => 0
[get_hits] => 8656932597
[get_misses] => 154770426
[delete_misses] => 14493
[delete_hits] => 31415
[incr_misses] => 128402148
[incr_hits] => 155504794
[decr_misses] => 0
[decr_hits] => 0
[cas_misses] => 0
[cas_hits] => 0
[cas_badval] => 0
[auth_cmds] => 0
[auth_errors] => 0
[bytes_read] => 2493081761115
[bytes_written] => 17308710353608
[limit_maxbytes] => 1073741824
[accepting_conns] => 1
[listen_disabled_num] => 0
[threads] => 4
[conn_yields] => 0
[bytes] => 95711633
[curr_items] => 102697
[total_items] => 733072550
[evictions] => 175005
I use cPanel and Cloulinux and Litespeed
I installed the LSMCD via cPanel plugin file in this command:
sudo git clone https://github.com/litespeedtech/lsmcd.git
sudo cd lsmcd
sudo ./lsmcd_cpanel.sh
LSMCD is working properly with TCP
connection, but when I configured to unix socket
, it shows nothing.
test.php
<?php
$mc = new Memcached();
$mc->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
$mc->setOption(Memcached::OPT_COMPRESSION, false);
$mc->addServer('/tmp/lsmcd/lsmcd.sock', 0);
$mc->setSaslAuthData('testuser', 'testpass');
$mc->set("foo", "bar");
$value = $mc->get('foo');
echo $value;
And it doesn't show anything.
/usr/local/lsmcd/conf/node.conf
Repl.HeartBeatReq=30
Repl.HeartBeatRetry=3000
Repl.MaxTidPacket=2048000
Repl.GzipStream=YES
Repl.LbAddrs=127.0.0.1:12340
Repl.ListenSvrAddr=127.0.0.1:12340
REPL.DispatchAddr=127.0.0.1:5501
RepldSockPath=/tmp/repld.usock
CACHED.PRIADDR=127.0.0.1:11000
#CACHED.ADDR=127.0.0.1:11211
CACHED.ADDR=UDS:///tmp/lsmcd/lsmcd.sock
#default is 8, it can be bigger depending on cache data amount
Cached.Slices=8
Cached.Slice.Priority.0=100
Cached.Slice.Priority.1=100
Cached.Slice.Priority.2=100
Cached.Slice.Priority.3=100
Cached.Slice.Priority.4=100
Cached.Slice.Priority.5=100
Cached.Slice.Priority.6=100
Cached.Slice.Priority.7=100
Cached.ShmDir=/dev/shm/lsmcd
Cached.UseSasl=true
Cached.DataByUser=true
Cached.Anonymous=false
Cached.SaslDB=/etc/sasllsmcd
##this is the global setting, no need to have per slice configuration.
User=nobody
Group=nobody
#depends CPU core
CachedProcCnt=4
CachedSockPath=/tmp/cached.usock.
TmpDir=/tmp/lsmcd
LogLevel=notice
#LogLevel=dbg_medium
LogFile=/tmp/lsmcd.log
But it works when I switch to TCP
:
CACHED.ADDR=127.0.0.1:11211
#CACHED.ADDR=UDS:///tmp/lsmcd/lsmcd.sock
sudo systemctl restart lsmcd
$mc->addServer('127.0.0.1', 11211);
it returns "bar"
In this article: Using Memcached in a UNIX socket, it is mentioned that:
1.Stop Memcached systemctl stop memcached
2. Copy the service file cp /usr/lib/systemd/system/memcached.service /etc/systemd/system/memcached.service
3. Add the following content to /etc/systemd/system/memcached.service. After [Service], please change username to the same user that runs PHP: User=username Group=username The contents of the file should look like this:
But there isn't any memcached
service in the system. Because I installed lscmd
, not memcached.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.