Memcached slows down the site

I have a website maintained by nginx and django.

My staging.py contains CACHE and middleware settings correctly. You can see the nginx.conf and nginx conf file associated with the site . I confirmed that memcached works through ngrep -d any port 11211.

I turned on caching for the entire site and wanted to see performance by doing ab -n 1000 -c 10 http://site.com

When caching is disabled, I get:

Concurrency Level:      10
Time taken for tests:   10.276 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      11695000 bytes
HTML transferred:       11559000 bytes
Requests per second:    97.32 [#/sec] (mean)
Time per request:       102.759 [ms] (mean)
Time per request:       10.276 [ms] (mean, across all concurrent requests)
Transfer rate:          1111.43 [Kbytes/sec] received

When caching is enabled, I get:

Concurrency Level:      10
Time taken for tests:   12.277 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      11695000 bytes
HTML transferred:       11559000 bytes
Requests per second:    81.45 [#/sec] (mean)
Time per request:       122.771 [ms] (mean)
Time per request:       12.277 [ms] (mean, across all concurrent requests)
Transfer rate:          930.26 [Kbytes/sec] received

My site is a blog that pulls posts from a database - nothing exotic.

, - , memcached. , " " , memcached!

memcached-top ab ( ). , memcached .


memcached -vv . , memcached "STORED" , , , ( ). . , memcached django , , memcached?

+5
1

Trewq, . , , , memcache .

: -, , , (x86 vs _64)

-vv- ( -vvv) SET , , , . - memcache, .

< > <key> <flags> <exptime> <bytes> [noreply]\r\n - https://github.com/memcached/memcached/blob/master/doc/protocol.txt

, memcache/api, , mc . memcache, - http://code.google.com/p/memcached/wiki/NewConfiguringServer#Inspecting_Running_Configuration bechmark.

A script sys.stdin? memcache -vv, , GET SET. - , , .

wiki stat, stat, , - https://github.com/memcached/memcached/blob/master/doc/protocol.txt#L409

9/10 - 1 , 6/10 , , 60%, .

+1

All Articles