Problem with memcache - very bad performance

32 views
Skip to first unread message

Szymon

unread,
Feb 22, 2010, 3:15:55 PM2/22/10
to Django users
Hi,

I'm using latest Django trunk and have problems with memcache. For few
days my site is struggling with performance. I've blamed mod_wsgi,
I've blamed Apache, I've blamed Postgres on dedicated box, I've blamed
everything but today I've done profiling... and the winner is...

72.1% 4.862 build/bdist.freebsd-7.1-RELEASE-amd64/egg/memcache.py

5 secs. (!) 72% of execution time. Something that should boost
performance, kills my WWW box! There were about 30-40 calls.

It's not normal? What can cause problem? There are no any infos in
logs. Nothing. :S

Best regards,
Szymon Kosok

Szymon

unread,
Feb 22, 2010, 4:34:17 PM2/22/10
to Django users
On 22 Lut, 21:15, Szymon <szy...@mwg.pl> wrote:
> 5 secs.

CPU secs. of course.

Now, on lighter traffic (same view).

12.1% 0.069 build/bdist.freebsd-7.1-RELEASE-amd64/egg/memcache.py

Strange. Probably on higher load I will get faster response times just
querying DB. :S Any suggestions? Maybe it's normal?

Javier Guerra

unread,
Feb 22, 2010, 4:50:20 PM2/22/10
to django...@googlegroups.com

are you sure you get memcached store on RAM? maybe it's being swapped out

--
Javier

Szymon

unread,
Feb 22, 2010, 5:04:27 PM2/22/10
to Django users
On 22 Lut, 22:50, Javier Guerra <jav...@guerrag.com> wrote:
> are you sure you get memcached store on RAM? maybe it's being swapped out

Yes. Swap hasn't been touched yet since last reboot.

Mem: 400M Active, 2915M Inact, 354M Wired, 66M Cache, 214M Buf, 193M
Free
Swap: 4000M Total, 4000M Free

But that's strange:

# netstat | grep localhost.11211 | wc -l
652

It's ok? Almost all in "TIME_WAIT" state. Now, when there is really
small traffic.

Szymon

unread,
Feb 23, 2010, 2:20:09 AM2/23/10
to Django users
Hello,

I've turned -vv logging and sometimes it throws:

>18 ERROR
<18 ccopy_reg
>18 ERROR
<18 _reconstructor
>18 ERROR
<18 p1
>18 ERROR
<18 (cdjango.db.models.query
>18 ERROR
<18 QuerySet
>18 ERROR
<18 p2
>18 ERROR
<18 c__builtin__
>18 ERROR
<18 object
[snip - it's long]

Some problem with caching QuerySets?

Szymon

unread,
Feb 23, 2010, 5:47:04 AM2/23/10
to Django users
Hello again,

I've changed backend to pylibmc (using some custom backend found in
Google, that needed some changes to work) , installed Memcached on
local WWW box (it was on DB box before), connecting via socket...
and...

2.5% 0.009 /home/www/dev/mc.py

But we will see in few hours, when traffic will be heavy (now is light/
moderate).

Best regards,
Szymon

Reply all
Reply to author
Forward
0 new messages