Question

I want to disable SPARQL query caching of Fuseki server. Can I disable it? And how to do ? I'm considering the following ways:

  1. Using command line argument - It looks unprepared
  2. Using settings file (*.ttl) - I couldn't find notation to disable caching
  3. Edit server code - Basically I won't do it :(

Please tell how can I disable caching.

Was it helpful?

Solution

What caching are you talking about?

As discussed in JENA-388 the current default behaviour is actually to add headers that disable caching so there is not any HTTP level caching.

If you are using the TDB backend then there are caches used to improve query performance and those are not configurable AFAIK. Also even if you could do it turning them off would likely drastically worsen performance so would not be a good idea.

Edit

The --mem option uses a pure in-memory dataset so there is no caching. Be aware that this will actually be much slower than using TDB as you scale up your data and is only faster at small dataset sizes.

If you are looking to benchmark then there are much better ways to eliminate the effect of caches than turning them off since disabling caches (even when you can) won't give you realistic performance numbers. There are several real world ways to eliminate cache effects:

  1. Run warmups - either some fixed number or until you see the system reach a steady state.
  2. Eliminate outliers in your statistics, discard the best and worst N results and compute your statistics over the remainder
  3. Use query parameterisation, use a query template and substitute different constants into it each time thus ensuring you aren't issuing an identical query each time. Query plan caching may still come into effect but as Jena doesn't do this anyway it won't matter for your tests.

You may want to take a look at my 2012 SemTech talk Practical SPARQL Benchmarking and the associated SPARQL Query Benchmarker tool. We've been working on a heavily revised version of the tool lately which has a lot of new features such as support for query parameterisation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top