Posts Tagged memcache

Testing Memcached Using Telnet Commands

Troubleshooting memcached is not so transparent as some other technologies, but testing memcached using telnet commands can give us quite some insight on what’s happening under the hood.

Following is a short list of useful commands to inspect a running memcached instance.

How to find the IP address and port to connect:

ps aux | grep memcached will give us the process running memcached, with listening ip address and port. If this command does not yield any results, you likely not running the daemon and need to start it up first.

We can now connect using this info:

telnet 127.0.0.1 11211 (replace your IP address and port)

Supported Commands:

The following is a list of the most important memcached commands. For a more complete list of supported commands, check out the memcached wiki document. (more…)

Hot To Install Memcache And PHP Client On Mac Snow Leopard

I recently installed the memcached daemon on my MacBook Pro, incuding the necessary PHP client for development purposes. I just prefer to work locally instead of using a VM running Linux. And the process is actually quite simple and straight forward. Please note, I have included both clients, the old standard one and the newer PECL extension, because I deal with different applications and also lots of people seems to get confused when they install one version and their memcache classes cannot get instantiated and throw errors. So, if in doubt, just install both.

These are the five (four if you know which extension you want) components needed:

- libevent (requred library for memcached)

- memcached daemon

- libmemcached (required library for the php client)

- php extension (standard)

- php extension (PECL)

Now open your terminal and off we go: (more…)

Nginx and memcached module

Memcache is traditionally used as a module inside server side scripts, such as PHP, ASP, ColdFusion and others. And it’s doing a terrific job, as long as it’s implemented correctly.

But if we look under the hood of the actual Memcache application, and I’m not talking about the PHP or ASP extension, but rather the executable that’s running as a daemon under linux, for example, it is a rather simple database like application running in memory. Now there are two basic actions that need to be performed to use it, one is writing info into memcache, the other is reading it. In a typical scenario, there are many reads for one write, that’s the whole point, isn’t it. But what if we can isolate the reading from the server side scripts, and let a small high speed module do that for us.

(more…)