Created
August 12, 2013 23:42
-
-
Save mattbillenstein/6216454 to your computer and use it in GitHub Desktop.
bmemcached creates a new server connection on every request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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') | |
| 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