Troubleshooting memcached

From Koha Wiki

Jump to: navigation, search
Home > Documentation
Home > Documentation
Koha > Technical
Tips & Tricks > Tips & Tricks/Customising Notices and Slips > Tips & Tricks > Troubleshooting

Is memcached working?

If memcache has been enabled, is there a way to test to be sure Koha is using it? What can I look for?

You can use the memdump/memcdump tool from the libmemcached command-line utilities and see if there are any keys from Koha in. On Debian based distros the comand memcdump can be installed using "sudo apt-get install libmemcached-tools".

Here's an example from a development system:

$ memcdump --servers localhost
KOHAismemcached
KOHA7b394d2ae5a4f619298750061786850b
KOHAb8a70be4f9a30192e4a539b5df43192e
KOHA770244919d425ca5baee9a67404861c3
...
KOHAAuthorisedValues-YES_NO--0-CPL
KOHAAuthorisedValues-ROADTYPE--0-CPL
KOHA01c0a9a4d3db832b6231c0153b74842f
KOHA3192ef70e20cb21f9172aa6da055df07
KOHAkohaconf

(Based on a question from Tom Hanstra and an answer from Galen Charlton, on the main Koha mailing list.)

Is memcached working 2?

Try this:

echo "stats items" | nc 127.0.0.1 11211

This should give output like this:

   STAT items:1:number 1
   STAT items:1:age 66
   STAT items:1:evicted 0
   STAT items:1:evicted_nonzero 0
   STAT items:1:evicted_time 0
   STAT items:1:outofmemory 0
   STAT items:1:tailrepairs 0
   STAT items:1:reclaimed 0
   STAT items:1:expired_unfetched 0
   STAT items:1:evicted_unfetched 0
   STAT items:1:crawler_reclaimed 0
   STAT items:1:lrutail_reflocked 0
   STAT items:6:number 18
   STAT items:6:age 673
   STAT items:6:evicted 0
   STAT items:6:evicted_nonzero 0

You can use the number after "items:" to dig deeper:

echo "stats cachedump 1 100" | nc 127.0.0.1 11211

External links

Personal tools