ngrep and memcache

By · Published · linux, php

You can use the Linux command ngrep to "watch" what is going into and coming out of memcache. ngrep is an amazingly useful tool for troubleshooting a wide array of network issues; I previously have used it extensively for troubleshooting SIP errors. In this case, I'm using it to be sure memache sessions in PHP are actually working.

codelemur ~ # ngrep -d lo port 11211
interface: lo (
filter: (ip) and ( port 11211 )
T -> [AP]
get a804f5517468d4696c60da7eaf8a7179..
T -> [AP]
VALUE a804f5517468d4696c60da7eaf8a7179 0 16..test|s:4:"test";..END..
T -> [AP]
set a804f5517468d4696c60da7eaf8a7179 0 1440 16..test|s:4:"test";..
T -> [AP]

It doesn't help too much if you have multiple memcache servers (which is kinda the point of memcache), and since it's raw data you can't inspect the packets if they're compressed, but in a testing environment, it's a great way to be sure all things are kosher.

( Comments )

Did something I wrote help you out?

That's great! I don't earn any money from this site - I run no ads, sell no products and participate in no affiliate programs. I do this solely because it's fun; I enjoy writing and sharing what I learn.

All the same, if you found this article helpful and want to show your appreciation, here's my wishlist.

Related Posts


Automatically Provisioning Polycom Phones

comments powered by Disqus