[wp-trac] [WordPress Trac] #20316: Garbage collect transients

WordPress Trac noreply at wordpress.org
Thu Sep 12 23:58:23 UTC 2013


#20316: Garbage collect transients
----------------------------------------------+------------------
 Reporter:  nacin                             |       Owner:
     Type:  enhancement                       |      Status:  new
 Priority:  normal                            |   Milestone:  3.7
Component:  Database                          |     Version:
 Severity:  normal                            |  Resolution:
 Keywords:  dev-feedback has-patch 3.7-early  |
----------------------------------------------+------------------

Comment (by dd32):

 One thing to remember about transients is this - '''They're stored in a
 object cache if one is available''', external object caches are not
 guaranteed data storages, set an expiration of an hour, and it may expire
 in 5 minutes, or 30 minutes, but it'll definately expire before, or on,
 the expiration time specified. If no expiration is specified, it may last
 5 seconds, an hour, or maybe a year, it's entirely up to the object cache
 as to when it purges the transient data.

 Anyone using a transient to store data about their plugin, or, to track
 when actions took place are `_doing_it_wrong()` and should be using
 options instead of transients, of course, this doesn't mean that people
 understand this and do the right thing, add any API and people will abuse
 it in weird and amazing ways.
 That's the entire problem here, '''people have been abusing the transient
 API by expecting that their transients ''will'' be cleaned up''', by using
 dynamic transient names, by setting no expiration (which really means,
 never expire this, but i've seen used as "Clean this up next time you come
 through"), and never cleaning up after themselves, or re-using the same
 transient. It's ended up with some people with ''thousands'' of unused
 transients, and others with hundreds of transients each with many 100K's
 of data in each (so suddenly MySQL is sending over 1MB of data to
 WordPress on every page view).

 Something has to change, and as a result, plugins that expect their
 transients to always exist are probably the ones that have to break,
 they're using it wrong and negatively affecting others

--
Ticket URL: <http://core.trac.wordpress.org/ticket/20316#comment:44>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list