Coder Social home page Coder Social logo

stats items not working about lsmcd HOT 4 CLOSED

litespeedtech avatar litespeedtech commented on June 27, 2024
stats items not working

from lsmcd.

Comments (4)

rperper avatar rperper commented on June 27, 2024

Hi,
Are you using SASL? In PHP are you in binary mode?
Some of the stuff I'd like to see is:

  • node.conf.
  • /tmp/lsmcd.log
    Thanks,
    Bob Perper

from lsmcd.

pouyadarabi avatar pouyadarabi commented on June 27, 2024

No,

PHP code:

<?php $c = new Memcached(); $c->addServer("127.0.0.1", 11211); var_dump( $c->getAllKeys() );

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.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=false
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=/var/log/lsmcd.log

I set debug mode to dbg_high
lsmcd.log

2020-04-27 13:14:31.142 [DEBUG] [__root] About to test USESASL
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.USESASL = false
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SLICE.PRIORITY.0=100
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SHMFILEPATH.0=/dev/shm/lsmcd/data0
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SLICE.PRIORITY.1=100
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SHMFILEPATH.1=/dev/shm/lsmcd/data1
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SLICE.PRIORITY.2=100
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SHMFILEPATH.2=/dev/shm/lsmcd/data2
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SLICE.PRIORITY.3=100
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SHMFILEPATH.3=/dev/shm/lsmcd/data3
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SLICE.PRIORITY.4=100
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SHMFILEPATH.4=/dev/shm/lsmcd/data4
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SLICE.PRIORITY.5=100
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SHMFILEPATH.5=/dev/shm/lsmcd/data5
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SLICE.PRIORITY.6=100
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SHMFILEPATH.6=/dev/shm/lsmcd/data6
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SLICE.PRIORITY.7=100
2020-04-27 13:14:31.142 [DEBUG] [__root] CACHED.SHMFILEPATH.7=/dev/shm/lsmcd/data7
2020-04-27 13:14:31.142 [NOTICE] [__root] LSMCD/1.4.11 LiteSpeed Memcached Replacement

output is array(0) { }

I write another test

$c = new Memcached();
$c->addServer("127.0.0.1", 11211);
$c->set('pouya','test');
var_dump($c->get('pouya'));
var_dump($c->getAllkeys());

output is: string(4) "test" array(0) { }

from lsmcd.

rperper avatar rperper commented on June 27, 2024

Your initial problem was an error in stats(). So I wrote the following program:

echo "Entering PHP<br>";
$c = new Memcached();
echo "addServer<br>";
$c->addServer("127.0.0.1",11211);
echo "set: ";
echo $c->set('pouya','test');
echo "<br>var_dump of the key<br>";
var_dump($c->get('pouya'));
echo "<br>var_dump of all keys<br>";
var_dump($c->getAllkeys());
echo "<br>get: " . $c->get('pouya') . "<br>";
echo "stats: " ;
var_dump($c->getStats());
echo "<br>";
?>

Which displayed the following results in a browser:
Entering PHP
addServer
set: 1
var_dump of the key
string(4) "test"
var_dump of all keys
array(0) { }
get: test
stats: array(1) { ["127.0.0.1:11211"]=> array(24) { ["pid"]=> int(3803) ["version"]=> string(5) "1.0.0" ["pointer_size"]=> int(64) ["rusage_user"]=> float(0.016648) ["rusage_system"]=> float(0.015964) ["cmd_get"]=> int(34) ["cmd_set"]=> int(14) ["cmd_flush"]=> int(2) ["cmd_touch"]=> int(0) ["get_hits"]=> int(19) ["get_misses"]=> int(15) ["delete_misses"]=> int(0) ["delete_hits"]=> int(0) ["incr_misses"]=> int(0) ["incr_hits"]=> int(0) ["decr_misses"]=> int(0) ["decr_hits"]=> int(0) ["cas_misses"]=> int(0) ["cas_hits"]=> int(0) ["cas_badval"]=> int(0) ["touch_hits"]=> int(0) ["touch_misses"]=> int(0) ["auth_cmds"]=> int(0) ["auth_errors"]=> int(0) } }

This shows us several things:

  • The set and get seem to work as expected.
  • The memcached function getAllKeys() does not work
  • The getStats() function works as expected.

This is actually as documented. There is no documentation for the telnet command stats items or similar function. The full list of commands is here: https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:lsmcd:commands

Thanks,

Bob Perper
[email protected]

from lsmcd.

pouyadarabi avatar pouyadarabi commented on June 27, 2024

I started this issue with "stats items not working"
anyway thanks for your help.

from lsmcd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.