diff --git a/README.md b/README.md index 5aff9ca2..01533b33 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,8 @@ It contains the following files: You can use the [basic configuration](https://github.com/dice-group/IGUANA/blob/master/example-suite.yml) we provide and modify it to your needs. For further information please visit our [configuration](http://iguana-benchmark.eu/docs/3.2/usage/configuration/) and [Stresstest](http://iguana-benchmark.eu/docs/3.0/usage/stresstest/) wiki pages. For a detailed, step-by-step instruction please attend our [tutorial](http://iguana-benchmark.eu/docs/3.2/usage/tutorial/). + + ## Execute the Benchmark Use the start script @@ -115,3 +117,32 @@ Use the start script ./start-iguana.sh example-suite.yml ``` Now Iguana will execute the example benchmark suite configured in the example-suite.yml file + + +# How to Cite + +```bibtex +@InProceedings{10.1007/978-3-319-68204-4_5, +author="Conrads, Felix +and Lehmann, Jens +and Saleem, Muhammad +and Morsey, Mohamed +and Ngonga Ngomo, Axel-Cyrille", +editor="d'Amato, Claudia +and Fernandez, Miriam +and Tamma, Valentina +and Lecue, Freddy +and Cudr{\'e}-Mauroux, Philippe +and Sequeda, Juan +and Lange, Christoph +and Heflin, Jeff", +title="Iguana: A Generic Framework for Benchmarking the Read-Write Performance of Triple Stores", +booktitle="The Semantic Web -- ISWC 2017", +year="2017", +publisher="Springer International Publishing", +address="Cham", +pages="48--65", +abstract="The performance of triples stores is crucial for applications driven by RDF. Several benchmarks have been proposed that assess the performance of triple stores. However, no integrated benchmark-independent execution framework for these benchmarks has yet been provided. We propose a novel SPARQL benchmark execution framework called Iguana. Our framework complements benchmarks by providing an execution environment which can measure the performance of triple stores during data loading, data updates as well as under different loads and parallel requests. Moreover, it allows a uniform comparison of results on different benchmarks. We execute the FEASIBLE and DBPSB benchmarks using the Iguana framework and measure the performance of popular triple stores under updates and parallel user requests. We compare our results (See https://doi.org/10.6084/m9.figshare.c.3767501.v1) with state-of-the-art benchmarking results and show that our benchmark execution framework can unveil new insights pertaining to the performance of triple stores.", +isbn="978-3-319-68204-4" +} +``` diff --git a/iguana.commons/src/main/java/org/aksw/iguana/commons/streams/Streams.java b/iguana.commons/src/main/java/org/aksw/iguana/commons/streams/Streams.java index ddff712e..55ef9edd 100644 --- a/iguana.commons/src/main/java/org/aksw/iguana/commons/streams/Streams.java +++ b/iguana.commons/src/main/java/org/aksw/iguana/commons/streams/Streams.java @@ -13,6 +13,13 @@ * Helper functions to work with streams. */ public class Streams { + + public static final int bufferSize = 16 * 1024 * 1024; // 16 MB buffer + + protected static final ThreadLocal threadBuffer = ThreadLocal.withInitial(() -> new byte[bufferSize]); + + protected static final ThreadLocal threadByteArrayOutputStream = ThreadLocal.withInitial(() -> new ByteArrayOutputStream(bufferSize)); + /** * Fastest way to serialize a stream to UTF-8 according to https://stackoverflow.com/a/35446009/6800941 * @@ -21,7 +28,8 @@ public class Streams { * @throws IOException from inputStream.read */ static public ByteArrayOutputStream inputStream2String(InputStream inputStream) throws IOException { - ByteArrayOutputStream result = new ByteArrayOutputStream(); + ByteArrayOutputStream result = threadByteArrayOutputStream.get(); + result.reset(); try { inputStream2ByteArrayOutputStream(inputStream, null, -1.0, result); } catch (TimeoutException e) { @@ -61,7 +69,7 @@ static public ByteArrayOutputStream inputStream2String(InputStream inputStream, public static long inputStream2ByteArrayOutputStream(InputStream inputStream, Instant startTime, double timeout, ByteArrayOutputStream result) throws IOException, TimeoutException { assert (result != null); boolean enable_timeout = timeout > 0; - byte[] buffer = new byte[10 * 1024 * 1024]; // 10 MB buffer + byte[] buffer = threadBuffer.get(); int length; while ((length = inputStream.read(buffer)) != -1) { if (enable_timeout && durationInMilliseconds(startTime, Instant.now()) > timeout) @@ -82,7 +90,7 @@ public static long inputStream2ByteArrayOutputStream(InputStream inputStream, In public static long inputStream2ByteArrayOutputStream(InputStream inputStream, ByteArrayOutputStream result) throws IOException { try { return inputStream2ByteArrayOutputStream(inputStream, Instant.now(), -1, result); - }catch(TimeoutException e){ + } catch (TimeoutException e) { //will never happen return 0; } @@ -98,15 +106,14 @@ public static long inputStream2ByteArrayOutputStream(InputStream inputStream, By * @throws TimeoutException Maybe thrown any time after if startTime + timeout is exceed */ static public long inputStream2Length(InputStream inputStream, Instant startTime, double timeout) throws IOException, TimeoutException { - byte[] buffer = new byte[10 * 1024 * 1024]; // 10 MB buffer + byte[] buffer = threadBuffer.get(); long length; long ret = 0; while ((length = inputStream.read(buffer)) != -1) { - if (durationInMilliseconds(startTime, Instant.now()) > timeout && timeout >0) + if (durationInMilliseconds(startTime, Instant.now()) > timeout && timeout > 0) throw new TimeoutException("reading the answer timed out"); ret += length; } return ret; } - } diff --git a/iguana.corecontroller/src/main/java/org/aksw/iguana/cc/worker/impl/HttpWorker.java b/iguana.corecontroller/src/main/java/org/aksw/iguana/cc/worker/impl/HttpWorker.java index 1d4aa5d6..d896c802 100644 --- a/iguana.corecontroller/src/main/java/org/aksw/iguana/cc/worker/impl/HttpWorker.java +++ b/iguana.corecontroller/src/main/java/org/aksw/iguana/cc/worker/impl/HttpWorker.java @@ -136,7 +136,6 @@ synchronized protected void addResultsOnce(QueryExecutionStats queryExecutionSta @Override public void executeQuery(String query, String queryID) { - requestStartTime = Instant.now(); queryId = queryID; resultsSaved = false; requestTimedOut = false; @@ -148,7 +147,8 @@ public void executeQuery(String query, String queryID) { buildRequest(query, queryId); setTimeout(timeOut.intValue()); - + + requestStartTime = Instant.now(); response = client.execute(request, getAuthContext(con.getEndpoint())); // method to process the result in background processHttpResponse();