Skip to content

Instantly share code, notes, and snippets.

@mikeyk mikeyk/gist:1508150
Created Dec 21, 2011

What would you like to do?
""" Run with:
gunicorn -k gevent -b test_mc:app
gunicorn -k sync -b test_mc:app
import memcache as memcache
# toggle to try pylibmc instead
# import pylibmc as memcache
client = memcache.Client(["", ""])
def app(environ, start_response):
keys = []
for i in range(0, 50):
keys.append('key:%d' % i)
status = '200 OK'
response_headers = [
('Content-Length', str(len('OK')))
start_response(status, response_headers)
return iter(['OK'])
if __name__ == '__main__':
for i in range(0, 50):
client.set("key:%d" % i, "a" * 5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.