Re: Check if django is getting a page from memcache

2010-02-13 Thread Alessandro Ronchi
2010/2/13 Alessandro Ronchi 

> Thank you.
> It seems it's working.
> It's strange because some time requests waits 300ms to be processed
> (calculated by firefox firebug plugin), and other times (few seconds after)
> the same page waits 1.5seconds to begin downloading.
>
> I'm using mod_python.
>
> Is there a way to profile a request and understand if it's django, apache
> or mysql?
>
> I've several sites connecting to the same memcached (with 8 threads), but
> together they don't do more than 2000 pageviews a day...
>

Another strange thing it that the get response uses etags (which I've
disabled), and it gets the same page everytime also if I put conditional get
in my middleware.
It seems sometimes the server things my request doesnt' have to be fetched
from memcached, and other times it has (in the same minute).

Maybe I made some mistakes in my settings:

here is my
MIDDLEWARE_CLASSES = (

'django.middleware.cache.UpdateCacheMiddleware',
"django.middleware.common.CommonMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
PROJECTNAME + ".custom.middleware.UrlMiddleware",
"django.middleware.locale.LocaleMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.middleware.doc.XViewMiddleware",
'django.middleware.http.ConditionalGetMiddleware',
'django.middleware.gzip.GZipMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
"satchmo.shop.SSLMiddleware.SSLRedirect",
"django.contrib.flatpages.middleware.FlatpageFallbackMiddleware",
'pagination.middleware.PaginationMiddleware',
)

CACHE_BACKEND = "memcached://127.0.0.1:11211"
CACHE_MIDDLEWARE_SECONDS = 3600*12
CACHE_MIDDLEWARE_KEY_PREFIX= PROJECTNAME + "_store"
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
CACHE_TIMEOUT = 3600*12
CACHE_PREFIX = PROJECTNAME + "_store"


Of course I'm not in debug and not logged in when I make my tests.

-- 
Alessandro Ronchi

http://www.soasi.com
SOASI - Sviluppo Software e Sistemi Open Source

http://hobbygiochi.com
Hobby & Giochi, l'e-commerce del divertimento

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Check if django is getting a page from memcache

2010-02-13 Thread Alessandro Ronchi
2010/2/13 Daniel Roseman 

> On Feb 13, 4:50 pm, Rob Hudson  wrote:
> > You can telnet to memcached and run the `stats` command.  That'll tell
> > you overall hits and misses (plus other info).  If you're using
> > Django's page caching middleware, you'll see 2 hits per page because
> > Django caches both headers and page content.  The page load you should
> > see 2 misses.  Then all subsequent page loads you should see the hits
> > counter increase.
> >
> > -Rob
>
>
Thank you.
It seems it's working.
It's strange because some time requests waits 300ms to be processed
(calculated by firefox firebug plugin), and other times (few seconds after)
the same page waits 1.5seconds to begin downloading.

I'm using mod_python.

Is there a way to profile a request and understand if it's django, apache or
mysql?

I've several sites connecting to the same memcached (with 8 threads), but
together they don't do more than 2000 pageviews a day...



-- 
Alessandro Ronchi

http://www.soasi.com
SOASI - Sviluppo Software e Sistemi Open Source

http://hobbygiochi.com
Hobby & Giochi, l'e-commerce del divertimento

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Check if django is getting a page from memcache

2010-02-13 Thread Daniel Roseman
On Feb 13, 4:50 pm, Rob Hudson  wrote:
> You can telnet to memcached and run the `stats` command.  That'll tell
> you overall hits and misses (plus other info).  If you're using
> Django's page caching middleware, you'll see 2 hits per page because
> Django caches both headers and page content.  The page load you should
> see 2 misses.  Then all subsequent page loads you should see the hits
> counter increase.
>
> -Rob

Or check out the django-memcache-status project, which provides the
information as a nice graphic in your admin site home page.
http://github.com/bartTC/django-memcache-status
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Check if django is getting a page from memcache

2010-02-13 Thread Rob Hudson
You can telnet to memcached and run the `stats` command.  That'll tell
you overall hits and misses (plus other info).  If you're using
Django's page caching middleware, you'll see 2 hits per page because
Django caches both headers and page content.  The page load you should
see 2 misses.  Then all subsequent page loads you should see the hits
counter increase.

-Rob

On Feb 13, 2:41 am, Alessandro Ronchi 
wrote:
> I am not sure django is getting a page from memcached. Is there a way to
> check it?
>
> Thanks in advance,
>
> --
> Alessandro Ronchi
>
> http://www.soasi.com
> SOASI - Sviluppo Software e Sistemi Open Source
>
> http://hobbygiochi.com
> Hobby & Giochi, l'e-commerce del divertimento

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Check if django is getting a page from memcache

2010-02-13 Thread Alessandro Ronchi
I am not sure django is getting a page from memcached. Is there a way to
check it?

Thanks in advance,

-- 
Alessandro Ronchi

http://www.soasi.com
SOASI - Sviluppo Software e Sistemi Open Source

http://hobbygiochi.com
Hobby & Giochi, l'e-commerce del divertimento

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.