Cached queries

Keep Solr answers and show them again, for a time you choose. Off on a new installation.

Cached queries decides whether the panel may keep an answer from Solr and show it again instead of asking Solr a second time, and for how long. It is off on a new installation, and the panel is fully correct either way.

Why it matters: Opensolr meters the responses Solr sends back, so the bandwidth a Loghound installation uses on your plan is almost entirely the panel’s own reads. The cache is the lever on it. It also makes the panel faster when your indexes are far away from the machine Loghound runs on.

01 · Turning it on
  1. Run a memcached server on the same machine, and install the PHP memcached or memcache extension. Loghound expects it at 127.0.0.1:11211; a different address is set as cache.server in the configuration file.
  2. Open Settings › Cached queries and tick Keep Solr answers and re-serve them.
  3. Set An answer is kept for: from 60 to 86,400 seconds, default 7,200 (two hours). A number outside that range is brought back inside it.
  4. Press Save caching.
Keep the cache server private

memcached has no password and no encryption. Run it on 127.0.0.1 or a local socket, never on an address other machines can reach.

02 · What the card tells you
  • Off: every page is computed from Solr as you open it.
  • On: answers are being kept, with where they are held and for how long.
  • On, and not answering: caching is switched on but the cache server does not respond. The panel still works and computes everything from Solr, so you pay the bandwidth you meant to save. Check the server is running and listening on the configured address.
  • When it can say so honestly, the card shows roughly how many reads the cache answered since it was last cleared, and how much response traffic that saved.
03 · How fresh is a number?

With caching on, every card says where its numbers came from: Live when computed for this request, or Computed … · N old when read from the cache. Press Clear cache to throw every kept answer away and recompute.

  • Only successful answers are kept. A failed Solr read is never cached, so one bad minute cannot become two hours of an empty panel.
  • Clearing never empties the whole cache server, so other applications using the same memcached are not affected.
  • A cache server that is missing or stops answering never breaks a page; the panel simply behaves as if caching were off.

Settings

Loghound is open source and MIT licensed. Questions about the Opensolr half — the account, the indexes, the plan — go to opensolr.com/contact; questions about the software itself belong on GitHub.

Loghound Documentation