User login

What's updating Drupal's cache all the time on this crazy i18n, og, custom site?

Step by step to finding what's wrong.

So after catching a few of the other caches (views, locale) that were running too much for different reasons, we still have a MySQL frenzy on our hands.

The query I see over and over again in Agaric's logs on the WSF2008 site is "INSERT INTO cache (cid, data, created, expire, headers) VALUES ('locale:pt-br', 'a:3757:{s:2\"MB\".....

And "UPDATE cache SET data = 'a:4334:{s:2\"MB\"

By the way, in vi to go to the previous occurrence of a search, to search backwards, it's capital N (shift+N) instead of just n.

These are both found in the function cache_set in http://api.drupal.org/api/file/includes/cache.inc/5/source

<pre>function cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = NULL) {
  db_lock_table($table);
  db_query("UPDATE {". $table. "} SET data = %b, created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $data, time(), $expire, $headers, $cid);
  if (!db_affected_rows()) {
    @db_query("INSERT INTO {". $table. "} (cid, data, created, expire, headers) VALUES ('%s', %b, %d, %d, '%s')", $cid, $data, time(), $expire, $headers);
  }
  db_unlock_tables();
}</pre>

Resolution

Searched words: 
Drupal 5 update cache SET data

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.