Skip to content

Instantly share code, notes, and snippets.

@mattbillenstein
Created August 12, 2013 23:42
Show Gist options
  • Save mattbillenstein/6216454 to your computer and use it in GitHub Desktop.
Save mattbillenstein/6216454 to your computer and use it in GitHub Desktop.
bmemcached creates a new server connection on every request
mattb@mattb-mitx:~ $ sudo /etc/init.d/memcached restart
Restarting memcached: memcached.
mattb@mattb-mitx:~ $ cat test_bmemcached.py
#!/usr/bin/env python
import bmemcached
import time
c = bmemcached.Client()
while 1:
time.sleep(1)
print c.stats().values()[0]['total_connections']
print c.set('1', '2')
print c.get('1')
print
mattb@mattb-mitx:~ $ ./test_bmemcached.py
7
True
2
10
True
2
13
True
2
16
True
2
19
True
2
22
True
2
25
True
2
28
True
2
31
True
2
34
True
2
37
True
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment