# Get pid of memcached instance my app is connected to?

**URL:** <https://www.ruby-forum.com/t/get-pid-of-memcached-instance-my-app-is-connected-to/191918>\
**Category:** Rails\
**Created:** [July 20, 2010, 5:46pm UTC](https://www.ruby-forum.com/t/get-pid-of-memcached-instance-my-app-is-connected-to/191918 "2010-07-20T17:46:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [July 20, 2010, 5:46pm UTC](https://www.ruby-forum.com/t/get-pid-of-memcached-instance-my-app-is-connected-to/191918/1 "2010-07-20T17:46:30Z")

</div>

Hi all. I’m using memcache-client to connect to memcached in my rails  
app. I’m having some weirdness on my production server and have several  
memcached instances running. Is there a way to get the pid of the one  
that my app is actually connected to?

thanks, max

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [July 20, 2010, 7:08pm UTC](https://www.ruby-forum.com/t/get-pid-of-memcached-instance-my-app-is-connected-to/191918/2 "2010-07-20T19:08:49Z")

</div>

CACHE.stats[:pid]

m

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [July 21, 2010, 10:27am UTC](https://www.ruby-forum.com/t/get-pid-of-memcached-instance-my-app-is-connected-to/191918/3 "2010-07-21T10:27:53Z")

</div>

Marc B. wrote:

> CACHE.stats[:pid]
> 
> m

ah thanks Marc - with my version it’s actually CACHE.stats[“pid”] but  
you put me on the right track 🙂 cheers!
