caching doesn't work?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

caching doesn't work?

Nathan Ollerenshaw-2
Hi guys,

I've been looking at the new cache in 2.0. Does it actually work?

cache on:

jupiter:/sixpack/www# mysqladmin status
Uptime: 3550  Threads: 1  Questions: 3452  Slow queries: 0  Opens: 0  
Flush tables: 1  Open tables: 31  Queries per second avg: 0.972
jupiter:/sixpack/www# mysqladmin status
Uptime: 3555  Threads: 1  Questions: 3484  Slow queries: 0  Opens: 0  
Flush tables: 1  Open tables: 31  Queries per second avg: 0.980

cache off:

jupiter:/sixpack/www# mysqladmin status
Uptime: 3579  Threads: 1  Questions: 3518  Slow queries: 0  Opens: 0  
Flush tables: 1  Open tables: 31  Queries per second avg: 0.983
jupiter:/sixpack/www# mysqladmin status
Uptime: 3584  Threads: 1  Questions: 3550  Slow queries: 0  Opens: 0  
Flush tables: 1  Open tables: 31  Queries per second avg: 0.991

Its on a privately hosted system that I'm using to develop some WP  
hacks on so I know nobody else is hitting the DB.

I used:

define('ENABLE_CACHE', false);

to make sure it was disabled and

define('ENABLE_CACHE', true);

to make sure it was enabled.

Its definitely creating cache files. In fact, setting ENABLE_CACHE to  
false seems to still create cache files ...

I think that I should be able to do better than:

Requests per second:    3.78 [#/sec] (mean)
Time per request:       264.632 [ms] (mean)
Time per request:       264.632 [ms] (mean, across all concurrent  
requests)
Transfer rate:          50.75 [Kbytes/sec] received

Is this a bug, or am I just expecting too much? Is there any way I  
can verify that it is working as advertised?

Cheers,

Nathan.
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: caching doesn't work?

David House
On 01/02/06, Nathan Ollerenshaw <[hidden email]> wrote:
> define('ENABLE_CACHE', false);

You need to define('DISABLE_CACHE', true) to turn it off.

--
-David House, [hidden email], http://xmouse.ithium.net
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: caching doesn't work?

Nathan Ollerenshaw-2
On Feb 2, 2006, at 1:16 AM, David House wrote:

> You need to define('DISABLE_CACHE', true) to turn it off.

Hi David,

Using ab with DISABLE_CACHE set to false:

Requests per second:    3.47 [#/sec] (mean)
Time per request:       288.096 [ms] (mean)

With DISABLE_CACHE set to true:

Requests per second:    3.67 [#/sec] (mean)
Time per request:       272.454 [ms] (mean)

Its about the same. With the wp-cache plugin, I used to get up to 100  
requests/sec out of WP 1.5, and about 3.5/sec without the wp-cache  
plugin - which is very similar to the numbers I'm getting out of WP  
2.0.1, which suggests to me that even though objects are getting  
written to disk, it's always going to the DB for every request.

It could be a combination of my plugins, but disabling everything and  
dropping back to standard 2.0.1 doesn't seem to have an effect.

I'll have a dig and see if I can find something.

Can someone else do some ab's against 2.0.1 and compare it with 1.5  
running wp-cache? I'd like to know if I'm the only one seeing a  
difference here.

Cheers,

Nathan.
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: caching doesn't work?

Nathan Ollerenshaw-2
On Feb 2, 2006, at 3:07 PM, Nathan Ollerenshaw wrote:

> Can someone else do some ab's against 2.0.1 and compare it with 1.5  
> running wp-cache? I'd like to know if I'm the only one seeing a  
> difference here.

Actually, wp-cache seems to work under 2.0.1. I had no idea.

Requests per second:    3.42 [#/sec] (mean)
Time per request:       292.455 [ms] (mean)

vs

Requests per second:    170.70 [#/sec] (mean)
Time per request:       5.858 [ms] (mean)

I thought WP_Object_Cache obviates the need for other caching  
systems ... but it doesn't seem to make a difference performance-wise  
whether it is on or off, though looking at what stats() gives you, it  
seems to be 'working'.

Aaaany way, mucked with this too much... just hoping this is useful  
for someone.

Cheers,

Nathan.
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: caching doesn't work?

Ryan Boren
Nathan Ollerenshaw wrote:

> On Feb 2, 2006, at 3:07 PM, Nathan Ollerenshaw wrote:
>
>> Can someone else do some ab's against 2.0.1 and compare it with 1.5  
>> running wp-cache? I'd like to know if I'm the only one seeing a  
>> difference here.
>
>
> Actually, wp-cache seems to work under 2.0.1. I had no idea.
>
> Requests per second:    3.42 [#/sec] (mean)
> Time per request:       292.455 [ms] (mean)
>
> vs
>
> Requests per second:    170.70 [#/sec] (mean)
> Time per request:       5.858 [ms] (mean)
>
> I thought WP_Object_Cache obviates the need for other caching  systems
> ... but it doesn't seem to make a difference performance-wise  whether
> it is on or off, though looking at what stats() gives you, it  seems to
> be 'working'.
>
> Aaaany way, mucked with this too much... just hoping this is useful  for
> someone.

The object cache can't compete with a full static caching system like
wp-cache, nor is it meant to.  In my ab benchmarks, the persistent
object cache offered a marginal performance improvement over running
without persistent caching. The benchmarking was done on a couple of
shared hosting setups.  On my personal servers, I saw slightly better
performance, depending on the amount of disk caching.  The real
advantage of the cache is that it is pluggable.  Thus you can use APC or
memcached backends.  As for the default backend, on some hosts it simply
doesn't buy you much.  It all depends.

Ryan
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: caching doesn't work?

David House
In reply to this post by Nathan Ollerenshaw-2
On 02/02/06, Nathan Ollerenshaw <[hidden email]> wrote:
> I thought WP_Object_Cache obviates the need for other caching
> systems ... but it doesn't seem to make a difference performance-wise
> whether it is on or off, though looking at what stats() gives you, it
> seems to be 'working'.

Try sticking $wp_object_cache->stats() somewhere in your theme to see
how many hot/cold hits you're getting. (a hot hit is one where the
object was already cached in memory, a cold one is where it has to be
loaded from the file system, a miss is where it can't be found even
there).

--
-David House, [hidden email], http://xmouse.ithium.net
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: caching doesn't work?

David Chait
In reply to this post by Ryan Boren
Color me confused.  I'd think the majority of folks would be on shared
hosting, in which case 'marginal improvement' would seem rather useless.  So
was this really targeted at some point being implemented with 'a real
backend' for large websites with dedi servers?  Don't get me wrong, with the
growth of WP for really big sites, it's a needed thing -- but I'd think the
page-caching stuff, with an order of magnitude (or two, or three if you use
lighttpd or equiv...) improvement, would be better worth 'core dev cycles'.

I should note that I've had my own home-grown query caching in place for
maybe a year, given that my old host had MySQL servers separate from the
apache boxes, and I figured going to disk is (sometimes) faster than going
across the network to another box which might not be caching well and
hitting a db table which may or may not be fully resident (or the box might
be under heavy loads...).  I saw some decent pageload speed increases due to
elimination of common queries -- but I haven't yet compared my approach to
the new 2.0 object cache (might be redundant, might be I catch extra stuff
that I found more the culprits...).

In any case, might I suggest this conversation could blend into the 2.next
conversation, and that wp-cache (which started as Staticize...) be
considered for direct inclusion in the distro (given the impact it makes)
and direct maintenance as a core element, and that the two different caching
approaches be detailed well enough in docs/codex that people aren't confused
why their performance drops when they upgrade to 2.0 and don't put wp-cache
back into play? ;) ;) ;)

-d

----- Original Message -----
From: "Ryan Boren" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, February 02, 2006 1:47 AM
Subject: Re: [wp-hackers] caching doesn't work?


| Nathan Ollerenshaw wrote:
| > I thought WP_Object_Cache obviates the need for other caching  systems
| > ... but it doesn't seem to make a difference performance-wise  whether
| > it is on or off, though looking at what stats() gives you, it  seems to
| > be 'working'.
| The object cache can't compete with a full static caching system like
| wp-cache, nor is it meant to.  In my ab benchmarks, the persistent
| object cache offered a marginal performance improvement over running
| without persistent caching. The benchmarking was done on a couple of
| shared hosting setups.  On my personal servers, I saw slightly better
| performance, depending on the amount of disk caching.  The real
| advantage of the cache is that it is pluggable.  Thus you can use APC or
| memcached backends.  As for the default backend, on some hosts it simply
| doesn't buy you much.  It all depends.|

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: caching doesn't work?

Peter Westwood
In reply to this post by David House
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David House wrote:

> On 02/02/06, Nathan Ollerenshaw <[hidden email]> wrote:
>> I thought WP_Object_Cache obviates the need for other caching
>> systems ... but it doesn't seem to make a difference performance-wise
>> whether it is on or off, though looking at what stats() gives you, it
>> seems to be 'working'.
>
> Try sticking $wp_object_cache->stats() somewhere in your theme to see
> how many hot/cold hits you're getting. (a hot hit is one where the
> object was already cached in memory, a cold one is where it has to be
> loaded from the file system, a miss is where it can't be found even
> there).
>

I finally finished off the plugin I had been hacking to display this
info in a slightly more accessible way for the admin user.

See: http://blog.ftwr.co.uk/wordpress/wp-cache-inspect/ for more info.

The plugin also exposes an easy to use cache clear button.

westi
- --
Peter Westwood
http://blog.ftwr.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFD5LMyVPRdzag0AcURAuaJAKCxCzaUeQep4xYtam+DRnLH4McE2gCfQWVK
kAVYizd6lxD/DZWZqfhrmgQ=
=gtI+
-----END PGP SIGNATURE-----

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Loading...