diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/Server.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/Server.java index f2aa78cdf..dd31ec78d 100644 --- a/src/main/java/ru/vk/itmo/test/chebotinalexandr/Server.java +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/Server.java @@ -1,32 +1,37 @@ package ru.vk.itmo.test.chebotinalexandr; -import one.nio.util.Hash; +import one.nio.async.CustomThreadFactory; import ru.vk.itmo.ServiceConfig; -import ru.vk.itmo.dao.BaseEntry; import ru.vk.itmo.dao.Config; -import ru.vk.itmo.dao.Dao; -import ru.vk.itmo.dao.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.Dao; import ru.vk.itmo.test.chebotinalexandr.dao.NotOnlyInMemoryDao; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.TimestampEntry; import java.io.IOException; import java.lang.foreign.MemorySegment; +import java.net.http.HttpClient; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; +import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; public final class Server { private static final Random RANDOM = new Random(); private static final int ENTRIES_IN_DB = 500_000; - private static final long FLUSH_THRESHOLD_BYTES = 4_194_304L; + private static final long FLUSH_THRESHOLD_BYTES = 4_194_3040L; private static final int BASE_PORT = 8080; private static final int NODES = 3; + private static final int POOL_SIZE = 20; + private static final int QUEUE_CAPACITY = 256; private Server() { @@ -55,18 +60,30 @@ public static void main(String[] args) throws IOException { new NotOnlyInMemoryDao(new Config(config.workingDir(), FLUSH_THRESHOLD_BYTES)); daoCluster[i] = dao; ExecutorService executor = new ThreadPoolExecutor( - 20, - 20, + POOL_SIZE, + POOL_SIZE, 0L, TimeUnit.MILLISECONDS, - new ArrayBlockingQueue<>(256) + new ArrayBlockingQueue<>(QUEUE_CAPACITY) ); - StorageServer server = new StorageServer(config, dao, executor); + + HttpClient httpClient = HttpClient.newBuilder() + .executor( + Executors.newFixedThreadPool( + POOL_SIZE, + new CustomThreadFactory("httpClient") + ) + ) + .connectTimeout(Duration.ofMillis(500)) + .version(HttpClient.Version.HTTP_1_1) + .build(); + + StorageServer server = new StorageServer(config, dao, executor, httpClient); server.start(); } - fillClusterNodesWithMultipleFlush(daoCluster, clusterUrls); + fillClusterNodesWithMultipleFlush(daoCluster); } private static int[] getRandomArray() { @@ -87,49 +104,28 @@ private static int[] getRandomArray() { return entries; } - /** - * Fills all nodes in cluster with multiple sstables. - */ - private static void fillClusterNodesWithMultipleFlush( - Dao[] daoCluster, - List clusterUrls - ) throws IOException { + private static void fillClusterNodesWithMultipleFlush(Dao... daoCluster) throws IOException { final int sstables = 100; //how many sstables dao must create final int flushEntries = ENTRIES_IN_DB / sstables; //how many entries in one sstable - final int[] entriesCountInEachNode = new int[NODES]; final int[] entries = getRandomArray(); + //only for GET tests with from = 3 + int count = 0; for (int entry : entries) { - //select node - int partition = selectNode(("k" + entry), clusterUrls); - - //upsert entry in selected node and increment entry counter - daoCluster[partition].upsert(entry(keyAt(entry), valueAt(entry))); - entriesCountInEachNode[partition]++; - - //check entry counters for ability to flush - for (int j = 0; j < entriesCountInEachNode.length; j++) { - if (entriesCountInEachNode[j] % flushEntries == 0) { - daoCluster[j].flush(); - } + //upsert entry + for (int node = 0; node < NODES; node++) { + daoCluster[node].upsert(entry(keyAt(entry), valueAt(entry))); } - } - } - - private static int selectNode(String id, List clusterUrls) { - Long maxHash = Long.MIN_VALUE; - int partition = -1; + count++; - for (int i = 0; i < clusterUrls.size(); i++) { - String url = clusterUrls.get(i); - long nodeHash = Hash.murmur3(url + id); - if (nodeHash > maxHash) { - maxHash = nodeHash; - partition = i; + //flush nodes + if (count == flushEntries) { + for (Dao dao : daoCluster) { + dao.flush(); + } + count = 0; } } - - return partition; } private static MemorySegment keyAt(int index) { @@ -141,7 +137,7 @@ private static MemorySegment valueAt(int index) { } private static Entry entry(MemorySegment key, MemorySegment value) { - return new BaseEntry<>(key, value); + return new TimestampEntry<>(key, value, 0L); } } diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/StorageServer.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/StorageServer.java index 231a4e0f5..fb2ce0a6c 100644 --- a/src/main/java/ru/vk/itmo/test/chebotinalexandr/StorageServer.java +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/StorageServer.java @@ -3,8 +3,6 @@ import one.nio.http.HttpServer; import one.nio.http.HttpServerConfig; import one.nio.http.HttpSession; -import one.nio.http.Param; -import one.nio.http.Path; import one.nio.http.Request; import one.nio.http.Response; import one.nio.server.AcceptorConfig; @@ -12,46 +10,56 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ru.vk.itmo.ServiceConfig; -import ru.vk.itmo.dao.BaseEntry; -import ru.vk.itmo.dao.Dao; -import ru.vk.itmo.dao.Entry; -import ru.vk.itmo.test.chebotinalexandr.dao.MurmurHash; +import ru.vk.itmo.test.chebotinalexandr.dao.Dao; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.TimestampEntry; import java.io.IOException; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; +import java.net.ConnectException; import java.net.HttpURLConnection; -import java.net.IDN; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.List; +import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.atomic.AtomicBoolean; public class StorageServer extends HttpServer { private static final Logger log = LoggerFactory.getLogger(StorageServer.class); - private static final String PATH = "/v0/entity"; private final Dao> dao; private final ExecutorService executor; private final List clusterUrls; private final String selfUrl; private final HttpClient httpClient; - private AtomicBoolean closed = new AtomicBoolean(); + private final AtomicBoolean closed = new AtomicBoolean(); + private static final String NOT_ENOUGH_REPLICAS = "504 Not Enough Replicas"; + private static final String TIMESTAMP_HEADER = "X-Timestamp"; + private static final String INTERNAL_HEADER = "X-Internal"; + private static final Set allowedMethods = Set.of( + Request.METHOD_GET, + Request.METHOD_PUT, + Request.METHOD_DELETE + ); public StorageServer( ServiceConfig config, - Dao> dao, ExecutorService executor + Dao> dao, + ExecutorService executor, + HttpClient httpClient ) throws IOException { super(createConfig(config)); this.dao = dao; this.executor = executor; this.clusterUrls = config.clusterUrls(); this.selfUrl = config.selfUrl(); - this.httpClient = HttpClient.newHttpClient(); + this.httpClient = httpClient; } private static HttpServerConfig createConfig(ServiceConfig config) { @@ -80,23 +88,44 @@ public synchronized void stop() { } @Override - public void handleRequest(Request request, HttpSession session) { + public void handleRequest(Request request, HttpSession session) throws IOException { + if (!allowedMethods.contains(request.getMethod())) { + sendEmptyBodyResponse(Response.METHOD_NOT_ALLOWED, session); + return; + } + String id = request.getParameter("id="); if (id == null || id.isBlank()) { sendEmptyBodyResponse(Response.BAD_REQUEST, session); return; } + //check for internal request + if (request.getHeader(INTERNAL_HEADER) != null) { + long timestamp = parseTimestamp(request.getHeader(TIMESTAMP_HEADER + ": ")); + Response response = handleRequest(request, id, timestamp); + session.sendResponse(response); + return; + } + + String ackParameter = request.getParameter("ack="); + String fromParameter = request.getParameter("from="); + + int from = fromParameter == null || fromParameter.isBlank() + ? clusterUrls.size() : Integer.parseInt(fromParameter); + int ack = ackParameter == null || ackParameter.isBlank() + ? quorum(from) : Integer.parseInt(ackParameter); + + if (ack > from || ack == 0) { + sendEmptyBodyResponse(Response.BAD_REQUEST, session); + return; + } + try { executor.execute(() -> { try { int partition = selectPartition(id); - - if (isCurrentPartition(partition)) { - super.handleRequest(request, session); - } else { - routeRequest(partition, request, session); - } + pickResponses(request, session, id, ack, from, partition); } catch (IOException e) { log.error("Exception during handleRequest: ", e); sendEmptyBodyResponse(Response.INTERNAL_ERROR, session); @@ -111,15 +140,123 @@ public void handleRequest(Request request, HttpSession session) { } } - private void routeRequest( + private void pickResponses( + Request request, + HttpSession session, + String id, + int ack, + int from, + int partition + ) throws IOException, InterruptedException { + long timestamp = System.currentTimeMillis(); + List responses = new ArrayList<>(); + int httpMethod = request.getMethod(); + + for (int i = 0; i < from; i++) { + int nodeIndex = (partition + i) % clusterUrls.size(); + + Response response; + + if (isCurrentPartition(nodeIndex)) { + response = handleRequest(request, id, timestamp); + } else { + response = remote(request, timestamp, nodeIndex); + } + + if (response != null) { + responses.add(response); + } + + boolean enough = compareReplicasResponses(httpMethod, session, responses, ack); + if (enough) { + return; + } + } + + if (responses.size() < ack) { + sendEmptyBodyResponse(NOT_ENOUGH_REPLICAS, session); + } + } + + private boolean compareReplicasResponses( + int httpMethod, + HttpSession session, + List responses, + int ack + ) throws IOException { + boolean enough = responses.size() >= ack; + + if (enough) { + if (httpMethod == Request.METHOD_PUT || httpMethod == Request.METHOD_DELETE) { + session.sendResponse(responses.getFirst()); + return false; + } else { + session.sendResponse(findLastWriteResponse(responses)); + return true; + } + } + + return false; + } + + private Response findLastWriteResponse(List responses) { + Response result = responses.getFirst(); + long maxTimestamp = 0; + for (Response response : responses) { + String timestampHeader = response.getHeader(TIMESTAMP_HEADER + ": "); + + if (timestampHeader != null) { + long timestamp = parseTimestamp(timestampHeader); + if (maxTimestamp < timestamp) { + maxTimestamp = timestamp; + result = response; + } + } + } + + return result; + } + + private long parseTimestamp(String timestampHeader) { + return Long.parseLong(timestampHeader); + } + + private Response remote( + Request request, + long timestamp, + int nodeIndex + ) throws IOException, InterruptedException { + Response response = null; + try { + Response responseFromNode = routeRequest(nodeIndex, request, timestamp); + if ((responseFromNode.getStatus() == 201) + || (responseFromNode.getStatus() == 200) + || (responseFromNode.getStatus() == 404) + || (responseFromNode.getStatus() == 202)) { + response = responseFromNode; + } + } catch (ConnectException e) { + log.info("Can't connect to node " + nodeIndex); + } + + return response; + } + + private int quorum(int from) { + return from / 2 + 1; + } + + private Response routeRequest( int partition, Request request, - HttpSession session + long timestamp ) throws IOException, InterruptedException { String partitionUrl = getPartitionUrl(partition) + request.getURI(); HttpRequest newRequest = HttpRequest.newBuilder() .uri(URI.create(partitionUrl)) + .header(INTERNAL_HEADER, "true") + .header(TIMESTAMP_HEADER, String.valueOf(timestamp)) .method( request.getMethodName(), HttpRequest.BodyPublishers.ofByteArray( @@ -129,7 +266,7 @@ private void routeRequest( .build(); HttpResponse response = httpClient.send(newRequest, HttpResponse.BodyHandlers.ofByteArray()); - session.sendResponse(extractResponseFromNode(response)); + return extractResponseFromNode(response); } private Response extractResponseFromNode(HttpResponse response) { @@ -143,7 +280,15 @@ private Response extractResponseFromNode(HttpResponse response) { default -> throw new IllegalStateException("Can not define response code:" + response.statusCode()); }; - return new Response(responseCode, response.body()); + Response converted = new Response(responseCode, response.body()); + response + .headers() + .firstValue(TIMESTAMP_HEADER) + .ifPresent( + v -> converted.addHeader(TIMESTAMP_HEADER + ": " + v) + ); + + return converted; } private boolean isCurrentPartition(int partitionNumber) { @@ -151,7 +296,7 @@ private boolean isCurrentPartition(int partitionNumber) { } private int selectPartition(String id) { - Long maxHash = Long.MIN_VALUE; + long maxHash = Long.MIN_VALUE; int partition = -1; for (int i = 0; i < clusterUrls.size(); i++) { @@ -170,35 +315,49 @@ private String getPartitionUrl(int partition) { return clusterUrls.get(partition); } - @Path(PATH) - public Response entity(Request request, @Param("id") String id) { + private Response handleRequest(Request request, String id, long timestamp) { switch (request.getMethod()) { case Request.METHOD_GET -> { Entry entry = dao.get(fromString(id)); if (entry == null) { + //not a tombstone return new Response(Response.NOT_FOUND, Response.EMPTY); + } else if (entry.value() == null) { + //tombstone + Response response = new Response(Response.NOT_FOUND, Response.EMPTY); + response.addHeader(TIMESTAMP_HEADER + ": " + entry.timestamp()); + return response; } else { - return Response.ok(toBytes(entry.value())); + Response response = Response.ok(toBytes(entry.value())); + response.addHeader(TIMESTAMP_HEADER + ": " + entry.timestamp()); + return response; } } case Request.METHOD_PUT -> { - Entry entry = new BaseEntry<>( + Entry entry = new TimestampEntry<>( fromString(id), - fromBytes(request.getBody()) + fromBytes(request.getBody()), + timestamp ); dao.upsert(entry); - return new Response(Response.CREATED, Response.EMPTY); + Response response = new Response(Response.CREATED, Response.EMPTY); + response.addHeader(TIMESTAMP_HEADER + ": " + entry.timestamp()); + return response; } case Request.METHOD_DELETE -> { - Entry entry = new BaseEntry<>( + //tombstone + Entry entry = new TimestampEntry<>( fromString(id), - null + null, + timestamp ); dao.upsert(entry); - return new Response(Response.ACCEPTED, Response.EMPTY); + Response response = new Response(Response.ACCEPTED, Response.EMPTY); + response.addHeader(TIMESTAMP_HEADER + ": " + entry.timestamp()); + return response; } default -> { return new Response(Response.METHOD_NOT_ALLOWED, Response.EMPTY); diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/StorageService.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/StorageService.java index 6519a25b8..0a483376c 100644 --- a/src/main/java/ru/vk/itmo/test/chebotinalexandr/StorageService.java +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/StorageService.java @@ -1,18 +1,22 @@ package ru.vk.itmo.test.chebotinalexandr; +import one.nio.async.CustomThreadFactory; import ru.vk.itmo.Service; import ru.vk.itmo.ServiceConfig; import ru.vk.itmo.dao.Config; -import ru.vk.itmo.dao.Dao; -import ru.vk.itmo.dao.Entry; import ru.vk.itmo.test.ServiceFactory; +import ru.vk.itmo.test.chebotinalexandr.dao.Dao; import ru.vk.itmo.test.chebotinalexandr.dao.NotOnlyInMemoryDao; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.Entry; import java.io.IOException; import java.lang.foreign.MemorySegment; +import java.net.http.HttpClient; +import java.time.Duration; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -39,8 +43,18 @@ public CompletableFuture start() throws IOException { TimeUnit.MILLISECONDS, new ArrayBlockingQueue<>(QUEUE_CAPACITY) ); + HttpClient httpClient = HttpClient.newBuilder() + .executor( + Executors.newFixedThreadPool( + POOL_SIZE, + new CustomThreadFactory("httpClient") + ) + ) + .connectTimeout(Duration.ofMillis(500)) + .version(HttpClient.Version.HTTP_1_1) + .build(); - this.server = new StorageServer(config, dao, executor); + this.server = new StorageServer(config, dao, executor, httpClient); server.start(); return CompletableFuture.completedFuture(null); @@ -67,7 +81,7 @@ public void waitForShutdown() { } } - @ServiceFactory(stage = 3) + @ServiceFactory(stage = 4) public static class Factory implements ServiceFactory.Factory { @Override diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/Dao.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/Dao.java new file mode 100644 index 000000000..b9d3567f4 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/Dao.java @@ -0,0 +1,89 @@ +package ru.vk.itmo.test.chebotinalexandr.dao; + +import ru.vk.itmo.test.chebotinalexandr.dao.entry.Entry; + +import java.io.Closeable; +import java.io.IOException; +import java.util.Iterator; + +public interface Dao> extends Closeable { + /** + * Returns ordered iterator of entries with keys between from (inclusive) and to (exclusive). + * @param from lower bound of range (inclusive) + * @param to upper bound of range (exclusive) + * @return entries [from;to) + */ + Iterator get(D from, D to); + + /** + * Returns entry by key. Note: default implementation is far from optimal. + * @param key entry`s key + * @return entry + */ + default E get(D key) { + Iterator iterator = get(key, null); + if (!iterator.hasNext()) { + return null; + } + + E next = iterator.next(); + if (next.key().equals(key)) { + return next; + } + return null; + } + + /** + * Returns ordered iterator of all entries with keys from (inclusive). + * @param from lower bound of range (inclusive) + * @return entries with key >= from + */ + default Iterator allFrom(D from) { + return get(from, null); + } + + /** + * Returns ordered iterator of all entries with keys < to. + * @param to upper bound of range (exclusive) + * @return entries with key < to + */ + default Iterator allTo(D to) { + return get(null, to); + } + + /** + * Returns ordered iterator of all entries. + * @return all entries + */ + default Iterator all() { + return get(null, null); + } + + /** + * Inserts of replaces entry. + * @param entry element to upsert + */ + void upsert(E entry); + + /** + * Persists data (no-op by default). + */ + default void flush() throws IOException { + // Do nothing + } + + /** + * Compacts data (no-op by default). + */ + default void compact() throws IOException { + // Do nothing + } + + /* + * Releases Dao (calls flush by default). + */ + @Override + default void close() throws IOException { + flush(); + } +} diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/DaoState.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/DaoState.java index c5b57f5a3..924ec6e0c 100644 --- a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/DaoState.java +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/DaoState.java @@ -1,6 +1,6 @@ package ru.vk.itmo.test.chebotinalexandr.dao; -import ru.vk.itmo.dao.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.Entry; import java.lang.foreign.MemorySegment; import java.util.ArrayList; diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/NotOnlyInMemoryDao.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/NotOnlyInMemoryDao.java index 0c747aee9..30644a80f 100644 --- a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/NotOnlyInMemoryDao.java +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/NotOnlyInMemoryDao.java @@ -1,8 +1,7 @@ package ru.vk.itmo.test.chebotinalexandr.dao; import ru.vk.itmo.dao.Config; -import ru.vk.itmo.dao.Dao; -import ru.vk.itmo.dao.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.Entry; import java.io.IOException; import java.io.UncheckedIOException; @@ -88,11 +87,11 @@ public Entry get(MemorySegment key) { Entry result = currState.getWriteEntries().get(key); if (result != null) { - return result.value() == null ? null : result; + return result; } result = currState.getReadEntries().get(key); if (result != null) { - return result.value() == null ? null : result; + return result; } return getFromDisk(key, currState); @@ -210,7 +209,7 @@ private MemorySegment performCompact(List segments) throws IOExce long newBloomFilterLength = BloomFilter.bloomFilterLength(entryCount, BLOOM_FILTER_FPP); - sizeForCompaction += 2L * Long.BYTES * nonEmptyEntryCount; + sizeForCompaction += 3L * Long.BYTES * nonEmptyEntryCount; sizeForCompaction += 3L * Long.BYTES + Long.BYTES * nonEmptyEntryCount; //for metadata (header + key offsets) sizeForCompaction += Long.BYTES * newBloomFilterLength; //for bloom filter diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTableIterator.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTableIterator.java index 306cd77d2..88ec1aade 100644 --- a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTableIterator.java +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTableIterator.java @@ -1,7 +1,7 @@ package ru.vk.itmo.test.chebotinalexandr.dao; -import ru.vk.itmo.dao.BaseEntry; -import ru.vk.itmo.dao.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.TimestampEntry; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; @@ -36,7 +36,7 @@ public Entry next() { } private Entry next(long index) { - long offset = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, keyOffset + index * Byte.SIZE); + long offset = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, keyOffset + index * Long.BYTES); //key size offset long keySize = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, offset); offset += Long.BYTES; MemorySegment key = sstable.asSlice(offset, keySize); @@ -45,9 +45,14 @@ private Entry next(long index) { offset += Long.BYTES; if (valueSize == TOMBSTONE) { - return new BaseEntry<>(key, null); + long timestamp = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, offset); + return new TimestampEntry<>(key, null, timestamp); } else { - return new BaseEntry<>(key, sstable.asSlice(offset, valueSize)); + MemorySegment value = sstable.asSlice(offset, valueSize); + offset += valueSize; + long timestamp = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, offset); + + return new TimestampEntry<>(key, value, timestamp); } } } diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTableUtils.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTableUtils.java index 31c7ae044..cae3ed925 100644 --- a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTableUtils.java +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTableUtils.java @@ -1,7 +1,7 @@ package ru.vk.itmo.test.chebotinalexandr.dao; -import ru.vk.itmo.dao.BaseEntry; -import ru.vk.itmo.dao.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.TimestampEntry; import java.io.FileNotFoundException; import java.io.IOException; @@ -85,20 +85,25 @@ public static Entry get(MemorySegment readSegment, MemorySegment } private static Entry get(MemorySegment sstable, long index, long afterBloomFilterOffset) { - long offset = afterBloomFilterOffset + index * Byte.SIZE; + long keyOffset = afterBloomFilterOffset + index * Long.BYTES; - long keyOffset = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, offset); - long keySize = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, keyOffset); - keyOffset += Long.BYTES; - MemorySegment key = sstable.asSlice(keyOffset, keySize); - keyOffset += keySize; - long valueSize = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, keyOffset); - keyOffset += Long.BYTES; + long offset = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, keyOffset); //key size offset + long keySize = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, offset); + offset += Long.BYTES; + MemorySegment key = sstable.asSlice(offset, keySize); + offset += keySize; + long valueSize = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, offset); + offset += Long.BYTES; if (valueSize == TOMBSTONE) { - return new BaseEntry<>(key, null); + long timestamp = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, offset); + return new TimestampEntry<>(key, null, timestamp); } else { - return new BaseEntry<>(key, sstable.asSlice(keyOffset, valueSize)); + MemorySegment value = sstable.asSlice(offset, valueSize); + offset += valueSize; + long timestamp = sstable.get(ValueLayout.JAVA_LONG_UNALIGNED, offset); + + return new TimestampEntry<>(key, value, timestamp); } } @@ -138,14 +143,6 @@ public static void deleteOldSSTables(Path basePath) throws IOException { } } - public static long entryByteSize(Entry entry) { - if (entry.value() == null) { - return entry.key().byteSize(); - } - - return entry.key().byteSize() + entry.value().byteSize(); - } - public static long sizeOf(final Entry entry) { if (entry == null) { return 0L; @@ -155,6 +152,6 @@ public static long sizeOf(final Entry entry) { return entry.key().byteSize(); } - return entry.key().byteSize() + entry.value().byteSize(); + return entry.key().byteSize() + entry.value().byteSize() + Long.BYTES; //k + v + timestamp } } diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTablesStorage.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTablesStorage.java index 6a5a14959..a8a607ae0 100644 --- a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTablesStorage.java +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SSTablesStorage.java @@ -1,6 +1,6 @@ package ru.vk.itmo.test.chebotinalexandr.dao; -import ru.vk.itmo.dao.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.Entry; import java.io.FileNotFoundException; import java.io.IOException; @@ -25,8 +25,8 @@ import static ru.vk.itmo.test.chebotinalexandr.dao.SSTableUtils.binarySearch; import static ru.vk.itmo.test.chebotinalexandr.dao.SSTableUtils.deleteOldSSTables; -import static ru.vk.itmo.test.chebotinalexandr.dao.SSTableUtils.entryByteSize; import static ru.vk.itmo.test.chebotinalexandr.dao.SSTableUtils.restoreCompaction; +import static ru.vk.itmo.test.chebotinalexandr.dao.SSTableUtils.sizeOf; public class SSTablesStorage { private static final long TOMBSTONE = -1; @@ -35,7 +35,7 @@ public class SSTablesStorage { private static final long OLDEST_SS_TABLE_INDEX = 0; private static final long COMPACTION_NOT_FINISHED_TAG = -1; private final Path basePath; - public static final int HASH_FUNCTIONS_NUM = 2; + public static final int HASH_FUNCTIONS_NUM = 2; //for bloom filter private static final SSTableOffsets offsetsConfig = new SSTableOffsets(Long.BYTES, 0, 2L * Long.BYTES); private static int sstablesCount; @@ -158,32 +158,40 @@ public static Iterator> iteratorOf( * │─────────────────────│─────────────────────────│─────────────────────│ * │ BF array length │ Hash functions count │ Entries count │ * └─────────────────────┴─────────────────────────┴─────────────────────┘ + * where BF is bloom filter. * SStable bloom filter: * ┌────────────────────────────┐ - * │ 8 x BloomFilter array size │ + * │ 8 x BF array length │ * │────────────────────────────│ - * │ Hash_i │ + * │ hash_i │ * └────────────────────────────┘ - * where i = 1, ... , bloom filter array size + * where i = 1, ... , bloom filter array length * SStable data format: - * ┌─────────────────────┬──────────┬──────────┬────────────┬────────────┐ - * │ 8 x Entries count │ 8 │ Key size │ 8 │ Value size │ - * │─────────────────────│──────────│──────────│────────────│────────────│ - * │ Key_j offset │ Key size │ Key │ Value size │ Value │ - * └─────────────────────┴──────────┴──────────┴────────────┴────────────┘ - * where j = 1, ... , entries count. + * ┌─────────────────────┬──────────┬──────────┬────────────┬────────────┬────────────┐ + * │ 8 x Entries count │ 8 │ Key size │ 8 │ Value size │ 8 │ + * │─────────────────────│──────────│──────────┬────────────┬────────────┬────────────│ + * │ key_i offset │ Key size │ Key │ Value size │ Value │ Timestamp │ + * └─────────────────────┴──────────┴──────────┴────────────┴────────────┴────────────┘ + * where i = 1, ... , entries count. + * If entry is tombstone, sstable has next format: + * ┌──────────┬──────────┬────────────┬────────────┐ + * │ 8 │ Key size │ 8 │ 8 │ + * │──────────│──────────│────────────│────────────│ + * │ Key size │ Key │ -1 │ Timestamp │ + * └──────────┴──────────┴────────────┴────────────┘ + * where -1 is tombstone tag */ public static MemorySegment write(Collection> dataToFlush, double bloomFilterFPP, Path basePath) throws IOException { long size = 0; for (Entry entry : dataToFlush) { - size += entryByteSize(entry); + size += sizeOf(entry); } long bloomFilterLength = BloomFilter.bloomFilterLength(dataToFlush.size(), bloomFilterFPP); - size += 2L * Long.BYTES * dataToFlush.size(); + size += 3L * Long.BYTES * dataToFlush.size(); size += 3L * Long.BYTES + (long) Long.BYTES * dataToFlush.size(); //for metadata (header + key offsets) size += Long.BYTES * bloomFilterLength; //for bloom filter @@ -219,25 +227,38 @@ public static MemorySegment write(Collection> dataToFlush, i++; } //--------- - sstablesCount++; return memorySegment; } private static long writeEntry(Entry entry, MemorySegment dst, long offset) { - long newOffset = writeSegment(entry.key(), dst, offset); + long newOffset = writeKey(entry.key(), dst, offset); if (entry.value() == null) { dst.set(ValueLayout.JAVA_LONG_UNALIGNED, newOffset, TOMBSTONE); newOffset += Long.BYTES; + dst.set(ValueLayout.JAVA_LONG_UNALIGNED, newOffset, entry.timestamp()); + newOffset += Long.BYTES; } else { - newOffset = writeSegment(entry.value(), dst, newOffset); + newOffset = writeValue(entry.value(), dst, newOffset, entry.timestamp()); } + return newOffset; + } + + private static long writeKey(MemorySegment src, MemorySegment dst, long offset) { + long size = src.byteSize(); + long newOffset = offset; + + dst.set(ValueLayout.JAVA_LONG_UNALIGNED, newOffset, size); + newOffset += Long.BYTES; + MemorySegment.copy(src, 0, dst, newOffset, size); + newOffset += size; return newOffset; } - private static long writeSegment(MemorySegment src, MemorySegment dst, long offset) { + //writes value with timestamp + private static long writeValue(MemorySegment src, MemorySegment dst, long offset, long timestamp) { long size = src.byteSize(); long newOffset = offset; @@ -245,6 +266,8 @@ private static long writeSegment(MemorySegment src, MemorySegment dst, long offs newOffset += Long.BYTES; MemorySegment.copy(src, 0, dst, newOffset, size); newOffset += size; + dst.set(ValueLayout.JAVA_LONG_UNALIGNED, newOffset, timestamp); + newOffset += Long.BYTES; return newOffset; } @@ -256,9 +279,7 @@ public MemorySegment compact(Iterator> iterator, MemorySegment memorySegment; try (Arena arenaForCompact = Arena.ofShared()) { try (FileChannel channel = FileChannel.open(path, - StandardOpenOption.READ, - StandardOpenOption.WRITE, - StandardOpenOption.CREATE)) { + StandardOpenOption.READ, StandardOpenOption.WRITE, StandardOpenOption.CREATE)) { memorySegment = channel.map(FileChannel.MapMode.READ_WRITE, 0, sizeForCompaction, arenaForCompact); } @@ -281,14 +302,14 @@ public MemorySegment compact(Iterator> iterator, final long keyOffset = bloomFilterOffset + bfLength * Long.BYTES; long offset = keyOffset + Long.BYTES * entryCount; - long index = 0; + long i = 0; while (iterator.hasNext()) { Entry entry = iterator.next(); BloomFilter.addToSstable(entry.key(), memorySegment, HASH_FUNCTIONS_NUM, bfLength * Long.SIZE); - memorySegment.set(ValueLayout.JAVA_LONG_UNALIGNED, keyOffset + index * Long.BYTES, offset); + memorySegment.set(ValueLayout.JAVA_LONG_UNALIGNED, keyOffset + i * Long.BYTES, offset); offset = writeEntry(entry, memorySegment, offset); - index++; + i++; } memorySegment.set(ValueLayout.JAVA_LONG_UNALIGNED, offsetsConfig.getEntriesSizeOffset(), entryCount); @@ -300,21 +321,16 @@ public MemorySegment compact(Iterator> iterator, private static void finishCompact(Path basePath) throws IOException { Path path = basePath.resolve(SSTABLE_NAME + ".tmp"); - deleteOldSSTables(basePath); Files.move(path, path.resolveSibling(SSTABLE_NAME + OLDEST_SS_TABLE_INDEX + SSTABLE_EXTENSION), StandardCopyOption.ATOMIC_MOVE); - sstablesCount = 1; } private static MemorySegment writeMappedSegment(Path basePath, long size, Arena arena) throws IOException { Path path = basePath.resolve(SSTABLE_NAME + sstablesCount + SSTABLE_EXTENSION); try (FileChannel channel = FileChannel.open(path, - StandardOpenOption.READ, - StandardOpenOption.WRITE, - StandardOpenOption.CREATE)) { - + StandardOpenOption.READ, StandardOpenOption.WRITE, StandardOpenOption.CREATE)) { return channel.map(FileChannel.MapMode.READ_WRITE, 0, size, arena); } } diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SkipTombstoneIterator.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SkipTombstoneIterator.java index 758954707..d50e93814 100644 --- a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SkipTombstoneIterator.java +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/SkipTombstoneIterator.java @@ -1,6 +1,6 @@ package ru.vk.itmo.test.chebotinalexandr.dao; -import ru.vk.itmo.dao.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.Entry; import java.lang.foreign.MemorySegment; import java.util.Iterator; diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/State.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/State.java index 40c73cea0..d5591c79c 100644 --- a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/State.java +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/State.java @@ -1,6 +1,6 @@ package ru.vk.itmo.test.chebotinalexandr.dao; -import ru.vk.itmo.dao.Entry; +import ru.vk.itmo.test.chebotinalexandr.dao.entry.Entry; import java.lang.foreign.MemorySegment; import java.util.ArrayList; @@ -31,8 +31,7 @@ private static SortedMap> createMap() { } public static State initial(List segments) { - return new State(createMap(), createMap(), segments - ); + return new State(createMap(), createMap(), segments); } public State compact(MemorySegment compacted) { diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/entry/Entry.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/entry/Entry.java new file mode 100644 index 000000000..904e421f4 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/entry/Entry.java @@ -0,0 +1,9 @@ +package ru.vk.itmo.test.chebotinalexandr.dao.entry; + +public interface Entry { + D key(); + + D value(); + + long timestamp(); +} diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/entry/TimestampEntry.java b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/entry/TimestampEntry.java new file mode 100644 index 000000000..747cece1c --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/dao/entry/TimestampEntry.java @@ -0,0 +1,8 @@ +package ru.vk.itmo.test.chebotinalexandr.dao.entry; + +public record TimestampEntry(D key, D value, long timestamp) implements Entry { + @Override + public String toString() { + return "{" + key + ":" + value + ":" + timestamp + "}"; + } +} diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/report/stage4.md b/src/main/java/ru/vk/itmo/test/chebotinalexandr/report/stage4.md new file mode 100644 index 000000000..9d8703a5a --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/report/stage4.md @@ -0,0 +1,153 @@ +# Отчёт по "Этап 4. Репликация" + +### Формат SSTable + +В случае конфликтов, когда ноды возвращают разные ответы, был использован timestamp, таким образом +реализован last write wins. Формат SSTable был изменен для хранения timestamp. + +SStable Header следующего формата: + +| 8 | 8 | 8 | +|-----------------------|------------------------|-----------------| +| `Bloom filter length` | `Hash functions count` | `entries count` | + +SStable Bloom filter следующего формата: + +| 8 | 8 | ... | 8 | +|--------|--------|-----------|--------| +| `hash_0` | `hash_1` | `hash_i...` | `hash_n` | + +где `n` - размер фильтра Блума (`Bloom filter length`) + +| 8 x entries count | 8 | key size | 8 | value size | 8 | +|----------------------|-----------|----------|-------------|------------|-----------| +| `key_i offset` | `key size` | `key` | `value size` | `value` | `timestamp` | + +где `i = 0, 1, ..., entries count` + +Если же наша `entry` это `tombstone`, то `entry` записывается в следующем формате: + +| 8 | key size | 8 | 8 | +|-----------|----------|-----|-------------| +| `key size` | key | `-1` | `timestamp` | + +где `-1` это tombstone tag. Таким образом в случае могилки, value не сохранится при `flush`, а `-1` подставляется на место value size. + +Timestamp всегда фиксируется в мастер ноде и далее в случае proxy запроса передается вместе с proxy запросом другой ноде. + + +### Latency: что с ним стало? + +В дальнейших исследованиях будем использовать кластер из 3-ех нод, `ack/from = 2/3`. Порог на flush тот же самый - `4 МБ`. На прошлом этапе база без репликации давала следующие показатели (точки разладки): + +| | SYNCHRONOUS | ASYNCHRONOUS | ASYNCHRONOUS + SHARDING | +|-------------|-------------|--------------|-------------------------| +| PUT MAX RPS | 40k | 130k | 18 500 | +| GET MAX RPS | 30k | 100k | 17 000 | + + +Детательным регулированием нагрузки с шагом в 500 rps была определена точка разладки для PUT-запросов: + +``` +./wrk -c 64 -d 20 -t 4 -L -R 1200 -s upsert-script.lua http://localhost:8080 + + + Thread Stats Avg Stdev Max +/- Stdev + Latency 3.66ms 6.57ms 64.35ms 94.33% + Req/Sec 308.50 129.79 380.00 83.33% + Latency Distribution (HdrHistogram - Recorded Latency) + 90.000% 5.54ms + 99.000% 38.02ms + 99.900% 60.45ms + 99.990% 64.32ms + 99.999% 64.38ms +100.000% 64.38ms +``` + +Latency сильно просел, теперь точка разладки для PUT запросов составляет всего 1200 rps. + +Точно таким же образом была определена точка разладки и для GET-запросов: + +``` +./wrk -c 64 -d 20 -t 4 -L -R 400 -s get-script.lua http://localhost:8080 + + + Thread Stats Avg Stdev Max +/- Stdev + Latency 6.43ms 10.05ms 80.77ms 92.93% + Req/Sec 73.22 57.87 129.00 62.50% + Latency Distribution (HdrHistogram - Recorded Latency) + 90.000% 11.86ms + 99.000% 57.66ms + 99.900% 78.46ms + 99.990% 80.83ms + 99.999% 80.83ms +100.000% 80.83ms +``` + +У нас в несколько раз просел rps, таким образом имеем следующее: + +| | SYNCHRONOUS | ASYNCHRONOUS | ASYNCHRONOUS + SHARDING | ASYNCHRONOUS + SHARDING + REPLICATION | +|-------------|-------------|--------------|-------------------------|---------------------------------------| +| PUT MAX RPS | 40k | 130k | 18 500 | 1200 | +| GET MAX RPS | 30k | 100k | 17 000 | 400 | + +Добавление репликации сыграло критическую роль. Если в кластере будет еще больше нод - rps соответственно снизится. +При дефолтных значениях параметров ack/from мы больше общаемся с другими нодами - возрастают затраты времени на +отправку запросов и получение ответов. В случае GET запросов серверу необходимо в `ack` раз больше общаться по HTTP с другими нодами. + + +### Анализ профилирования + + +#### PUT, cpu + +![](../wrk_results/stage4/imgs/profile-cpu-put.png) + +Сравнивая данный профиль с версией без репликации, особых отличий нет, единственное, на профиле cpu реплицированной +версии видно, что ThreadPoolExecutor выполняет еще и отправку запросов другим нодам, помимо локальной обработки запроса. + + +#### PUT, alloc + +![](../wrk_results/stage4/imgs/profile-alloc-put.png) + +Сравнивая данный профиль с версией без репликации, особых отличий не наблюдается. +Заметно, что в SelectorThread аллокации увеличились примерно на 2%. Это связано с методом +`parseTimestamp` для того, чтобы из заголовка ответа достать timestamp и далее производить сравнения +ответов разных нод. + +#### PUT, lock + +![](../wrk_results/stage4/imgs/profile-lock-put.png) + +Видно что в версии с репликацией значительно добавились локи при обработке запроса. +Можно улучшить данное решение, если внутреннее сетевое взаимодействие узлов сделать асинхронным, +таким образом, если потоки не будут блокироваться, данный профиль изменится. + +А сейчас, чем больше задач приходит воркерам, тем больше локов. + +#### GET, cpu + +![](../wrk_results/stage4/imgs/profile-cpu-get.png) + +Особых изменений не наблюдается. + +#### GET, alloc + +![](../wrk_results/stage4/imgs/profile-alloc-get.png) + +Здесь хорошо заметно что увеличились аллокации в пуле воркеров, связано это с общением с другими нодами. +Касательно того что под капотом Dao: во время профилирования база нагружалась +GET-запросами с `ack/from = 2/3`, соответственно здесь немного больше работы по поиску на диске. Но все же эти аллокации не увеличились так, как аллокации во время работы по сети. + +#### GET, lock + +![](../wrk_results/stage4/imgs/profile-lock-get.png) + +Опять же появилось больше локов, связанных с общением нод. + + +Подытоживая, имеем заметное ухудшение производительности, но теперь мы данные храним сразу на нескольких нодах, получив большую +отказоустойчивость. Можно поменять протокол на более эффективный, +можно переключить сетевое взаимодействие на асинхронное, чтобы избавиться +от блокировки потоков. \ No newline at end of file diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-alloc-get.png b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-alloc-get.png new file mode 100644 index 000000000..585813c0e Binary files /dev/null and b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-alloc-get.png differ diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-alloc-put.png b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-alloc-put.png new file mode 100644 index 000000000..b6e0034e1 Binary files /dev/null and b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-alloc-put.png differ diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-cpu-get.png b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-cpu-get.png new file mode 100644 index 000000000..85a0f8131 Binary files /dev/null and b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-cpu-get.png differ diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-cpu-put.png b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-cpu-put.png new file mode 100644 index 000000000..abdb4559a Binary files /dev/null and b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-cpu-put.png differ diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-lock-get.png b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-lock-get.png new file mode 100644 index 000000000..0e2689045 Binary files /dev/null and b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-lock-get.png differ diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-lock-put.png b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-lock-put.png new file mode 100644 index 000000000..06ad323d8 Binary files /dev/null and b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/imgs/profile-lock-put.png differ diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-alloc-get.html b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-alloc-get.html new file mode 100644 index 000000000..76af4dc69 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-alloc-get.html @@ -0,0 +1,3100 @@ + + + + + + + +

Allocation profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-alloc-put.html b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-alloc-put.html new file mode 100644 index 000000000..574a55584 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-alloc-put.html @@ -0,0 +1,3261 @@ + + + + + + + +

Allocation profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-cpu-get.html b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-cpu-get.html new file mode 100644 index 000000000..d3c100010 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-cpu-get.html @@ -0,0 +1,5010 @@ + + + + + + + +

CPU profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-cpu-put.html b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-cpu-put.html new file mode 100644 index 000000000..e19c0ab43 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-cpu-put.html @@ -0,0 +1,8065 @@ + + + + + + + +

CPU profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-lock-get.html b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-lock-get.html new file mode 100644 index 000000000..fb330df38 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-lock-get.html @@ -0,0 +1,1027 @@ + + + + + + + +

Lock profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-lock-put.html b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-lock-put.html new file mode 100644 index 000000000..c22a27a79 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/chebotinalexandr/wrk_results/stage4/profiles/profile-lock-put.html @@ -0,0 +1,1113 @@ + + + + + + + +

Lock profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/dao/SSTableManager.java b/src/main/java/ru/vk/itmo/test/kovalevigor/dao/SSTableManager.java index 1795fd069..6b415ff34 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/dao/SSTableManager.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/dao/SSTableManager.java @@ -87,7 +87,7 @@ public static SizeInfo getMapSize(final SortedMap value = entry.getValue(); keysSize += entry.getKey().byteSize(); - valuesSize += value.valueSize(); + valuesSize += value == null ? 0 : value.valueSize(); } return new SizeInfo(map.size(), keysSize, valuesSize); } diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/dao/SegmentWriter.java b/src/main/java/ru/vk/itmo/test/kovalevigor/dao/SegmentWriter.java index 3295ba568..dac9a0b18 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/dao/SegmentWriter.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/dao/SegmentWriter.java @@ -19,7 +19,7 @@ public SegmentWriter(final Path path, final long size, final Arena arena) throws } protected static long writeLong(final MemorySegment memorySegment, final long offset, final long value) { - memorySegment.set(ValueLayout.JAVA_LONG, offset, value); + memorySegment.set(ValueLayout.JAVA_LONG_UNALIGNED, offset, value); return offset + ValueLayout.JAVA_LONG.byteSize(); } diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_10000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_10000_wrk.txt new file mode 100644 index 000000000..abf47e21f --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_10000_wrk.txt @@ -0,0 +1,119 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.244ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.259ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.238ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.266ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.252ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.249ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.268ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.242ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.24ms 539.73us 5.31ms 67.44% + Req/Sec 1.32k 122.44 1.89k 70.36% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.20ms + 75.000% 1.58ms + 90.000% 1.93ms + 99.000% 2.68ms + 99.900% 3.77ms + 99.990% 4.71ms + 99.999% 5.22ms +100.000% 5.31ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.149 0.000000 1 1.00 + 0.571 0.100000 9957 1.11 + 0.746 0.200000 19860 1.25 + 0.901 0.300000 29819 1.43 + 1.049 0.400000 39689 1.67 + 1.196 0.500000 49655 2.00 + 1.269 0.550000 54617 2.22 + 1.341 0.600000 59562 2.50 + 1.418 0.650000 64491 2.86 + 1.499 0.700000 69472 3.33 + 1.583 0.750000 74412 4.00 + 1.630 0.775000 76902 4.44 + 1.678 0.800000 79356 5.00 + 1.732 0.825000 81844 5.71 + 1.790 0.850000 84325 6.67 + 1.857 0.875000 86822 8.00 + 1.894 0.887500 88030 8.89 + 1.935 0.900000 89278 10.00 + 1.977 0.912500 90511 11.43 + 2.030 0.925000 91763 13.33 + 2.089 0.937500 93001 16.00 + 2.121 0.943750 93612 17.78 + 2.157 0.950000 94233 20.00 + 2.197 0.956250 94874 22.86 + 2.243 0.962500 95478 26.67 + 2.299 0.968750 96096 32.00 + 2.329 0.971875 96404 35.56 + 2.369 0.975000 96716 40.00 + 2.411 0.978125 97024 45.71 + 2.459 0.981250 97330 53.33 + 2.519 0.984375 97644 64.00 + 2.553 0.985938 97798 71.11 + 2.589 0.987500 97955 80.00 + 2.635 0.989062 98105 91.43 + 2.703 0.990625 98259 106.67 + 2.769 0.992188 98414 128.00 + 2.817 0.992969 98492 142.22 + 2.873 0.993750 98571 160.00 + 2.937 0.994531 98646 182.86 + 3.023 0.995313 98724 213.33 + 3.109 0.996094 98803 256.00 + 3.171 0.996484 98840 284.44 + 3.239 0.996875 98879 320.00 + 3.305 0.997266 98919 365.71 + 3.379 0.997656 98956 426.67 + 3.487 0.998047 98995 512.00 + 3.527 0.998242 99016 568.89 + 3.579 0.998437 99038 640.00 + 3.625 0.998633 99053 731.43 + 3.689 0.998828 99073 853.33 + 3.777 0.999023 99093 1024.00 + 3.821 0.999121 99101 1137.78 + 3.871 0.999219 99111 1280.00 + 3.935 0.999316 99121 1462.86 + 3.987 0.999414 99130 1706.67 + 4.083 0.999512 99140 2048.00 + 4.123 0.999561 99145 2275.56 + 4.135 0.999609 99150 2560.00 + 4.215 0.999658 99155 2925.71 + 4.295 0.999707 99160 3413.33 + 4.359 0.999756 99164 4096.00 + 4.407 0.999780 99167 4551.11 + 4.451 0.999805 99169 5120.00 + 4.515 0.999829 99172 5851.43 + 4.631 0.999854 99174 6826.67 + 4.679 0.999878 99176 8192.00 + 4.711 0.999890 99178 9102.22 + 4.735 0.999902 99179 10240.00 + 4.763 0.999915 99180 11702.86 + 4.775 0.999927 99181 13653.33 + 4.871 0.999939 99182 16384.00 + 4.875 0.999945 99183 18204.44 + 5.003 0.999951 99184 20480.00 + 5.003 0.999957 99184 23405.71 + 5.159 0.999963 99186 27306.67 + 5.159 0.999969 99186 32768.00 + 5.159 0.999973 99186 36408.89 + 5.159 0.999976 99186 40960.00 + 5.159 0.999979 99186 46811.43 + 5.223 0.999982 99187 54613.33 + 5.223 0.999985 99187 65536.00 + 5.223 0.999986 99187 72817.78 + 5.223 0.999988 99187 81920.00 + 5.223 0.999989 99187 93622.86 + 5.311 0.999991 99188 109226.67 + 5.311 1.000000 99188 inf +#[Mean = 1.236, StdDeviation = 0.540] +#[Max = 5.308, Total count = 99188] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 199668 requests in 20.00s, 23.61MB read +Requests/sec: 9984.03 +Transfer/sec: 1.18MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_14000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_14000_wrk.txt new file mode 100644 index 000000000..3ff106d51 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_14000_wrk.txt @@ -0,0 +1,121 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.831ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.813ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.816ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.821ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.877ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.872ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.826ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.851ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.96ms 1.41ms 14.50ms 89.53% + Req/Sec 1.84k 211.85 3.56k 75.36% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.67ms + 75.000% 2.26ms + 90.000% 3.11ms + 99.000% 9.45ms + 99.900% 11.69ms + 99.990% 13.10ms + 99.999% 13.81ms +100.000% 14.51ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.141 0.000000 1 1.00 + 0.845 0.100000 13888 1.11 + 1.089 0.200000 27811 1.25 + 1.293 0.300000 41633 1.43 + 1.479 0.400000 55530 1.67 + 1.669 0.500000 69386 2.00 + 1.767 0.550000 76352 2.22 + 1.871 0.600000 83255 2.50 + 1.984 0.650000 90172 2.86 + 2.113 0.700000 97175 3.33 + 2.257 0.750000 104081 4.00 + 2.343 0.775000 107543 4.44 + 2.437 0.800000 110994 5.00 + 2.547 0.825000 114458 5.71 + 2.681 0.850000 117907 6.67 + 2.863 0.875000 121386 8.00 + 2.975 0.887500 123100 8.89 + 3.105 0.900000 124832 10.00 + 3.269 0.912500 126578 11.43 + 3.491 0.925000 128301 13.33 + 3.769 0.937500 130038 16.00 + 3.953 0.943750 130903 17.78 + 4.167 0.950000 131772 20.00 + 4.415 0.956250 132634 22.86 + 4.735 0.962500 133503 26.67 + 5.195 0.968750 134374 32.00 + 5.519 0.971875 134804 35.56 + 5.923 0.975000 135237 40.00 + 6.387 0.978125 135669 45.71 + 6.991 0.981250 136101 53.33 + 7.743 0.984375 136534 64.00 + 8.231 0.985938 136752 71.11 + 8.727 0.987500 136969 80.00 + 9.191 0.989062 137187 91.43 + 9.567 0.990625 137402 106.67 + 9.855 0.992188 137625 128.00 + 9.975 0.992969 137728 142.22 + 10.119 0.993750 137847 160.00 + 10.255 0.994531 137944 182.86 + 10.391 0.995313 138052 213.33 + 10.551 0.996094 138166 256.00 + 10.655 0.996484 138215 284.44 + 10.743 0.996875 138270 320.00 + 10.863 0.997266 138323 365.71 + 10.999 0.997656 138376 426.67 + 11.167 0.998047 138432 512.00 + 11.239 0.998242 138459 568.89 + 11.335 0.998437 138485 640.00 + 11.487 0.998633 138512 731.43 + 11.583 0.998828 138542 853.33 + 11.743 0.999023 138566 1024.00 + 11.839 0.999121 138581 1137.78 + 11.935 0.999219 138594 1280.00 + 12.079 0.999316 138610 1462.86 + 12.135 0.999414 138620 1706.67 + 12.295 0.999512 138635 2048.00 + 12.391 0.999561 138642 2275.56 + 12.447 0.999609 138647 2560.00 + 12.527 0.999658 138654 2925.71 + 12.575 0.999707 138662 3413.33 + 12.711 0.999756 138668 4096.00 + 12.735 0.999780 138671 4551.11 + 12.775 0.999805 138674 5120.00 + 12.919 0.999829 138679 5851.43 + 12.991 0.999854 138681 6826.67 + 13.055 0.999878 138685 8192.00 + 13.071 0.999890 138686 9102.22 + 13.095 0.999902 138689 10240.00 + 13.111 0.999915 138690 11702.86 + 13.215 0.999927 138691 13653.33 + 13.263 0.999939 138693 16384.00 + 13.295 0.999945 138694 18204.44 + 13.311 0.999951 138695 20480.00 + 13.439 0.999957 138696 23405.71 + 13.439 0.999963 138696 27306.67 + 13.511 0.999969 138697 32768.00 + 13.551 0.999973 138698 36408.89 + 13.551 0.999976 138698 40960.00 + 13.687 0.999979 138699 46811.43 + 13.687 0.999982 138699 54613.33 + 13.687 0.999985 138699 65536.00 + 13.815 0.999986 138700 72817.78 + 13.815 0.999988 138700 81920.00 + 13.815 0.999989 138700 93622.86 + 13.815 0.999991 138700 109226.67 + 13.815 0.999992 138700 131072.00 + 14.511 0.999993 138701 145635.56 + 14.511 1.000000 138701 inf +#[Mean = 1.965, StdDeviation = 1.415] +#[Max = 14.504, Total count = 138701] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 279353 requests in 20.00s, 33.04MB read +Requests/sec: 13968.56 +Transfer/sec: 1.65MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_16000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_16000_wrk.txt new file mode 100644 index 000000000..2d484e7b1 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_16000_wrk.txt @@ -0,0 +1,122 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 7.959ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 7.996ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 8.022ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 8.090ms, rate sampling interval: 42ms + Thread calibration: mean lat.: 7.927ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 7.967ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 7.941ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 7.966ms, rate sampling interval: 40ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 11.84ms 12.35ms 98.94ms 86.36% + Req/Sec 2.03k 341.11 5.47k 76.37% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 7.73ms + 75.000% 17.09ms + 90.000% 28.40ms + 99.000% 52.90ms + 99.900% 81.15ms + 99.990% 92.22ms + 99.999% 97.60ms +100.000% 99.01ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.204 0.000000 1 1.00 + 1.467 0.100000 15889 1.11 + 2.113 0.200000 31790 1.25 + 3.227 0.300000 47660 1.43 + 5.187 0.400000 63550 1.67 + 7.731 0.500000 79410 2.00 + 9.087 0.550000 87395 2.22 + 10.359 0.600000 95289 2.50 + 12.143 0.650000 103229 2.86 + 14.687 0.700000 111194 3.33 + 17.087 0.750000 119122 4.00 + 18.319 0.775000 123142 4.44 + 19.631 0.800000 127104 5.00 + 21.103 0.825000 131040 5.71 + 23.023 0.850000 135018 6.67 + 25.343 0.875000 138977 8.00 + 26.639 0.887500 140958 8.89 + 28.399 0.900000 142937 10.00 + 30.431 0.912500 144919 11.43 + 32.527 0.925000 146906 13.33 + 34.847 0.937500 148903 16.00 + 36.095 0.943750 149904 17.78 + 37.887 0.950000 150881 20.00 + 39.967 0.956250 151873 22.86 + 42.079 0.962500 152867 26.67 + 43.871 0.968750 153867 32.00 + 44.671 0.971875 154346 35.56 + 45.599 0.975000 154853 40.00 + 46.591 0.978125 155339 45.71 + 47.775 0.981250 155840 53.33 + 49.311 0.984375 156340 64.00 + 50.111 0.985938 156588 71.11 + 51.135 0.987500 156830 80.00 + 52.223 0.989062 157080 91.43 + 53.439 0.990625 157330 106.67 + 55.359 0.992188 157574 128.00 + 56.959 0.992969 157697 142.22 + 58.719 0.993750 157820 160.00 + 61.503 0.994531 157944 182.86 + 64.223 0.995313 158068 213.33 + 67.775 0.996094 158192 256.00 + 69.823 0.996484 158254 284.44 + 71.743 0.996875 158318 320.00 + 73.983 0.997266 158378 365.71 + 75.647 0.997656 158440 426.67 + 77.503 0.998047 158502 512.00 + 78.335 0.998242 158535 568.89 + 79.039 0.998437 158567 640.00 + 79.551 0.998633 158595 731.43 + 80.319 0.998828 158627 853.33 + 81.279 0.999023 158658 1024.00 + 82.175 0.999121 158673 1137.78 + 83.007 0.999219 158688 1280.00 + 83.711 0.999316 158704 1462.86 + 84.671 0.999414 158721 1706.67 + 85.247 0.999512 158735 2048.00 + 85.695 0.999561 158743 2275.56 + 86.079 0.999609 158750 2560.00 + 86.655 0.999658 158758 2925.71 + 87.231 0.999707 158766 3413.33 + 88.255 0.999756 158774 4096.00 + 88.639 0.999780 158778 4551.11 + 89.279 0.999805 158781 5120.00 + 89.791 0.999829 158785 5851.43 + 90.431 0.999854 158789 6826.67 + 90.943 0.999878 158793 8192.00 + 91.583 0.999890 158795 9102.22 + 92.287 0.999902 158797 10240.00 + 93.759 0.999915 158799 11702.86 + 94.399 0.999927 158801 13653.33 + 95.167 0.999939 158803 16384.00 + 95.615 0.999945 158804 18204.44 + 96.319 0.999951 158805 20480.00 + 96.511 0.999957 158806 23405.71 + 97.087 0.999963 158807 27306.67 + 97.151 0.999969 158808 32768.00 + 97.151 0.999973 158808 36408.89 + 97.343 0.999976 158809 40960.00 + 97.343 0.999979 158809 46811.43 + 97.599 0.999982 158810 54613.33 + 97.599 0.999985 158810 65536.00 + 97.599 0.999986 158810 72817.78 + 97.983 0.999988 158811 81920.00 + 97.983 0.999989 158811 93622.86 + 97.983 0.999991 158811 109226.67 + 97.983 0.999992 158811 131072.00 + 97.983 0.999993 158811 145635.56 + 99.007 0.999994 158812 163840.00 + 99.007 1.000000 158812 inf +#[Mean = 11.844, StdDeviation = 12.346] +#[Max = 98.944, Total count = 158812] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 319358 requests in 20.00s, 37.77MB read +Requests/sec: 15968.52 +Transfer/sec: 1.89MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_18000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_18000_wrk.txt new file mode 100644 index 000000000..03180f60b --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_18000_wrk.txt @@ -0,0 +1,123 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 192.760ms, rate sampling interval: 827ms + Thread calibration: mean lat.: 211.639ms, rate sampling interval: 1038ms + Thread calibration: mean lat.: 231.824ms, rate sampling interval: 1063ms + Thread calibration: mean lat.: 191.099ms, rate sampling interval: 839ms + Thread calibration: mean lat.: 192.371ms, rate sampling interval: 841ms + Thread calibration: mean lat.: 188.019ms, rate sampling interval: 846ms + Thread calibration: mean lat.: 193.192ms, rate sampling interval: 850ms + Thread calibration: mean lat.: 336.305ms, rate sampling interval: 1262ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 648.43ms 114.37ms 975.36ms 63.19% + Req/Sec 2.22k 122.24 2.46k 70.00% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 637.44ms + 75.000% 731.14ms + 90.000% 811.01ms + 99.000% 907.78ms + 99.900% 944.13ms + 99.990% 965.63ms + 99.999% 973.82ms +100.000% 975.87ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 363.775 0.000000 1 1.00 + 504.831 0.100000 17731 1.11 + 541.183 0.200000 35378 1.25 + 575.487 0.300000 52962 1.43 + 608.767 0.400000 70567 1.67 + 637.439 0.500000 88060 2.00 + 652.799 0.550000 97118 2.22 + 670.207 0.600000 105786 2.50 + 690.175 0.650000 114634 2.86 + 710.655 0.700000 123440 3.33 + 731.135 0.750000 132244 4.00 + 742.911 0.775000 136538 4.44 + 755.199 0.800000 140924 5.00 + 768.511 0.825000 145322 5.71 + 782.847 0.850000 149834 6.67 + 796.159 0.875000 154177 8.00 + 803.327 0.887500 156333 8.89 + 811.007 0.900000 158522 10.00 + 819.199 0.912500 160803 11.43 + 828.415 0.925000 162981 13.33 + 838.655 0.937500 165219 16.00 + 843.263 0.943750 166290 17.78 + 848.895 0.950000 167338 20.00 + 856.063 0.956250 168488 22.86 + 863.743 0.962500 169550 26.67 + 872.447 0.968750 170676 32.00 + 876.543 0.971875 171191 35.56 + 880.639 0.975000 171710 40.00 + 885.759 0.978125 172264 45.71 + 890.879 0.981250 172822 53.33 + 896.511 0.984375 173408 64.00 + 899.583 0.985938 173669 71.11 + 902.655 0.987500 173927 80.00 + 905.727 0.989062 174207 91.43 + 909.311 0.990625 174473 106.67 + 913.407 0.992188 174751 128.00 + 915.967 0.992969 174895 142.22 + 918.527 0.993750 175019 160.00 + 921.599 0.994531 175174 182.86 + 924.671 0.995313 175308 213.33 + 927.743 0.996094 175433 256.00 + 929.279 0.996484 175508 284.44 + 930.815 0.996875 175562 320.00 + 932.863 0.997266 175641 365.71 + 934.911 0.997656 175713 426.67 + 936.447 0.998047 175767 512.00 + 938.495 0.998242 175809 568.89 + 939.519 0.998437 175842 640.00 + 941.567 0.998633 175878 731.43 + 942.591 0.998828 175905 853.33 + 944.639 0.999023 175941 1024.00 + 945.663 0.999121 175959 1137.78 + 947.199 0.999219 175977 1280.00 + 948.223 0.999316 175994 1462.86 + 950.271 0.999414 176012 1706.67 + 952.319 0.999512 176026 2048.00 + 953.343 0.999561 176033 2275.56 + 954.879 0.999609 176043 2560.00 + 955.903 0.999658 176051 2925.71 + 957.951 0.999707 176061 3413.33 + 959.999 0.999756 176070 4096.00 + 961.023 0.999780 176072 4551.11 + 962.047 0.999805 176076 5120.00 + 962.559 0.999829 176080 5851.43 + 964.607 0.999854 176088 6826.67 + 965.119 0.999878 176089 8192.00 + 965.631 0.999890 176092 9102.22 + 966.143 0.999902 176093 10240.00 + 967.167 0.999915 176095 11702.86 + 968.191 0.999927 176098 13653.33 + 969.215 0.999939 176100 16384.00 + 970.239 0.999945 176101 18204.44 + 971.263 0.999951 176102 20480.00 + 971.775 0.999957 176104 23405.71 + 971.775 0.999963 176104 27306.67 + 973.311 0.999969 176105 32768.00 + 973.823 0.999973 176108 36408.89 + 973.823 0.999976 176108 40960.00 + 973.823 0.999979 176108 46811.43 + 973.823 0.999982 176108 54613.33 + 973.823 0.999985 176108 65536.00 + 973.823 0.999986 176108 72817.78 + 973.823 0.999988 176108 81920.00 + 975.359 0.999989 176109 93622.86 + 975.359 0.999991 176109 109226.67 + 975.359 0.999992 176109 131072.00 + 975.359 0.999993 176109 145635.56 + 975.359 0.999994 176109 163840.00 + 975.871 0.999995 176110 187245.71 + 975.871 1.000000 176110 inf +#[Mean = 648.429, StdDeviation = 114.367] +#[Max = 975.360, Total count = 176110] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 347035 requests in 20.00s, 41.04MB read +Requests/sec: 17352.95 +Transfer/sec: 2.05MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_8500_cpu.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_8500_cpu.html new file mode 100644 index 000000000..66bdbfa96 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_8500_cpu.html @@ -0,0 +1,8656 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_8500_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_8500_wrk.txt new file mode 100644 index 000000000..00bbf5fca --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_bug_put_8500_wrk.txt @@ -0,0 +1,118 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.559ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.448ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.507ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.646ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.655ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.641ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.092ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.662ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.61ms 623.04us 5.63ms 67.61% + Req/Sec 1.12k 296.33 1.78k 78.86% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.61ms + 75.000% 2.03ms + 90.000% 2.39ms + 99.000% 3.23ms + 99.900% 4.18ms + 99.990% 4.98ms + 99.999% 5.41ms +100.000% 5.63ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.207 0.000000 1 1.00 + 0.795 0.100000 8439 1.11 + 1.054 0.200000 16895 1.25 + 1.256 0.300000 25304 1.43 + 1.441 0.400000 33749 1.67 + 1.613 0.500000 42202 2.00 + 1.696 0.550000 46393 2.22 + 1.776 0.600000 50642 2.50 + 1.857 0.650000 54850 2.86 + 1.941 0.700000 59069 3.33 + 2.031 0.750000 63246 4.00 + 2.079 0.775000 65403 4.44 + 2.129 0.800000 67504 5.00 + 2.183 0.825000 69610 5.71 + 2.241 0.850000 71672 6.67 + 2.307 0.875000 73782 8.00 + 2.345 0.887500 74856 8.89 + 2.387 0.900000 75918 10.00 + 2.435 0.912500 76978 11.43 + 2.487 0.925000 78028 13.33 + 2.549 0.937500 79062 16.00 + 2.585 0.943750 79601 17.78 + 2.627 0.950000 80118 20.00 + 2.673 0.956250 80635 22.86 + 2.727 0.962500 81171 26.67 + 2.787 0.968750 81696 32.00 + 2.823 0.971875 81953 35.56 + 2.865 0.975000 82218 40.00 + 2.913 0.978125 82480 45.71 + 2.973 0.981250 82747 53.33 + 3.049 0.984375 83004 64.00 + 3.089 0.985938 83137 71.11 + 3.139 0.987500 83266 80.00 + 3.191 0.989062 83397 91.43 + 3.261 0.990625 83529 106.67 + 3.333 0.992188 83662 128.00 + 3.373 0.992969 83728 142.22 + 3.425 0.993750 83794 160.00 + 3.485 0.994531 83859 182.86 + 3.561 0.995313 83925 213.33 + 3.635 0.996094 83990 256.00 + 3.681 0.996484 84024 284.44 + 3.719 0.996875 84056 320.00 + 3.765 0.997266 84089 365.71 + 3.815 0.997656 84123 426.67 + 3.897 0.998047 84155 512.00 + 3.941 0.998242 84171 568.89 + 3.981 0.998437 84188 640.00 + 4.051 0.998633 84205 731.43 + 4.123 0.998828 84223 853.33 + 4.175 0.999023 84237 1024.00 + 4.211 0.999121 84245 1137.78 + 4.255 0.999219 84254 1280.00 + 4.311 0.999316 84263 1462.86 + 4.347 0.999414 84270 1706.67 + 4.443 0.999512 84278 2048.00 + 4.451 0.999561 84282 2275.56 + 4.527 0.999609 84287 2560.00 + 4.603 0.999658 84291 2925.71 + 4.699 0.999707 84296 3413.33 + 4.715 0.999756 84299 4096.00 + 4.739 0.999780 84302 4551.11 + 4.759 0.999805 84303 5120.00 + 4.807 0.999829 84305 5851.43 + 4.899 0.999854 84307 6826.67 + 4.919 0.999878 84309 8192.00 + 4.983 0.999890 84311 9102.22 + 4.983 0.999902 84311 10240.00 + 5.039 0.999915 84313 11702.86 + 5.039 0.999927 84313 13653.33 + 5.103 0.999939 84314 16384.00 + 5.263 0.999945 84315 18204.44 + 5.263 0.999951 84315 20480.00 + 5.299 0.999957 84316 23405.71 + 5.299 0.999963 84316 27306.67 + 5.311 0.999969 84317 32768.00 + 5.311 0.999973 84317 36408.89 + 5.311 0.999976 84317 40960.00 + 5.415 0.999979 84318 46811.43 + 5.415 0.999982 84318 54613.33 + 5.415 0.999985 84318 65536.00 + 5.415 0.999986 84318 72817.78 + 5.415 0.999988 84318 81920.00 + 5.631 0.999989 84319 93622.86 + 5.631 1.000000 84319 inf +#[Mean = 1.615, StdDeviation = 0.623] +#[Max = 5.628, Total count = 84319] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 168712 requests in 20.01s, 19.95MB read +Requests/sec: 8433.28 +Transfer/sec: 1.00MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_alloc.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_alloc.html new file mode 100644 index 000000000..dd752b517 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_alloc.html @@ -0,0 +1,12098 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_cpu.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_cpu.html new file mode 100644 index 000000000..d5b765662 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_cpu.html @@ -0,0 +1,37337 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_lock.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_lock.html new file mode 100644 index 000000000..f0978a798 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_lock.html @@ -0,0 +1,4267 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_wrk.txt new file mode 100644 index 000000000..323e27394 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_stable_wrk.txt @@ -0,0 +1,149 @@ +Running 5m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.681ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.688ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.704ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.683ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.685ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.686ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.674ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.660ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.82ms 0.97ms 16.43ms 75.71% + Req/Sec 1.45k 218.00 3.33k 82.45% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.67ms + 75.000% 2.28ms + 90.000% 2.93ms + 99.000% 5.07ms + 99.900% 8.80ms + 99.990% 11.59ms + 99.999% 13.24ms +100.000% 16.45ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.120 0.000000 1 1.00 + 0.791 0.100000 319200 1.11 + 1.045 0.200000 638549 1.25 + 1.261 0.300000 956902 1.43 + 1.463 0.400000 1277166 1.67 + 1.667 0.500000 1595753 2.00 + 1.774 0.550000 1755234 2.22 + 1.886 0.600000 1913880 2.50 + 2.006 0.650000 2073066 2.86 + 2.137 0.700000 2232878 3.33 + 2.283 0.750000 2393792 4.00 + 2.363 0.775000 2472801 4.44 + 2.451 0.800000 2552695 5.00 + 2.547 0.825000 2631513 5.71 + 2.657 0.850000 2711083 6.67 + 2.783 0.875000 2790651 8.00 + 2.855 0.887500 2830535 8.89 + 2.935 0.900000 2870328 10.00 + 3.027 0.912500 2910692 11.43 + 3.131 0.925000 2950076 13.33 + 3.261 0.937500 2990318 16.00 + 3.335 0.943750 3009853 17.78 + 3.423 0.950000 3029842 20.00 + 3.527 0.956250 3049744 22.86 + 3.653 0.962500 3069557 26.67 + 3.813 0.968750 3089481 32.00 + 3.911 0.971875 3099423 35.56 + 4.023 0.975000 3109426 40.00 + 4.159 0.978125 3119432 45.71 + 4.323 0.981250 3129460 53.33 + 4.523 0.984375 3139446 64.00 + 4.643 0.985938 3144402 71.11 + 4.783 0.987500 3149285 80.00 + 4.951 0.989062 3154302 91.43 + 5.163 0.990625 3159227 106.67 + 5.423 0.992188 3164253 128.00 + 5.587 0.992969 3166702 142.22 + 5.787 0.993750 3169198 160.00 + 6.015 0.994531 3171707 182.86 + 6.275 0.995313 3174175 213.33 + 6.607 0.996094 3176668 256.00 + 6.787 0.996484 3177919 284.44 + 6.999 0.996875 3179165 320.00 + 7.235 0.997266 3180398 365.71 + 7.495 0.997656 3181658 426.67 + 7.799 0.998047 3182893 512.00 + 7.967 0.998242 3183512 568.89 + 8.143 0.998437 3184135 640.00 + 8.343 0.998633 3184758 731.43 + 8.567 0.998828 3185378 853.33 + 8.839 0.999023 3186013 1024.00 + 8.975 0.999121 3186317 1137.78 + 9.127 0.999219 3186637 1280.00 + 9.303 0.999316 3186937 1462.86 + 9.527 0.999414 3187246 1706.67 + 9.767 0.999512 3187560 2048.00 + 9.895 0.999561 3187713 2275.56 + 10.055 0.999609 3187873 2560.00 + 10.223 0.999658 3188025 2925.71 + 10.439 0.999707 3188184 3413.33 + 10.687 0.999756 3188340 4096.00 + 10.839 0.999780 3188418 4551.11 + 10.967 0.999805 3188492 5120.00 + 11.111 0.999829 3188571 5851.43 + 11.263 0.999854 3188650 6826.67 + 11.423 0.999878 3188724 8192.00 + 11.519 0.999890 3188763 9102.22 + 11.607 0.999902 3188805 10240.00 + 11.719 0.999915 3188841 11702.86 + 11.863 0.999927 3188881 13653.33 + 11.999 0.999939 3188919 16384.00 + 12.079 0.999945 3188942 18204.44 + 12.127 0.999951 3188958 20480.00 + 12.247 0.999957 3188977 23405.71 + 12.375 0.999963 3188997 27306.67 + 12.471 0.999969 3189017 32768.00 + 12.527 0.999973 3189026 36408.89 + 12.631 0.999976 3189036 40960.00 + 12.703 0.999979 3189045 46811.43 + 12.855 0.999982 3189055 54613.33 + 12.943 0.999985 3189066 65536.00 + 13.007 0.999986 3189070 72817.78 + 13.127 0.999988 3189075 81920.00 + 13.215 0.999989 3189079 93622.86 + 13.335 0.999991 3189084 109226.67 + 13.383 0.999992 3189089 131072.00 + 13.511 0.999993 3189092 145635.56 + 13.583 0.999994 3189094 163840.00 + 13.783 0.999995 3189096 187245.71 + 13.927 0.999995 3189099 218453.33 + 14.255 0.999996 3189101 262144.00 + 14.543 0.999997 3189103 291271.11 + 14.567 0.999997 3189104 327680.00 + 14.615 0.999997 3189105 374491.43 + 14.671 0.999998 3189106 436906.67 + 15.199 0.999998 3189107 524288.00 + 15.223 0.999998 3189108 582542.22 + 15.319 0.999998 3189110 655360.00 + 15.319 0.999999 3189110 748982.86 + 15.319 0.999999 3189110 873813.33 + 15.319 0.999999 3189110 1048576.00 + 15.383 0.999999 3189111 1165084.44 + 15.383 0.999999 3189111 1310720.00 + 15.383 0.999999 3189111 1497965.71 + 15.423 0.999999 3189112 1747626.67 + 15.423 1.000000 3189112 2097152.00 + 15.423 1.000000 3189112 2330168.89 + 15.423 1.000000 3189112 2621440.00 + 15.423 1.000000 3189112 2995931.43 + 16.447 1.000000 3189113 3495253.33 + 16.447 1.000000 3189113 inf +#[Mean = 1.816, StdDeviation = 0.971] +#[Max = 16.432, Total count = 3189113] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 3298301 requests in 5.00m, 0.98GB read + Non-2xx or 3xx responses: 694467 +Requests/sec: 10994.36 +Transfer/sec: 3.35MB +------------------------------ + +HTTP Status 404 Count: 694467 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_wrk.txt new file mode 100644 index 000000000..7edeee155 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_11000_wrk.txt @@ -0,0 +1,136 @@ +Running 1m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.696ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.507ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.706ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.680ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.677ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.641ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.685ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.648ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.76ms 0.93ms 15.19ms 77.17% + Req/Sec 1.45k 216.16 3.20k 78.59% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.62ms + 75.000% 2.17ms + 90.000% 2.79ms + 99.000% 5.09ms + 99.900% 8.20ms + 99.990% 12.17ms + 99.999% 14.64ms +100.000% 15.20ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.155 0.000000 1 1.00 + 0.795 0.100000 54992 1.11 + 1.045 0.200000 109924 1.25 + 1.253 0.300000 164831 1.43 + 1.440 0.400000 219920 1.67 + 1.624 0.500000 274735 2.00 + 1.719 0.550000 302126 2.22 + 1.817 0.600000 329679 2.50 + 1.922 0.650000 356956 2.86 + 2.039 0.700000 384472 3.33 + 2.169 0.750000 411845 4.00 + 2.245 0.775000 425898 4.44 + 2.323 0.800000 439326 5.00 + 2.415 0.825000 453277 5.71 + 2.517 0.850000 466885 6.67 + 2.637 0.875000 480461 8.00 + 2.709 0.887500 487492 8.89 + 2.789 0.900000 494312 10.00 + 2.881 0.912500 501109 11.43 + 2.989 0.925000 507921 13.33 + 3.129 0.937500 514871 16.00 + 3.211 0.943750 518300 17.78 + 3.305 0.950000 521683 20.00 + 3.415 0.956250 525133 22.86 + 3.551 0.962500 528509 26.67 + 3.729 0.968750 531959 32.00 + 3.837 0.971875 533672 35.56 + 3.959 0.975000 535379 40.00 + 4.099 0.978125 537106 45.71 + 4.279 0.981250 538837 53.33 + 4.503 0.984375 540546 64.00 + 4.635 0.985938 541386 71.11 + 4.799 0.987500 542236 80.00 + 4.979 0.989062 543113 91.43 + 5.175 0.990625 543959 106.67 + 5.439 0.992188 544809 128.00 + 5.583 0.992969 545241 142.22 + 5.755 0.993750 545673 160.00 + 5.939 0.994531 546104 182.86 + 6.135 0.995313 546527 213.33 + 6.367 0.996094 546957 256.00 + 6.527 0.996484 547167 284.44 + 6.691 0.996875 547385 320.00 + 6.855 0.997266 547600 365.71 + 7.067 0.997656 547812 426.67 + 7.323 0.998047 548026 512.00 + 7.455 0.998242 548133 568.89 + 7.603 0.998437 548240 640.00 + 7.779 0.998633 548348 731.43 + 7.983 0.998828 548455 853.33 + 8.239 0.999023 548562 1024.00 + 8.391 0.999121 548616 1137.78 + 8.599 0.999219 548670 1280.00 + 8.799 0.999316 548723 1462.86 + 9.039 0.999414 548776 1706.67 + 9.359 0.999512 548829 2048.00 + 9.607 0.999561 548856 2275.56 + 9.791 0.999609 548883 2560.00 + 10.119 0.999658 548910 2925.71 + 10.439 0.999707 548937 3413.33 + 10.815 0.999756 548963 4096.00 + 11.135 0.999780 548979 4551.11 + 11.391 0.999805 548990 5120.00 + 11.775 0.999829 549005 5851.43 + 11.935 0.999854 549017 6826.67 + 12.079 0.999878 549030 8192.00 + 12.127 0.999890 549037 9102.22 + 12.183 0.999902 549044 10240.00 + 12.303 0.999915 549051 11702.86 + 12.407 0.999927 549057 13653.33 + 12.735 0.999939 549064 16384.00 + 12.783 0.999945 549067 18204.44 + 12.879 0.999951 549071 20480.00 + 13.143 0.999957 549074 23405.71 + 13.279 0.999963 549077 27306.67 + 13.759 0.999969 549081 32768.00 + 13.799 0.999973 549082 36408.89 + 13.855 0.999976 549084 40960.00 + 13.951 0.999979 549086 46811.43 + 14.287 0.999982 549087 54613.33 + 14.479 0.999985 549089 65536.00 + 14.487 0.999986 549090 72817.78 + 14.543 0.999988 549091 81920.00 + 14.639 0.999989 549092 93622.86 + 14.639 0.999991 549092 109226.67 + 14.847 0.999992 549093 131072.00 + 15.119 0.999993 549094 145635.56 + 15.119 0.999994 549094 163840.00 + 15.143 0.999995 549095 187245.71 + 15.143 0.999995 549095 218453.33 + 15.143 0.999996 549095 262144.00 + 15.175 0.999997 549096 291271.11 + 15.175 0.999997 549096 327680.00 + 15.175 0.999997 549096 374491.43 + 15.175 0.999998 549096 436906.67 + 15.175 0.999998 549096 524288.00 + 15.199 0.999998 549097 582542.22 + 15.199 1.000000 549097 inf +#[Mean = 1.762, StdDeviation = 0.929] +#[Max = 15.192, Total count = 549097] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 658305 requests in 1.00m, 199.81MB read + Non-2xx or 3xx responses: 139150 +Requests/sec: 10969.96 +Transfer/sec: 3.33MB +------------------------------ + +HTTP Status 404 Count: 139150 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_12000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_12000_wrk.txt new file mode 100644 index 000000000..eabed4784 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_12000_wrk.txt @@ -0,0 +1,137 @@ +Running 1m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.605ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.628ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.609ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.608ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.626ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.632ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.606ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.638ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.16ms 3.50ms 59.46ms 96.05% + Req/Sec 1.58k 188.40 3.10k 76.13% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.55ms + 75.000% 2.12ms + 90.000% 3.07ms + 99.000% 14.36ms + 99.900% 50.81ms + 99.990% 56.00ms + 99.999% 58.27ms +100.000% 59.49ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.143 0.000000 1 1.00 + 0.776 0.100000 59985 1.11 + 0.999 0.200000 120093 1.25 + 1.189 0.300000 179967 1.43 + 1.366 0.400000 239859 1.67 + 1.547 0.500000 299711 2.00 + 1.643 0.550000 329729 2.22 + 1.744 0.600000 359607 2.50 + 1.854 0.650000 389585 2.86 + 1.977 0.700000 419527 3.33 + 2.119 0.750000 449567 4.00 + 2.201 0.775000 464414 4.44 + 2.297 0.800000 479459 5.00 + 2.411 0.825000 494363 5.71 + 2.557 0.850000 509288 6.67 + 2.755 0.875000 524202 8.00 + 2.893 0.887500 531654 8.89 + 3.071 0.900000 539181 10.00 + 3.299 0.912500 546680 11.43 + 3.593 0.925000 554135 13.33 + 3.999 0.937500 561615 16.00 + 4.271 0.943750 565369 17.78 + 4.631 0.950000 569090 20.00 + 5.163 0.956250 572835 22.86 + 5.927 0.962500 576573 26.67 + 7.015 0.968750 580319 32.00 + 7.591 0.971875 582190 35.56 + 8.223 0.975000 584063 40.00 + 8.983 0.978125 585935 45.71 + 10.127 0.981250 587809 53.33 + 11.455 0.984375 589677 64.00 + 12.151 0.985938 590610 71.11 + 12.959 0.987500 591555 80.00 + 13.775 0.989062 592482 91.43 + 14.863 0.990625 593417 106.67 + 16.559 0.992188 594359 128.00 + 17.551 0.992969 594823 142.22 + 19.839 0.993750 595290 160.00 + 23.839 0.994531 595759 182.86 + 28.399 0.995313 596226 213.33 + 34.335 0.996094 596693 256.00 + 37.599 0.996484 596929 284.44 + 40.319 0.996875 597163 320.00 + 42.527 0.997266 597397 365.71 + 44.671 0.997656 597631 426.67 + 46.559 0.998047 597867 512.00 + 47.487 0.998242 597980 568.89 + 48.383 0.998437 598099 640.00 + 49.151 0.998633 598217 731.43 + 50.079 0.998828 598333 853.33 + 50.911 0.999023 598450 1024.00 + 51.295 0.999121 598508 1137.78 + 51.775 0.999219 598565 1280.00 + 52.223 0.999316 598627 1462.86 + 52.671 0.999414 598687 1706.67 + 53.119 0.999512 598740 2048.00 + 53.407 0.999561 598769 2275.56 + 53.727 0.999609 598802 2560.00 + 54.015 0.999658 598830 2925.71 + 54.303 0.999707 598858 3413.33 + 54.655 0.999756 598888 4096.00 + 54.815 0.999780 598902 4551.11 + 55.039 0.999805 598918 5120.00 + 55.199 0.999829 598932 5851.43 + 55.423 0.999854 598947 6826.67 + 55.711 0.999878 598959 8192.00 + 55.935 0.999890 598968 9102.22 + 55.999 0.999902 598974 10240.00 + 56.223 0.999915 598982 11702.86 + 56.351 0.999927 598989 13653.33 + 56.703 0.999939 598997 16384.00 + 56.735 0.999945 599000 18204.44 + 56.831 0.999951 599004 20480.00 + 56.895 0.999957 599007 23405.71 + 57.215 0.999963 599011 27306.67 + 57.375 0.999969 599015 32768.00 + 57.407 0.999973 599016 36408.89 + 57.599 0.999976 599019 40960.00 + 57.695 0.999979 599020 46811.43 + 57.727 0.999982 599023 54613.33 + 57.727 0.999985 599023 65536.00 + 57.983 0.999986 599024 72817.78 + 58.143 0.999988 599025 81920.00 + 58.271 0.999989 599026 93622.86 + 58.335 0.999991 599027 109226.67 + 58.367 0.999992 599028 131072.00 + 58.367 0.999993 599028 145635.56 + 58.431 0.999994 599029 163840.00 + 58.431 0.999995 599029 187245.71 + 58.527 0.999995 599030 218453.33 + 58.527 0.999996 599030 262144.00 + 58.527 0.999997 599030 291271.11 + 58.815 0.999997 599031 327680.00 + 58.815 0.999997 599031 374491.43 + 58.815 0.999998 599031 436906.67 + 58.815 0.999998 599031 524288.00 + 58.815 0.999998 599031 582542.22 + 59.487 0.999998 599032 655360.00 + 59.487 1.000000 599032 inf +#[Mean = 2.156, StdDeviation = 3.505] +#[Max = 59.456, Total count = 599032] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 719589 requests in 1.00m, 218.59MB read + Non-2xx or 3xx responses: 151635 +Requests/sec: 11993.10 +Transfer/sec: 3.64MB +------------------------------ + +HTTP Status 404 Count: 151635 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_13000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_13000_wrk.txt new file mode 100644 index 000000000..8cc4b78fa --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_13000_wrk.txt @@ -0,0 +1,125 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.751ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.139ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.137ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.157ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.071ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.162ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.229ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.253ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.09ms 0.89ms 9.78ms 71.72% + Req/Sec 1.71k 254.79 2.67k 73.61% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 2.02ms + 75.000% 2.60ms + 90.000% 3.17ms + 99.000% 4.66ms + 99.900% 7.64ms + 99.990% 8.88ms + 99.999% 9.21ms +100.000% 9.79ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.162 0.000000 1 1.00 + 1.032 0.100000 12914 1.11 + 1.356 0.200000 25827 1.25 + 1.601 0.300000 38700 1.43 + 1.812 0.400000 51629 1.67 + 2.018 0.500000 64513 2.00 + 2.123 0.550000 71007 2.22 + 2.233 0.600000 77472 2.50 + 2.347 0.650000 83888 2.86 + 2.469 0.700000 90317 3.33 + 2.603 0.750000 96788 4.00 + 2.675 0.775000 99996 4.44 + 2.753 0.800000 103228 5.00 + 2.839 0.825000 106425 5.71 + 2.933 0.850000 109616 6.67 + 3.041 0.875000 112878 8.00 + 3.099 0.887500 114447 8.89 + 3.167 0.900000 116067 10.00 + 3.241 0.912500 117672 11.43 + 3.333 0.925000 119308 13.33 + 3.435 0.937500 120898 16.00 + 3.497 0.943750 121726 17.78 + 3.563 0.950000 122544 20.00 + 3.635 0.956250 123323 22.86 + 3.723 0.962500 124123 26.67 + 3.833 0.968750 124928 32.00 + 3.901 0.971875 125331 35.56 + 3.979 0.975000 125738 40.00 + 4.059 0.978125 126138 45.71 + 4.159 0.981250 126538 53.33 + 4.283 0.984375 126945 64.00 + 4.367 0.985938 127144 71.11 + 4.463 0.987500 127347 80.00 + 4.583 0.989062 127544 91.43 + 4.727 0.990625 127747 106.67 + 4.907 0.992188 127950 128.00 + 5.027 0.992969 128048 142.22 + 5.223 0.993750 128153 160.00 + 5.415 0.994531 128251 182.86 + 5.667 0.995313 128351 213.33 + 5.979 0.996094 128451 256.00 + 6.183 0.996484 128501 284.44 + 6.363 0.996875 128553 320.00 + 6.575 0.997266 128602 365.71 + 6.751 0.997656 128653 426.67 + 6.915 0.998047 128703 512.00 + 6.987 0.998242 128728 568.89 + 7.123 0.998437 128753 640.00 + 7.295 0.998633 128778 731.43 + 7.511 0.998828 128803 853.33 + 7.655 0.999023 128829 1024.00 + 7.711 0.999121 128842 1137.78 + 7.795 0.999219 128854 1280.00 + 7.867 0.999316 128866 1462.86 + 7.959 0.999414 128879 1706.67 + 8.111 0.999512 128892 2048.00 + 8.135 0.999561 128898 2275.56 + 8.223 0.999609 128904 2560.00 + 8.271 0.999658 128910 2925.71 + 8.439 0.999707 128918 3413.33 + 8.591 0.999756 128923 4096.00 + 8.639 0.999780 128927 4551.11 + 8.679 0.999805 128929 5120.00 + 8.767 0.999829 128932 5851.43 + 8.831 0.999854 128936 6826.67 + 8.863 0.999878 128939 8192.00 + 8.871 0.999890 128940 9102.22 + 8.919 0.999902 128942 10240.00 + 8.935 0.999915 128943 11702.86 + 8.959 0.999927 128945 13653.33 + 9.063 0.999939 128947 16384.00 + 9.063 0.999945 128947 18204.44 + 9.103 0.999951 128949 20480.00 + 9.103 0.999957 128949 23405.71 + 9.143 0.999963 128950 27306.67 + 9.167 0.999969 128951 32768.00 + 9.167 0.999973 128951 36408.89 + 9.167 0.999976 128951 40960.00 + 9.191 0.999979 128952 46811.43 + 9.191 0.999982 128952 54613.33 + 9.207 0.999985 128953 65536.00 + 9.207 0.999986 128953 72817.78 + 9.207 0.999988 128953 81920.00 + 9.207 0.999989 128953 93622.86 + 9.207 0.999991 128953 109226.67 + 9.791 0.999992 128954 131072.00 + 9.791 1.000000 128954 inf +#[Mean = 2.092, StdDeviation = 0.894] +#[Max = 9.784, Total count = 128954] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 259549 requests in 20.00s, 78.56MB read + Non-2xx or 3xx responses: 54935 +Requests/sec: 12977.87 +Transfer/sec: 3.93MB +------------------------------ + +HTTP Status 404 Count: 54935 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_14000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_14000_wrk.txt new file mode 100644 index 000000000..930965d40 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_14000_wrk.txt @@ -0,0 +1,126 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.939ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.908ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.916ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.900ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.883ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.860ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.902ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.672ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.56ms 2.80ms 27.68ms 92.03% + Req/Sec 1.84k 273.45 3.56k 84.63% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.81ms + 75.000% 2.45ms + 90.000% 3.82ms + 99.000% 15.29ms + 99.900% 19.34ms + 99.990% 21.53ms + 99.999% 27.42ms +100.000% 27.69ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.140 0.000000 1 1.00 + 0.934 0.100000 13901 1.11 + 1.192 0.200000 27745 1.25 + 1.407 0.300000 41669 1.43 + 1.606 0.400000 55507 1.67 + 1.810 0.500000 69385 2.00 + 1.916 0.550000 76338 2.22 + 2.030 0.600000 83231 2.50 + 2.153 0.650000 90256 2.86 + 2.291 0.700000 97144 3.33 + 2.455 0.750000 104080 4.00 + 2.553 0.775000 107565 4.44 + 2.667 0.800000 111005 5.00 + 2.809 0.825000 114457 5.71 + 2.999 0.850000 117941 6.67 + 3.267 0.875000 121380 8.00 + 3.483 0.887500 123109 8.89 + 3.815 0.900000 124841 10.00 + 4.503 0.912500 126576 11.43 + 6.007 0.925000 128309 13.33 + 7.991 0.937500 130045 16.00 + 8.791 0.943750 130917 17.78 + 9.783 0.950000 131778 20.00 + 10.527 0.956250 132656 22.86 + 11.079 0.962500 133514 26.67 + 11.791 0.968750 134380 32.00 + 12.159 0.971875 134814 35.56 + 12.623 0.975000 135249 40.00 + 13.111 0.978125 135676 45.71 + 13.623 0.981250 136113 53.33 + 14.167 0.984375 136545 64.00 + 14.439 0.985938 136765 71.11 + 14.743 0.987500 136977 80.00 + 15.087 0.989062 137194 91.43 + 15.431 0.990625 137411 106.67 + 15.887 0.992188 137630 128.00 + 16.127 0.992969 137738 142.22 + 16.399 0.993750 137846 160.00 + 16.687 0.994531 137957 182.86 + 17.007 0.995313 138064 213.33 + 17.423 0.996094 138172 256.00 + 17.711 0.996484 138225 284.44 + 17.935 0.996875 138279 320.00 + 18.143 0.997266 138332 365.71 + 18.415 0.997656 138385 426.67 + 18.655 0.998047 138443 512.00 + 18.783 0.998242 138467 568.89 + 18.927 0.998437 138497 640.00 + 19.039 0.998633 138522 731.43 + 19.215 0.998828 138549 853.33 + 19.359 0.999023 138577 1024.00 + 19.423 0.999121 138589 1137.78 + 19.519 0.999219 138603 1280.00 + 19.599 0.999316 138616 1462.86 + 19.775 0.999414 138630 1706.67 + 19.951 0.999512 138644 2048.00 + 20.079 0.999561 138650 2275.56 + 20.191 0.999609 138656 2560.00 + 20.351 0.999658 138663 2925.71 + 20.591 0.999707 138670 3413.33 + 20.719 0.999756 138677 4096.00 + 20.751 0.999780 138680 4551.11 + 20.863 0.999805 138684 5120.00 + 21.119 0.999829 138687 5851.43 + 21.311 0.999854 138690 6826.67 + 21.503 0.999878 138695 8192.00 + 21.503 0.999890 138695 9102.22 + 21.615 0.999902 138697 10240.00 + 22.079 0.999915 138699 11702.86 + 22.159 0.999927 138700 13653.33 + 22.271 0.999939 138702 16384.00 + 22.607 0.999945 138703 18204.44 + 22.639 0.999951 138704 20480.00 + 23.311 0.999957 138705 23405.71 + 23.311 0.999963 138705 27306.67 + 23.343 0.999969 138706 32768.00 + 23.535 0.999973 138707 36408.89 + 23.535 0.999976 138707 40960.00 + 26.591 0.999979 138708 46811.43 + 26.591 0.999982 138708 54613.33 + 26.591 0.999985 138708 65536.00 + 27.423 0.999986 138709 72817.78 + 27.423 0.999988 138709 81920.00 + 27.423 0.999989 138709 93622.86 + 27.423 0.999991 138709 109226.67 + 27.423 0.999992 138709 131072.00 + 27.695 0.999993 138710 145635.56 + 27.695 1.000000 138710 inf +#[Mean = 2.565, StdDeviation = 2.800] +#[Max = 27.680, Total count = 138710] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 277665 requests in 20.00s, 84.05MB read + Non-2xx or 3xx responses: 58713 +Requests/sec: 13883.41 +Transfer/sec: 4.20MB +------------------------------ + +HTTP Status 404 Count: 58713 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_15000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_15000_wrk.txt new file mode 100644 index 000000000..e280714ff --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_15000_wrk.txt @@ -0,0 +1,127 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 3.005ms, rate sampling interval: 12ms + Thread calibration: mean lat.: 2.970ms, rate sampling interval: 12ms + Thread calibration: mean lat.: 2.978ms, rate sampling interval: 12ms + Thread calibration: mean lat.: 2.978ms, rate sampling interval: 12ms + Thread calibration: mean lat.: 2.997ms, rate sampling interval: 12ms + Thread calibration: mean lat.: 2.980ms, rate sampling interval: 12ms + Thread calibration: mean lat.: 3.009ms, rate sampling interval: 12ms + Thread calibration: mean lat.: 2.983ms, rate sampling interval: 12ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 4.32ms 5.17ms 36.99ms 86.21% + Req/Sec 1.96k 268.88 3.82k 74.06% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 2.17ms + 75.000% 4.02ms + 90.000% 12.26ms + 99.000% 23.60ms + 99.900% 30.96ms + 99.990% 34.59ms + 99.999% 36.42ms +100.000% 37.02ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.136 0.000000 1 1.00 + 1.044 0.100000 14876 1.11 + 1.347 0.200000 29741 1.25 + 1.606 0.300000 44594 1.43 + 1.868 0.400000 59468 1.67 + 2.169 0.500000 74310 2.00 + 2.349 0.550000 81767 2.22 + 2.565 0.600000 89213 2.50 + 2.861 0.650000 96633 2.86 + 3.303 0.700000 104044 3.33 + 4.017 0.750000 111475 4.00 + 4.643 0.775000 115178 4.44 + 5.835 0.800000 118894 5.00 + 7.427 0.825000 122608 5.71 + 8.935 0.850000 126334 6.67 + 10.151 0.875000 130043 8.00 + 11.063 0.887500 131911 8.89 + 12.263 0.900000 133752 10.00 + 13.351 0.912500 135615 11.43 + 14.367 0.925000 137476 13.33 + 15.455 0.937500 139332 16.00 + 16.031 0.943750 140260 17.78 + 16.623 0.950000 141203 20.00 + 17.263 0.956250 142125 22.86 + 17.951 0.962500 143055 26.67 + 18.815 0.968750 143979 32.00 + 19.343 0.971875 144440 35.56 + 19.919 0.975000 144905 40.00 + 20.559 0.978125 145363 45.71 + 21.135 0.981250 145826 53.33 + 21.903 0.984375 146296 64.00 + 22.335 0.985938 146529 71.11 + 22.767 0.987500 146760 80.00 + 23.295 0.989062 146990 91.43 + 23.839 0.990625 147222 106.67 + 24.479 0.992188 147454 128.00 + 24.831 0.992969 147568 142.22 + 25.199 0.993750 147689 160.00 + 25.679 0.994531 147800 182.86 + 26.271 0.995313 147916 213.33 + 26.895 0.996094 148032 256.00 + 27.215 0.996484 148092 284.44 + 27.615 0.996875 148149 320.00 + 28.127 0.997266 148209 365.71 + 28.575 0.997656 148265 426.67 + 29.231 0.998047 148325 512.00 + 29.551 0.998242 148353 568.89 + 29.903 0.998437 148380 640.00 + 30.207 0.998633 148410 731.43 + 30.591 0.998828 148438 853.33 + 31.071 0.999023 148469 1024.00 + 31.215 0.999121 148484 1137.78 + 31.375 0.999219 148496 1280.00 + 31.711 0.999316 148512 1462.86 + 31.919 0.999414 148525 1706.67 + 32.303 0.999512 148540 2048.00 + 32.511 0.999561 148548 2275.56 + 32.607 0.999609 148554 2560.00 + 32.831 0.999658 148562 2925.71 + 33.023 0.999707 148569 3413.33 + 33.247 0.999756 148576 4096.00 + 33.407 0.999780 148580 4551.11 + 33.535 0.999805 148583 5120.00 + 33.663 0.999829 148588 5851.43 + 33.951 0.999854 148591 6826.67 + 34.239 0.999878 148594 8192.00 + 34.559 0.999890 148596 9102.22 + 34.623 0.999902 148599 10240.00 + 34.687 0.999915 148600 11702.86 + 34.783 0.999927 148603 13653.33 + 34.783 0.999939 148603 16384.00 + 35.071 0.999945 148604 18204.44 + 35.135 0.999951 148606 20480.00 + 35.135 0.999957 148606 23405.71 + 35.519 0.999963 148607 27306.67 + 35.775 0.999969 148608 32768.00 + 35.775 0.999973 148608 36408.89 + 36.095 0.999976 148609 40960.00 + 36.095 0.999979 148609 46811.43 + 36.415 0.999982 148611 54613.33 + 36.415 0.999985 148611 65536.00 + 36.415 0.999986 148611 72817.78 + 36.415 0.999988 148611 81920.00 + 36.415 0.999989 148611 93622.86 + 36.415 0.999991 148611 109226.67 + 36.415 0.999992 148611 131072.00 + 36.415 0.999993 148611 145635.56 + 37.023 0.999994 148612 163840.00 + 37.023 1.000000 148612 inf +#[Mean = 4.316, StdDeviation = 5.169] +#[Max = 36.992, Total count = 148612] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 299300 requests in 20.00s, 90.60MB read + Non-2xx or 3xx responses: 63475 +Requests/sec: 14965.23 +Transfer/sec: 4.53MB +------------------------------ + +HTTP Status 404 Count: 63475 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_18000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_18000_wrk.txt new file mode 100644 index 000000000..388e5d7c0 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_18000_wrk.txt @@ -0,0 +1,126 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 9.518ms, rate sampling interval: 47ms + Thread calibration: mean lat.: 9.469ms, rate sampling interval: 47ms + Thread calibration: mean lat.: 9.512ms, rate sampling interval: 47ms + Thread calibration: mean lat.: 9.408ms, rate sampling interval: 47ms + Thread calibration: mean lat.: 9.315ms, rate sampling interval: 46ms + Thread calibration: mean lat.: 9.305ms, rate sampling interval: 46ms + Thread calibration: mean lat.: 9.413ms, rate sampling interval: 47ms + Thread calibration: mean lat.: 9.305ms, rate sampling interval: 45ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 556.49ms 246.39ms 1.04s 65.38% + Req/Sec 1.83k 189.86 2.46k 73.29% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 613.38ms + 75.000% 732.67ms + 90.000% 839.68ms + 99.000% 949.25ms + 99.900% 988.16ms + 99.990% 1.02s + 99.999% 1.03s +100.000% 1.04s + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 17.583 0.000000 1 1.00 + 128.319 0.100000 14376 1.11 + 306.431 0.200000 28766 1.25 + 484.607 0.300000 43158 1.43 + 545.791 0.400000 57600 1.67 + 613.375 0.500000 71962 2.00 + 640.511 0.550000 79063 2.22 + 667.135 0.600000 86278 2.50 + 690.175 0.650000 93530 2.86 + 708.607 0.700000 100804 3.33 + 732.671 0.750000 107887 4.00 + 748.031 0.775000 111434 4.44 + 766.975 0.800000 115027 5.00 + 782.847 0.825000 118663 5.71 + 799.231 0.850000 122254 6.67 + 817.663 0.875000 125824 8.00 + 827.903 0.887500 127621 8.89 + 839.679 0.900000 129397 10.00 + 853.503 0.912500 131200 11.43 + 867.327 0.925000 132962 13.33 + 881.151 0.937500 134811 16.00 + 888.319 0.943750 135692 17.78 + 894.463 0.950000 136585 20.00 + 901.631 0.956250 137506 22.86 + 908.287 0.962500 138383 26.67 + 915.455 0.968750 139253 32.00 + 920.063 0.971875 139745 35.56 + 924.159 0.975000 140198 40.00 + 929.279 0.978125 140636 45.71 + 933.375 0.981250 141066 53.33 + 938.495 0.984375 141542 64.00 + 941.055 0.985938 141732 71.11 + 944.127 0.987500 141970 80.00 + 947.199 0.989062 142185 91.43 + 950.783 0.990625 142394 106.67 + 954.367 0.992188 142625 128.00 + 956.415 0.992969 142733 142.22 + 959.487 0.993750 142856 160.00 + 962.047 0.994531 142962 182.86 + 965.119 0.995313 143068 213.33 + 969.215 0.996094 143185 256.00 + 971.775 0.996484 143246 284.44 + 973.311 0.996875 143294 320.00 + 974.847 0.997266 143355 365.71 + 976.383 0.997656 143417 426.67 + 978.431 0.998047 143465 512.00 + 980.479 0.998242 143493 568.89 + 981.503 0.998437 143520 640.00 + 984.063 0.998633 143550 731.43 + 986.111 0.998828 143575 853.33 + 988.671 0.999023 143601 1024.00 + 991.231 0.999121 143617 1137.78 + 992.767 0.999219 143630 1280.00 + 994.303 0.999316 143644 1462.86 + 995.327 0.999414 143661 1706.67 + 996.351 0.999512 143672 2048.00 + 996.863 0.999561 143679 2275.56 + 997.375 0.999609 143688 2560.00 + 998.911 0.999658 143693 2925.71 + 1001.471 0.999707 143699 3413.33 + 1005.567 0.999756 143706 4096.00 + 1008.127 0.999780 143712 4551.11 + 1010.175 0.999805 143713 5120.00 + 1013.247 0.999829 143717 5851.43 + 1014.271 0.999854 143722 6826.67 + 1014.783 0.999878 143725 8192.00 + 1015.295 0.999890 143727 9102.22 + 1015.295 0.999902 143727 10240.00 + 1015.807 0.999915 143730 11702.86 + 1016.319 0.999927 143732 13653.33 + 1016.831 0.999939 143733 16384.00 + 1017.343 0.999945 143734 18204.44 + 1017.343 0.999951 143734 20480.00 + 1018.367 0.999957 143735 23405.71 + 1019.391 0.999963 143736 27306.67 + 1023.999 0.999969 143737 32768.00 + 1027.071 0.999973 143738 36408.89 + 1027.071 0.999976 143738 40960.00 + 1027.071 0.999979 143738 46811.43 + 1030.143 0.999982 143739 54613.33 + 1030.143 0.999985 143739 65536.00 + 1033.727 0.999986 143740 72817.78 + 1033.727 0.999988 143740 81920.00 + 1033.727 0.999989 143740 93622.86 + 1033.727 0.999991 143740 109226.67 + 1033.727 0.999992 143740 131072.00 + 1037.823 0.999993 143741 145635.56 + 1037.823 1.000000 143741 inf +#[Mean = 556.488, StdDeviation = 246.394] +#[Max = 1037.312, Total count = 143741] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 304048 requests in 20.00s, 92.12MB read + Non-2xx or 3xx responses: 64379 +Requests/sec: 15202.80 +Transfer/sec: 4.61MB +------------------------------ + +HTTP Status 404 Count: 64379 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_8500_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_8500_wrk.txt new file mode 100644 index 000000000..9dbb18eff --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_get_8500_wrk.txt @@ -0,0 +1,123 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.610ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.650ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.651ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.617ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.649ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.615ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.606ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.619ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.04ms 1.46ms 31.60ms 93.72% + Req/Sec 1.12k 214.37 3.00k 73.53% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.90ms + 75.000% 2.44ms + 90.000% 3.00ms + 99.000% 4.90ms + 99.900% 24.43ms + 99.990% 28.19ms + 99.999% 29.84ms +100.000% 31.61ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.194 0.000000 1 1.00 + 0.975 0.100000 8433 1.11 + 1.273 0.200000 16867 1.25 + 1.503 0.300000 25333 1.43 + 1.703 0.400000 33740 1.67 + 1.898 0.500000 42170 2.00 + 1.995 0.550000 46390 2.22 + 2.097 0.600000 50602 2.50 + 2.203 0.650000 54874 2.86 + 2.317 0.700000 59056 3.33 + 2.443 0.750000 63251 4.00 + 2.513 0.775000 65374 4.44 + 2.587 0.800000 67489 5.00 + 2.667 0.825000 69563 5.71 + 2.761 0.850000 71712 6.67 + 2.865 0.875000 73783 8.00 + 2.929 0.887500 74865 8.89 + 2.997 0.900000 75907 10.00 + 3.071 0.912500 76934 11.43 + 3.163 0.925000 78012 13.33 + 3.261 0.937500 79060 16.00 + 3.323 0.943750 79569 17.78 + 3.395 0.950000 80103 20.00 + 3.481 0.956250 80630 22.86 + 3.583 0.962500 81153 26.67 + 3.707 0.968750 81682 32.00 + 3.779 0.971875 81944 35.56 + 3.865 0.975000 82207 40.00 + 3.963 0.978125 82470 45.71 + 4.081 0.981250 82738 53.33 + 4.259 0.984375 82995 64.00 + 4.375 0.985938 83126 71.11 + 4.519 0.987500 83260 80.00 + 4.739 0.989062 83391 91.43 + 5.055 0.990625 83521 106.67 + 5.563 0.992188 83654 128.00 + 5.987 0.992969 83719 142.22 + 6.611 0.993750 83785 160.00 + 7.631 0.994531 83850 182.86 + 8.647 0.995313 83916 213.33 + 10.367 0.996094 83982 256.00 + 12.751 0.996484 84015 284.44 + 15.255 0.996875 84048 320.00 + 17.007 0.997266 84082 365.71 + 19.407 0.997656 84114 426.67 + 20.559 0.998047 84148 512.00 + 21.279 0.998242 84163 568.89 + 22.191 0.998437 84180 640.00 + 23.119 0.998633 84197 731.43 + 23.695 0.998828 84213 853.33 + 24.511 0.999023 84229 1024.00 + 24.975 0.999121 84237 1137.78 + 25.391 0.999219 84246 1280.00 + 25.551 0.999316 84255 1462.86 + 25.839 0.999414 84262 1706.67 + 26.079 0.999512 84270 2048.00 + 26.191 0.999561 84274 2275.56 + 26.415 0.999609 84279 2560.00 + 26.543 0.999658 84283 2925.71 + 26.943 0.999707 84287 3413.33 + 27.503 0.999756 84291 4096.00 + 27.535 0.999780 84293 4551.11 + 27.663 0.999805 84295 5120.00 + 27.919 0.999829 84297 5851.43 + 27.999 0.999854 84299 6826.67 + 28.127 0.999878 84302 8192.00 + 28.127 0.999890 84302 9102.22 + 28.191 0.999902 84303 10240.00 + 28.207 0.999915 84304 11702.86 + 28.463 0.999927 84305 13653.33 + 28.575 0.999939 84306 16384.00 + 28.623 0.999945 84307 18204.44 + 28.623 0.999951 84307 20480.00 + 28.783 0.999957 84308 23405.71 + 28.783 0.999963 84308 27306.67 + 28.959 0.999969 84309 32768.00 + 28.959 0.999973 84309 36408.89 + 28.959 0.999976 84309 40960.00 + 29.839 0.999979 84310 46811.43 + 29.839 0.999982 84310 54613.33 + 29.839 0.999985 84310 65536.00 + 29.839 0.999986 84310 72817.78 + 29.839 0.999988 84310 81920.00 + 31.615 0.999989 84311 93622.86 + 31.615 1.000000 84311 inf +#[Mean = 2.039, StdDeviation = 1.460] +#[Max = 31.600, Total count = 84311] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 169726 requests in 20.00s, 51.28MB read + Non-2xx or 3xx responses: 36401 +Requests/sec: 8484.46 +Transfer/sec: 2.56MB +------------------------------ + +HTTP Status 404 Count: 36401 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_alloc.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_alloc.html new file mode 100644 index 000000000..1fdd8be53 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_alloc.html @@ -0,0 +1,11902 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_cpu.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_cpu.html new file mode 100644 index 000000000..5b9428d62 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_cpu.html @@ -0,0 +1,36989 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_lock.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_lock.html new file mode 100644 index 000000000..eabaa4f66 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_lock.html @@ -0,0 +1,3876 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_wrk.txt new file mode 100644 index 000000000..1494127f5 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_stable_wrk.txt @@ -0,0 +1,144 @@ +Running 5m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 2.466ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.450ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.425ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.424ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.449ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.412ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.289ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.463ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.56ms 2.66ms 38.37ms 92.19% + Req/Sec 1.58k 240.03 4.22k 82.90% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.87ms + 75.000% 2.68ms + 90.000% 4.36ms + 99.000% 14.81ms + 99.900% 24.22ms + 99.990% 31.25ms + 99.999% 36.00ms +100.000% 38.40ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.135 0.000000 1 1.00 + 0.881 0.100000 348189 1.11 + 1.165 0.200000 696576 1.25 + 1.403 0.300000 1043796 1.43 + 1.630 0.400000 1392022 1.67 + 1.865 0.500000 1740440 2.00 + 1.992 0.550000 1914008 2.22 + 2.129 0.600000 2087456 2.50 + 2.283 0.650000 2261603 2.86 + 2.463 0.700000 2436484 3.33 + 2.683 0.750000 2610207 4.00 + 2.817 0.775000 2697064 4.44 + 2.973 0.800000 2783113 5.00 + 3.169 0.825000 2870727 5.71 + 3.421 0.850000 2957424 6.67 + 3.781 0.875000 3044042 8.00 + 4.035 0.887500 3087472 8.89 + 4.363 0.900000 3131334 10.00 + 4.799 0.912500 3174710 11.43 + 5.395 0.925000 3217972 13.33 + 6.263 0.937500 3261529 16.00 + 6.851 0.943750 3283224 17.78 + 7.563 0.950000 3304861 20.00 + 8.391 0.956250 3326647 22.86 + 9.391 0.962500 3348477 26.67 + 10.447 0.968750 3370161 32.00 + 10.983 0.971875 3381082 35.56 + 11.519 0.975000 3391950 40.00 + 12.055 0.978125 3402764 45.71 + 12.623 0.981250 3413676 53.33 + 13.255 0.984375 3424479 64.00 + 13.623 0.985938 3429911 71.11 + 14.039 0.987500 3435361 80.00 + 14.503 0.989062 3440824 91.43 + 15.007 0.990625 3446232 106.67 + 15.535 0.992188 3451649 128.00 + 15.839 0.992969 3454390 142.22 + 16.167 0.993750 3457089 160.00 + 16.575 0.994531 3459807 182.86 + 17.103 0.995313 3462567 213.33 + 17.743 0.996094 3465216 256.00 + 18.127 0.996484 3466573 284.44 + 18.591 0.996875 3467943 320.00 + 19.135 0.997266 3469315 365.71 + 19.871 0.997656 3470675 426.67 + 20.767 0.998047 3472012 512.00 + 21.407 0.998242 3472698 568.89 + 22.143 0.998437 3473365 640.00 + 22.831 0.998633 3474049 731.43 + 23.519 0.998828 3474726 853.33 + 24.335 0.999023 3475416 1024.00 + 24.831 0.999121 3475755 1137.78 + 25.439 0.999219 3476092 1280.00 + 25.935 0.999316 3476429 1462.86 + 26.415 0.999414 3476769 1706.67 + 26.831 0.999512 3477102 2048.00 + 27.071 0.999561 3477280 2275.56 + 27.343 0.999609 3477447 2560.00 + 27.615 0.999658 3477613 2925.71 + 27.967 0.999707 3477783 3413.33 + 28.367 0.999756 3477954 4096.00 + 28.639 0.999780 3478036 4551.11 + 28.943 0.999805 3478122 5120.00 + 29.311 0.999829 3478210 5851.43 + 29.743 0.999854 3478293 6826.67 + 30.415 0.999878 3478378 8192.00 + 30.879 0.999890 3478419 9102.22 + 31.375 0.999902 3478461 10240.00 + 31.871 0.999915 3478503 11702.86 + 32.591 0.999927 3478547 13653.33 + 33.087 0.999939 3478588 16384.00 + 33.407 0.999945 3478610 18204.44 + 33.695 0.999951 3478632 20480.00 + 33.983 0.999957 3478653 23405.71 + 34.335 0.999963 3478677 27306.67 + 34.527 0.999969 3478694 32768.00 + 34.719 0.999973 3478705 36408.89 + 34.975 0.999976 3478717 40960.00 + 35.167 0.999979 3478726 46811.43 + 35.391 0.999982 3478737 54613.33 + 35.615 0.999985 3478748 65536.00 + 35.807 0.999986 3478754 72817.78 + 35.871 0.999988 3478759 81920.00 + 35.967 0.999989 3478764 93622.86 + 36.031 0.999991 3478770 109226.67 + 36.191 0.999992 3478774 131072.00 + 36.415 0.999993 3478777 145635.56 + 36.479 0.999994 3478780 163840.00 + 36.607 0.999995 3478782 187245.71 + 36.671 0.999995 3478786 218453.33 + 36.735 0.999996 3478787 262144.00 + 36.927 0.999997 3478789 291271.11 + 37.119 0.999997 3478791 327680.00 + 37.119 0.999997 3478791 374491.43 + 37.311 0.999998 3478793 436906.67 + 37.439 0.999998 3478794 524288.00 + 37.567 0.999998 3478795 582542.22 + 37.567 0.999998 3478795 655360.00 + 37.663 0.999999 3478796 748982.86 + 37.887 0.999999 3478797 873813.33 + 37.887 0.999999 3478797 1048576.00 + 37.919 0.999999 3478798 1165084.44 + 37.919 0.999999 3478798 1310720.00 + 37.919 0.999999 3478798 1497965.71 + 38.111 0.999999 3478799 1747626.67 + 38.111 1.000000 3478799 2097152.00 + 38.111 1.000000 3478799 2330168.89 + 38.111 1.000000 3478799 2621440.00 + 38.111 1.000000 3478799 2995931.43 + 38.399 1.000000 3478800 3495253.33 + 38.399 1.000000 3478800 inf +#[Mean = 2.564, StdDeviation = 2.657] +#[Max = 38.368, Total count = 3478800] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 3597899 requests in 5.00m, 425.47MB read +Requests/sec: 11993.06 +Transfer/sec: 1.42MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_wrk.txt new file mode 100644 index 000000000..2457aaeda --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_12000_wrk.txt @@ -0,0 +1,120 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.730ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.749ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.718ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.763ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.733ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.726ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.719ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.732ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.56ms 0.96ms 14.75ms 87.10% + Req/Sec 1.58k 158.98 2.80k 73.78% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.41ms + 75.000% 1.88ms + 90.000% 2.37ms + 99.000% 5.49ms + 99.900% 10.22ms + 99.990% 12.73ms + 99.999% 13.79ms +100.000% 14.76ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.167 0.000000 1 1.00 + 0.721 0.100000 11931 1.11 + 0.923 0.200000 23852 1.25 + 1.093 0.300000 35750 1.43 + 1.256 0.400000 47669 1.67 + 1.415 0.500000 59537 2.00 + 1.498 0.550000 65511 2.22 + 1.585 0.600000 71465 2.50 + 1.675 0.650000 77399 2.86 + 1.774 0.700000 83340 3.33 + 1.884 0.750000 89311 4.00 + 1.944 0.775000 92259 4.44 + 2.009 0.800000 95242 5.00 + 2.081 0.825000 98260 5.71 + 2.161 0.850000 101184 6.67 + 2.255 0.875000 104177 8.00 + 2.309 0.887500 105669 8.89 + 2.371 0.900000 107154 10.00 + 2.443 0.912500 108619 11.43 + 2.531 0.925000 110131 13.33 + 2.633 0.937500 111609 16.00 + 2.701 0.943750 112336 17.78 + 2.781 0.950000 113076 20.00 + 2.889 0.956250 113826 22.86 + 3.031 0.962500 114570 26.67 + 3.235 0.968750 115302 32.00 + 3.367 0.971875 115679 35.56 + 3.523 0.975000 116047 40.00 + 3.737 0.978125 116419 45.71 + 3.995 0.981250 116791 53.33 + 4.323 0.984375 117163 64.00 + 4.571 0.985938 117349 71.11 + 4.851 0.987500 117534 80.00 + 5.239 0.989062 117721 91.43 + 5.707 0.990625 117907 106.67 + 6.371 0.992188 118092 128.00 + 6.743 0.992969 118185 142.22 + 7.191 0.993750 118278 160.00 + 7.711 0.994531 118371 182.86 + 8.255 0.995313 118467 213.33 + 8.687 0.996094 118557 256.00 + 8.895 0.996484 118603 284.44 + 9.071 0.996875 118652 320.00 + 9.263 0.997266 118696 365.71 + 9.455 0.997656 118745 426.67 + 9.655 0.998047 118789 512.00 + 9.791 0.998242 118813 568.89 + 9.895 0.998437 118837 640.00 + 10.015 0.998633 118860 731.43 + 10.103 0.998828 118884 853.33 + 10.247 0.999023 118906 1024.00 + 10.319 0.999121 118917 1137.78 + 10.487 0.999219 118929 1280.00 + 10.615 0.999316 118940 1462.86 + 10.711 0.999414 118953 1706.67 + 10.863 0.999512 118964 2048.00 + 10.935 0.999561 118969 2275.56 + 11.071 0.999609 118975 2560.00 + 11.175 0.999658 118982 2925.71 + 11.247 0.999707 118987 3413.33 + 11.447 0.999756 118992 4096.00 + 11.639 0.999780 118995 4551.11 + 11.727 0.999805 118998 5120.00 + 11.767 0.999829 119001 5851.43 + 12.031 0.999854 119004 6826.67 + 12.687 0.999878 119007 8192.00 + 12.711 0.999890 119008 9102.22 + 12.839 0.999902 119010 10240.00 + 12.975 0.999915 119011 11702.86 + 13.063 0.999927 119013 13653.33 + 13.111 0.999939 119014 16384.00 + 13.151 0.999945 119015 18204.44 + 13.287 0.999951 119016 20480.00 + 13.287 0.999957 119016 23405.71 + 13.615 0.999963 119017 27306.67 + 13.663 0.999969 119018 32768.00 + 13.663 0.999973 119018 36408.89 + 13.687 0.999976 119019 40960.00 + 13.687 0.999979 119019 46811.43 + 13.687 0.999982 119019 54613.33 + 13.791 0.999985 119020 65536.00 + 13.791 0.999986 119020 72817.78 + 13.791 0.999988 119020 81920.00 + 13.791 0.999989 119020 93622.86 + 13.791 0.999991 119020 109226.67 + 14.759 0.999992 119021 131072.00 + 14.759 1.000000 119021 inf +#[Mean = 1.562, StdDeviation = 0.964] +#[Max = 14.752, Total count = 119021] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 239582 requests in 20.00s, 28.33MB read +Requests/sec: 11979.10 +Transfer/sec: 1.42MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_13000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_13000_wrk.txt new file mode 100644 index 000000000..570c96fa1 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_13000_wrk.txt @@ -0,0 +1,120 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 2.732ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.666ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.719ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.128ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.160ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.153ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.133ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.083ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.53ms 1.89ms 18.74ms 89.58% + Req/Sec 1.72k 269.11 3.89k 73.67% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 2.23ms + 75.000% 2.91ms + 90.000% 3.79ms + 99.000% 12.10ms + 99.900% 15.88ms + 99.990% 17.53ms + 99.999% 18.33ms +100.000% 18.75ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.137 0.000000 1 1.00 + 0.980 0.100000 12901 1.11 + 1.385 0.200000 25798 1.25 + 1.705 0.300000 38694 1.43 + 1.976 0.400000 51581 1.67 + 2.229 0.500000 64560 2.00 + 2.353 0.550000 71007 2.22 + 2.479 0.600000 77433 2.50 + 2.611 0.650000 83876 2.86 + 2.753 0.700000 90309 3.33 + 2.915 0.750000 96724 4.00 + 3.007 0.775000 99952 4.44 + 3.107 0.800000 103183 5.00 + 3.223 0.825000 106401 5.71 + 3.361 0.850000 109603 6.67 + 3.541 0.875000 112834 8.00 + 3.653 0.887500 114446 8.89 + 3.785 0.900000 116054 10.00 + 3.955 0.912500 117672 11.43 + 4.195 0.925000 119282 13.33 + 4.527 0.937500 120885 16.00 + 4.795 0.943750 121691 17.78 + 5.163 0.950000 122496 20.00 + 5.683 0.956250 123300 22.86 + 6.395 0.962500 124106 26.67 + 7.347 0.968750 124910 32.00 + 7.915 0.971875 125314 35.56 + 8.583 0.975000 125719 40.00 + 9.119 0.978125 126124 45.71 + 9.623 0.981250 126521 53.33 + 10.375 0.984375 126924 64.00 + 10.863 0.985938 127126 71.11 + 11.391 0.987500 127329 80.00 + 11.839 0.989062 127530 91.43 + 12.287 0.990625 127735 106.67 + 12.703 0.992188 127931 128.00 + 12.959 0.992969 128033 142.22 + 13.191 0.993750 128135 160.00 + 13.391 0.994531 128235 182.86 + 13.695 0.995313 128334 213.33 + 14.007 0.996094 128436 256.00 + 14.271 0.996484 128486 284.44 + 14.495 0.996875 128537 320.00 + 14.671 0.997266 128587 365.71 + 14.879 0.997656 128638 426.67 + 15.119 0.998047 128689 512.00 + 15.223 0.998242 128712 568.89 + 15.327 0.998437 128737 640.00 + 15.511 0.998633 128762 731.43 + 15.695 0.998828 128790 853.33 + 15.943 0.999023 128814 1024.00 + 16.015 0.999121 128825 1137.78 + 16.167 0.999219 128840 1280.00 + 16.255 0.999316 128850 1462.86 + 16.383 0.999414 128863 1706.67 + 16.639 0.999512 128876 2048.00 + 16.703 0.999561 128882 2275.56 + 16.735 0.999609 128888 2560.00 + 16.815 0.999658 128895 2925.71 + 16.847 0.999707 128901 3413.33 + 16.943 0.999756 128907 4096.00 + 17.007 0.999780 128910 4551.11 + 17.087 0.999805 128913 5120.00 + 17.263 0.999829 128916 5851.43 + 17.327 0.999854 128920 6826.67 + 17.487 0.999878 128923 8192.00 + 17.519 0.999890 128924 9102.22 + 17.567 0.999902 128926 10240.00 + 17.647 0.999915 128927 11702.86 + 17.791 0.999927 128929 13653.33 + 17.823 0.999939 128931 16384.00 + 17.823 0.999945 128931 18204.44 + 17.919 0.999951 128933 20480.00 + 17.919 0.999957 128933 23405.71 + 17.935 0.999963 128934 27306.67 + 17.967 0.999969 128935 32768.00 + 17.967 0.999973 128935 36408.89 + 17.967 0.999976 128935 40960.00 + 17.983 0.999979 128936 46811.43 + 17.983 0.999982 128936 54613.33 + 18.335 0.999985 128937 65536.00 + 18.335 0.999986 128937 72817.78 + 18.335 0.999988 128937 81920.00 + 18.335 0.999989 128937 93622.86 + 18.335 0.999991 128937 109226.67 + 18.751 0.999992 128938 131072.00 + 18.751 1.000000 128938 inf +#[Mean = 2.534, StdDeviation = 1.886] +#[Max = 18.736, Total count = 128938] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 259531 requests in 20.00s, 30.69MB read +Requests/sec: 12976.68 +Transfer/sec: 1.53MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_14000_stable_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_14000_stable_wrk.txt new file mode 100644 index 000000000..48088e9d2 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_14000_stable_wrk.txt @@ -0,0 +1,133 @@ +Running 1m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 5.438ms, rate sampling interval: 30ms + Thread calibration: mean lat.: 5.435ms, rate sampling interval: 31ms + Thread calibration: mean lat.: 5.432ms, rate sampling interval: 31ms + Thread calibration: mean lat.: 5.421ms, rate sampling interval: 30ms + Thread calibration: mean lat.: 5.376ms, rate sampling interval: 30ms + Thread calibration: mean lat.: 5.399ms, rate sampling interval: 30ms + Thread calibration: mean lat.: 5.385ms, rate sampling interval: 30ms + Thread calibration: mean lat.: 5.441ms, rate sampling interval: 31ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 6.57ms 8.55ms 63.20ms 86.71% + Req/Sec 1.78k 245.74 3.24k 78.08% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 2.57ms + 75.000% 8.22ms + 90.000% 17.97ms + 99.000% 40.70ms + 99.900% 51.68ms + 99.990% 58.24ms + 99.999% 61.73ms +100.000% 63.23ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.159 0.000000 1 1.00 + 1.091 0.100000 70034 1.11 + 1.431 0.200000 139967 1.25 + 1.742 0.300000 209860 1.43 + 2.091 0.400000 279730 1.67 + 2.569 0.500000 349616 2.00 + 2.957 0.550000 384449 2.22 + 3.601 0.600000 419319 2.50 + 4.567 0.650000 454340 2.86 + 5.943 0.700000 489255 3.33 + 8.223 0.750000 524162 4.00 + 9.583 0.775000 541684 4.44 + 10.839 0.800000 559105 5.00 + 12.255 0.825000 576638 5.71 + 13.911 0.850000 594074 6.67 + 15.759 0.875000 611524 8.00 + 16.815 0.887500 620357 8.89 + 17.967 0.900000 629001 10.00 + 19.375 0.912500 637768 11.43 + 21.039 0.925000 646467 13.33 + 22.927 0.937500 655186 16.00 + 24.031 0.943750 659582 17.78 + 25.263 0.950000 663911 20.00 + 26.591 0.956250 668282 22.86 + 28.223 0.962500 672662 26.67 + 30.367 0.968750 677026 32.00 + 31.599 0.971875 679204 35.56 + 32.959 0.975000 681381 40.00 + 34.463 0.978125 683592 45.71 + 35.935 0.981250 685759 53.33 + 37.567 0.984375 687936 64.00 + 38.399 0.985938 689033 71.11 + 39.263 0.987500 690145 80.00 + 40.159 0.989062 691233 91.43 + 41.119 0.990625 692303 106.67 + 42.239 0.992188 693423 128.00 + 42.815 0.992969 693952 142.22 + 43.455 0.993750 694486 160.00 + 44.159 0.994531 695043 182.86 + 44.895 0.995313 695587 213.33 + 45.791 0.996094 696123 256.00 + 46.303 0.996484 696405 284.44 + 46.847 0.996875 696672 320.00 + 47.391 0.997266 696955 365.71 + 48.063 0.997656 697220 426.67 + 48.735 0.998047 697490 512.00 + 49.151 0.998242 697634 568.89 + 49.663 0.998437 697763 640.00 + 50.271 0.998633 697899 731.43 + 50.943 0.998828 698038 853.33 + 51.775 0.999023 698174 1024.00 + 52.223 0.999121 698246 1137.78 + 52.703 0.999219 698310 1280.00 + 53.375 0.999316 698375 1462.86 + 54.047 0.999414 698445 1706.67 + 54.591 0.999512 698513 2048.00 + 54.847 0.999561 698548 2275.56 + 55.199 0.999609 698582 2560.00 + 55.615 0.999658 698614 2925.71 + 56.063 0.999707 698648 3413.33 + 56.511 0.999756 698682 4096.00 + 56.703 0.999780 698700 4551.11 + 56.927 0.999805 698717 5120.00 + 57.119 0.999829 698735 5851.43 + 57.599 0.999854 698750 6826.67 + 57.919 0.999878 698767 8192.00 + 58.079 0.999890 698777 9102.22 + 58.303 0.999902 698785 10240.00 + 58.559 0.999915 698793 11702.86 + 58.847 0.999927 698801 13653.33 + 59.071 0.999939 698810 16384.00 + 59.391 0.999945 698814 18204.44 + 59.455 0.999951 698818 20480.00 + 59.807 0.999957 698823 23405.71 + 59.935 0.999963 698827 27306.67 + 60.255 0.999969 698831 32768.00 + 60.351 0.999973 698833 36408.89 + 60.607 0.999976 698836 40960.00 + 60.927 0.999979 698838 46811.43 + 61.247 0.999982 698840 54613.33 + 61.503 0.999985 698842 65536.00 + 61.567 0.999986 698843 72817.78 + 61.663 0.999988 698844 81920.00 + 61.727 0.999989 698845 93622.86 + 61.951 0.999991 698846 109226.67 + 62.175 0.999992 698847 131072.00 + 62.207 0.999993 698848 145635.56 + 62.207 0.999994 698848 163840.00 + 62.367 0.999995 698849 187245.71 + 62.367 0.999995 698849 218453.33 + 62.495 0.999996 698850 262144.00 + 62.495 0.999997 698850 291271.11 + 62.495 0.999997 698850 327680.00 + 62.815 0.999997 698851 374491.43 + 62.815 0.999998 698851 436906.67 + 62.815 0.999998 698851 524288.00 + 62.815 0.999998 698851 582542.22 + 62.815 0.999998 698851 655360.00 + 63.231 0.999999 698852 748982.86 + 63.231 1.000000 698852 inf +#[Mean = 6.566, StdDeviation = 8.545] +#[Max = 63.200, Total count = 698852] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 839502 requests in 1.00m, 99.28MB read +Requests/sec: 13991.98 +Transfer/sec: 1.65MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_14000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_14000_wrk.txt new file mode 100644 index 000000000..ad826eaad --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_14000_wrk.txt @@ -0,0 +1,121 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 4.194ms, rate sampling interval: 22ms + Thread calibration: mean lat.: 4.235ms, rate sampling interval: 23ms + Thread calibration: mean lat.: 4.223ms, rate sampling interval: 22ms + Thread calibration: mean lat.: 4.198ms, rate sampling interval: 22ms + Thread calibration: mean lat.: 4.217ms, rate sampling interval: 22ms + Thread calibration: mean lat.: 4.255ms, rate sampling interval: 22ms + Thread calibration: mean lat.: 4.258ms, rate sampling interval: 22ms + Thread calibration: mean lat.: 4.213ms, rate sampling interval: 22ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 3.79ms 4.01ms 26.77ms 86.50% + Req/Sec 1.79k 230.47 3.52k 82.78% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 2.18ms + 75.000% 4.24ms + 90.000% 9.37ms + 99.000% 19.90ms + 99.900% 24.22ms + 99.990% 26.05ms + 99.999% 26.70ms +100.000% 26.78ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.159 0.000000 1 1.00 + 1.012 0.100000 13889 1.11 + 1.313 0.200000 27822 1.25 + 1.582 0.300000 41694 1.43 + 1.863 0.400000 55586 1.67 + 2.179 0.500000 69466 2.00 + 2.371 0.550000 76405 2.22 + 2.605 0.600000 83349 2.50 + 2.937 0.650000 90308 2.86 + 3.449 0.700000 97215 3.33 + 4.239 0.750000 104159 4.00 + 4.851 0.775000 107650 4.44 + 5.611 0.800000 111106 5.00 + 6.491 0.825000 114582 5.71 + 7.335 0.850000 118061 6.67 + 8.163 0.875000 121522 8.00 + 8.735 0.887500 123260 8.89 + 9.367 0.900000 125001 10.00 + 9.911 0.912500 126744 11.43 + 10.575 0.925000 128472 13.33 + 11.383 0.937500 130218 16.00 + 11.831 0.943750 131075 17.78 + 12.351 0.950000 131944 20.00 + 12.927 0.956250 132806 22.86 + 13.783 0.962500 133678 26.67 + 14.831 0.968750 134539 32.00 + 15.415 0.971875 134974 35.56 + 16.255 0.975000 135407 40.00 + 17.183 0.978125 135848 45.71 + 17.871 0.981250 136277 53.33 + 18.543 0.984375 136712 64.00 + 18.863 0.985938 136928 71.11 + 19.231 0.987500 137146 80.00 + 19.631 0.989062 137361 91.43 + 20.175 0.990625 137577 106.67 + 20.767 0.992188 137794 128.00 + 21.167 0.992969 137904 142.22 + 21.455 0.993750 138013 160.00 + 21.759 0.994531 138126 182.86 + 22.031 0.995313 138230 213.33 + 22.303 0.996094 138339 256.00 + 22.479 0.996484 138391 284.44 + 22.687 0.996875 138451 320.00 + 22.863 0.997266 138500 365.71 + 23.055 0.997656 138555 426.67 + 23.295 0.998047 138608 512.00 + 23.471 0.998242 138636 568.89 + 23.631 0.998437 138663 640.00 + 23.791 0.998633 138690 731.43 + 24.015 0.998828 138716 853.33 + 24.239 0.999023 138743 1024.00 + 24.335 0.999121 138757 1137.78 + 24.479 0.999219 138770 1280.00 + 24.623 0.999316 138784 1462.86 + 24.799 0.999414 138798 1706.67 + 25.039 0.999512 138812 2048.00 + 25.087 0.999561 138817 2275.56 + 25.263 0.999609 138826 2560.00 + 25.343 0.999658 138831 2925.71 + 25.423 0.999707 138838 3413.33 + 25.551 0.999756 138846 4096.00 + 25.599 0.999780 138848 4551.11 + 25.631 0.999805 138853 5120.00 + 25.727 0.999829 138855 5851.43 + 25.855 0.999854 138858 6826.67 + 25.951 0.999878 138862 8192.00 + 26.031 0.999890 138863 9102.22 + 26.111 0.999902 138865 10240.00 + 26.159 0.999915 138867 11702.86 + 26.255 0.999927 138868 13653.33 + 26.319 0.999939 138870 16384.00 + 26.335 0.999945 138871 18204.44 + 26.367 0.999951 138872 20480.00 + 26.511 0.999957 138873 23405.71 + 26.511 0.999963 138873 27306.67 + 26.527 0.999969 138874 32768.00 + 26.591 0.999973 138875 36408.89 + 26.591 0.999976 138875 40960.00 + 26.671 0.999979 138876 46811.43 + 26.671 0.999982 138876 54613.33 + 26.671 0.999985 138876 65536.00 + 26.703 0.999986 138877 72817.78 + 26.703 0.999988 138877 81920.00 + 26.703 0.999989 138877 93622.86 + 26.703 0.999991 138877 109226.67 + 26.703 0.999992 138877 131072.00 + 26.783 0.999993 138878 145635.56 + 26.783 1.000000 138878 inf +#[Mean = 3.792, StdDeviation = 4.010] +#[Max = 26.768, Total count = 138878] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 279490 requests in 20.00s, 33.05MB read +Requests/sec: 13975.38 +Transfer/sec: 1.65MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_15000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_15000_wrk.txt new file mode 100644 index 000000000..88c5a5658 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_15000_wrk.txt @@ -0,0 +1,122 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 25.845ms, rate sampling interval: 175ms + Thread calibration: mean lat.: 25.548ms, rate sampling interval: 169ms + Thread calibration: mean lat.: 25.522ms, rate sampling interval: 171ms + Thread calibration: mean lat.: 26.392ms, rate sampling interval: 176ms + Thread calibration: mean lat.: 26.492ms, rate sampling interval: 175ms + Thread calibration: mean lat.: 24.742ms, rate sampling interval: 164ms + Thread calibration: mean lat.: 24.532ms, rate sampling interval: 163ms + Thread calibration: mean lat.: 23.758ms, rate sampling interval: 158ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 12.14ms 12.34ms 64.70ms 81.32% + Req/Sec 1.88k 157.12 2.29k 72.90% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 6.97ms + 75.000% 19.06ms + 90.000% 31.63ms + 99.000% 46.91ms + 99.900% 54.33ms + 99.990% 60.70ms + 99.999% 64.70ms +100.000% 64.74ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.171 0.000000 1 1.00 + 1.394 0.100000 14898 1.11 + 1.933 0.200000 29765 1.25 + 2.643 0.300000 44635 1.43 + 4.215 0.400000 59514 1.67 + 6.967 0.500000 74381 2.00 + 8.959 0.550000 81847 2.22 + 10.727 0.600000 89291 2.50 + 12.871 0.650000 96705 2.86 + 15.615 0.700000 104141 3.33 + 19.055 0.750000 111584 4.00 + 21.247 0.775000 115299 4.44 + 23.391 0.800000 119009 5.00 + 25.487 0.825000 122743 5.71 + 27.423 0.850000 126466 6.67 + 29.375 0.875000 130178 8.00 + 30.463 0.887500 132055 8.89 + 31.631 0.900000 133908 10.00 + 32.991 0.912500 135773 11.43 + 34.463 0.925000 137648 13.33 + 36.127 0.937500 139470 16.00 + 37.087 0.943750 140418 17.78 + 38.143 0.950000 141325 20.00 + 39.199 0.956250 142255 22.86 + 40.351 0.962500 143183 26.67 + 41.631 0.968750 144126 32.00 + 42.303 0.971875 144597 35.56 + 42.943 0.975000 145052 40.00 + 43.679 0.978125 145526 45.71 + 44.383 0.981250 145979 53.33 + 45.183 0.984375 146445 64.00 + 45.631 0.985938 146676 71.11 + 46.079 0.987500 146903 80.00 + 46.591 0.989062 147138 91.43 + 47.135 0.990625 147367 106.67 + 47.775 0.992188 147603 128.00 + 48.159 0.992969 147721 142.22 + 48.511 0.993750 147833 160.00 + 48.991 0.994531 147952 182.86 + 49.599 0.995313 148069 213.33 + 50.239 0.996094 148187 256.00 + 50.527 0.996484 148240 284.44 + 51.007 0.996875 148301 320.00 + 51.455 0.997266 148359 365.71 + 51.903 0.997656 148414 426.67 + 52.415 0.998047 148473 512.00 + 52.703 0.998242 148502 568.89 + 53.119 0.998437 148529 640.00 + 53.439 0.998633 148559 731.43 + 53.887 0.998828 148587 853.33 + 54.367 0.999023 148616 1024.00 + 54.719 0.999121 148631 1137.78 + 54.943 0.999219 148645 1280.00 + 55.327 0.999316 148662 1462.86 + 55.679 0.999414 148674 1706.67 + 56.319 0.999512 148690 2048.00 + 56.543 0.999561 148696 2275.56 + 56.895 0.999609 148703 2560.00 + 57.247 0.999658 148711 2925.71 + 57.823 0.999707 148718 3413.33 + 58.239 0.999756 148725 4096.00 + 58.591 0.999780 148729 4551.11 + 58.655 0.999805 148732 5120.00 + 58.911 0.999829 148736 5851.43 + 59.455 0.999854 148740 6826.67 + 60.287 0.999878 148743 8192.00 + 60.607 0.999890 148745 9102.22 + 60.735 0.999902 148747 10240.00 + 61.919 0.999915 148749 11702.86 + 62.431 0.999927 148751 13653.33 + 62.559 0.999939 148752 16384.00 + 62.847 0.999945 148753 18204.44 + 62.879 0.999951 148754 20480.00 + 63.007 0.999957 148755 23405.71 + 63.135 0.999963 148756 27306.67 + 63.167 0.999969 148757 32768.00 + 63.167 0.999973 148757 36408.89 + 63.647 0.999976 148758 40960.00 + 63.647 0.999979 148758 46811.43 + 64.287 0.999982 148759 54613.33 + 64.287 0.999985 148759 65536.00 + 64.287 0.999986 148759 72817.78 + 64.703 0.999988 148760 81920.00 + 64.703 0.999989 148760 93622.86 + 64.703 0.999991 148760 109226.67 + 64.703 0.999992 148760 131072.00 + 64.703 0.999993 148760 145635.56 + 64.735 0.999994 148761 163840.00 + 64.735 1.000000 148761 inf +#[Mean = 12.140, StdDeviation = 12.341] +#[Max = 64.704, Total count = 148761] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 299428 requests in 20.00s, 35.41MB read +Requests/sec: 14972.38 +Transfer/sec: 1.77MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_16000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_16000_wrk.txt new file mode 100644 index 000000000..31bc4213e --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_16000_wrk.txt @@ -0,0 +1,122 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 9.931ms, rate sampling interval: 50ms + Thread calibration: mean lat.: 9.983ms, rate sampling interval: 50ms + Thread calibration: mean lat.: 9.956ms, rate sampling interval: 50ms + Thread calibration: mean lat.: 10.073ms, rate sampling interval: 50ms + Thread calibration: mean lat.: 10.049ms, rate sampling interval: 50ms + Thread calibration: mean lat.: 9.935ms, rate sampling interval: 50ms + Thread calibration: mean lat.: 9.880ms, rate sampling interval: 50ms + Thread calibration: mean lat.: 9.941ms, rate sampling interval: 50ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 13.83ms 13.22ms 71.04ms 82.85% + Req/Sec 2.03k 342.26 3.63k 73.64% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 9.60ms + 75.000% 20.19ms + 90.000% 34.37ms + 99.000% 52.70ms + 99.900% 60.58ms + 99.990% 67.26ms + 99.999% 69.69ms +100.000% 71.10ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.172 0.000000 1 1.00 + 1.560 0.100000 15940 1.11 + 2.323 0.200000 31886 1.25 + 3.797 0.300000 47798 1.43 + 6.391 0.400000 63723 1.67 + 9.599 0.500000 79654 2.00 + 11.351 0.550000 87619 2.22 + 13.207 0.600000 95594 2.50 + 15.207 0.650000 103562 2.86 + 17.503 0.700000 111539 3.33 + 20.191 0.750000 119482 4.00 + 21.887 0.775000 123454 4.44 + 23.903 0.800000 127452 5.00 + 26.239 0.825000 131421 5.71 + 28.687 0.850000 135403 6.67 + 31.359 0.875000 139390 8.00 + 32.831 0.887500 141388 8.89 + 34.367 0.900000 143388 10.00 + 35.967 0.912500 145364 11.43 + 37.759 0.925000 147351 13.33 + 39.903 0.937500 149353 16.00 + 41.087 0.943750 150362 17.78 + 42.367 0.950000 151335 20.00 + 43.775 0.956250 152335 22.86 + 45.247 0.962500 153324 26.67 + 46.751 0.968750 154324 32.00 + 47.551 0.971875 154826 35.56 + 48.351 0.975000 155318 40.00 + 49.151 0.978125 155828 45.71 + 49.983 0.981250 156312 53.33 + 50.847 0.984375 156807 64.00 + 51.295 0.985938 157064 71.11 + 51.839 0.987500 157324 80.00 + 52.351 0.989062 157564 91.43 + 52.959 0.990625 157802 106.67 + 53.695 0.992188 158061 128.00 + 54.079 0.992969 158186 142.22 + 54.495 0.993750 158301 160.00 + 54.975 0.994531 158431 182.86 + 55.519 0.995313 158550 213.33 + 56.127 0.996094 158676 256.00 + 56.511 0.996484 158736 284.44 + 56.895 0.996875 158803 320.00 + 57.247 0.997266 158861 365.71 + 57.663 0.997656 158924 426.67 + 58.303 0.998047 158984 512.00 + 58.655 0.998242 159018 568.89 + 59.007 0.998437 159047 640.00 + 59.519 0.998633 159079 731.43 + 60.095 0.998828 159112 853.33 + 60.639 0.999023 159140 1024.00 + 61.183 0.999121 159155 1137.78 + 61.727 0.999219 159171 1280.00 + 62.239 0.999316 159187 1462.86 + 62.655 0.999414 159202 1706.67 + 63.391 0.999512 159218 2048.00 + 63.711 0.999561 159225 2275.56 + 64.127 0.999609 159233 2560.00 + 64.575 0.999658 159241 2925.71 + 65.023 0.999707 159250 3413.33 + 65.503 0.999756 159258 4096.00 + 65.535 0.999780 159260 4551.11 + 66.047 0.999805 159264 5120.00 + 66.303 0.999829 159269 5851.43 + 66.495 0.999854 159272 6826.67 + 66.943 0.999878 159276 8192.00 + 67.199 0.999890 159278 9102.22 + 67.455 0.999902 159280 10240.00 + 67.647 0.999915 159282 11702.86 + 67.967 0.999927 159285 13653.33 + 68.351 0.999939 159286 16384.00 + 68.607 0.999945 159287 18204.44 + 68.735 0.999951 159288 20480.00 + 68.799 0.999957 159289 23405.71 + 68.927 0.999963 159290 27306.67 + 69.055 0.999969 159291 32768.00 + 69.055 0.999973 159291 36408.89 + 69.375 0.999976 159292 40960.00 + 69.375 0.999979 159292 46811.43 + 69.695 0.999982 159293 54613.33 + 69.695 0.999985 159293 65536.00 + 69.695 0.999986 159293 72817.78 + 70.079 0.999988 159294 81920.00 + 70.079 0.999989 159294 93622.86 + 70.079 0.999991 159294 109226.67 + 70.079 0.999992 159294 131072.00 + 70.079 0.999993 159294 145635.56 + 71.103 0.999994 159295 163840.00 + 71.103 1.000000 159295 inf +#[Mean = 13.833, StdDeviation = 13.224] +#[Max = 71.040, Total count = 159295] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 319383 requests in 20.00s, 37.77MB read +Requests/sec: 15969.99 +Transfer/sec: 1.89MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_18000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_18000_wrk.txt new file mode 100644 index 000000000..291914657 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_18000_wrk.txt @@ -0,0 +1,122 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 102.826ms, rate sampling interval: 475ms + Thread calibration: mean lat.: 101.806ms, rate sampling interval: 476ms + Thread calibration: mean lat.: 101.864ms, rate sampling interval: 475ms + Thread calibration: mean lat.: 115.721ms, rate sampling interval: 561ms + Thread calibration: mean lat.: 102.449ms, rate sampling interval: 478ms + Thread calibration: mean lat.: 111.469ms, rate sampling interval: 538ms + Thread calibration: mean lat.: 104.950ms, rate sampling interval: 497ms + Thread calibration: mean lat.: 103.272ms, rate sampling interval: 486ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 802.30ms 438.72ms 1.74s 55.75% + Req/Sec 1.94k 143.16 2.34k 65.58% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 731.14ms + 75.000% 1.22s + 90.000% 1.42s + 99.000% 1.61s + 99.900% 1.70s + 99.990% 1.73s + 99.999% 1.74s +100.000% 1.74s + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 106.687 0.000000 1 1.00 + 277.503 0.100000 15345 1.11 + 354.815 0.200000 30697 1.25 + 428.543 0.300000 46050 1.43 + 551.423 0.400000 61353 1.67 + 731.135 0.500000 76705 2.00 + 827.903 0.550000 84367 2.22 + 939.007 0.600000 92041 2.50 + 1064.959 0.650000 99704 2.86 + 1149.951 0.700000 107407 3.33 + 1217.535 0.750000 115031 4.00 + 1250.303 0.775000 118898 4.44 + 1285.119 0.800000 122794 5.00 + 1314.815 0.825000 126563 5.71 + 1348.607 0.850000 130392 6.67 + 1381.375 0.875000 134240 8.00 + 1398.783 0.887500 136125 8.89 + 1417.215 0.900000 138032 10.00 + 1436.671 0.912500 139936 11.43 + 1457.151 0.925000 141938 13.33 + 1477.631 0.937500 143804 16.00 + 1487.871 0.943750 144734 17.78 + 1501.183 0.950000 145742 20.00 + 1512.447 0.956250 146648 22.86 + 1525.759 0.962500 147647 26.67 + 1540.095 0.968750 148601 32.00 + 1547.263 0.971875 149065 35.56 + 1555.455 0.975000 149554 40.00 + 1565.695 0.978125 150015 45.71 + 1575.935 0.981250 150495 53.33 + 1590.271 0.984375 150985 64.00 + 1596.415 0.985938 151214 71.11 + 1603.583 0.987500 151444 80.00 + 1609.727 0.989062 151692 91.43 + 1615.871 0.990625 151919 106.67 + 1624.063 0.992188 152160 128.00 + 1630.207 0.992969 152276 142.22 + 1639.423 0.993750 152417 160.00 + 1644.543 0.994531 152527 182.86 + 1649.663 0.995313 152652 213.33 + 1655.807 0.996094 152757 256.00 + 1659.903 0.996484 152821 284.44 + 1662.975 0.996875 152888 320.00 + 1666.047 0.997266 152934 365.71 + 1672.191 0.997656 152997 426.67 + 1677.311 0.998047 153052 512.00 + 1680.383 0.998242 153086 568.89 + 1683.455 0.998437 153116 640.00 + 1687.551 0.998633 153146 731.43 + 1691.647 0.998828 153174 853.33 + 1696.767 0.999023 153206 1024.00 + 1699.839 0.999121 153217 1137.78 + 1702.911 0.999219 153236 1280.00 + 1704.959 0.999316 153250 1462.86 + 1707.007 0.999414 153266 1706.67 + 1710.079 0.999512 153277 2048.00 + 1712.127 0.999561 153285 2275.56 + 1714.175 0.999609 153294 2560.00 + 1715.199 0.999658 153299 2925.71 + 1717.247 0.999707 153309 3413.33 + 1718.271 0.999756 153315 4096.00 + 1719.295 0.999780 153321 4551.11 + 1720.319 0.999805 153323 5120.00 + 1722.367 0.999829 153326 5851.43 + 1723.391 0.999854 153329 6826.67 + 1725.439 0.999878 153335 8192.00 + 1725.439 0.999890 153335 9102.22 + 1726.463 0.999902 153339 10240.00 + 1726.463 0.999915 153339 11702.86 + 1727.487 0.999927 153341 13653.33 + 1728.511 0.999939 153343 16384.00 + 1728.511 0.999945 153343 18204.44 + 1729.535 0.999951 153346 20480.00 + 1729.535 0.999957 153346 23405.71 + 1729.535 0.999963 153346 27306.67 + 1736.703 0.999969 153347 32768.00 + 1736.703 0.999973 153347 36408.89 + 1737.727 0.999976 153348 40960.00 + 1737.727 0.999979 153348 46811.43 + 1739.775 0.999982 153350 54613.33 + 1739.775 0.999985 153350 65536.00 + 1739.775 0.999986 153350 72817.78 + 1739.775 0.999988 153350 81920.00 + 1739.775 0.999989 153350 93622.86 + 1739.775 0.999991 153350 109226.67 + 1739.775 0.999992 153350 131072.00 + 1739.775 0.999993 153350 145635.56 + 1742.847 0.999994 153351 163840.00 + 1742.847 1.000000 153351 inf +#[Mean = 802.300, StdDeviation = 438.720] +#[Max = 1741.824, Total count = 153351] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 330853 requests in 20.00s, 39.13MB read +Requests/sec: 16543.43 +Transfer/sec: 1.96MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_8500_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_8500_wrk.txt new file mode 100644 index 000000000..283181a7c --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/async_put_8500_wrk.txt @@ -0,0 +1,118 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.533ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.602ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.597ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.737ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.751ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.700ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.714ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.729ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.64ms 624.66us 5.66ms 68.50% + Req/Sec 1.12k 175.46 1.78k 70.45% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.63ms + 75.000% 2.04ms + 90.000% 2.42ms + 99.000% 3.29ms + 99.900% 4.22ms + 99.990% 4.89ms + 99.999% 5.30ms +100.000% 5.67ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.198 0.000000 1 1.00 + 0.824 0.100000 8440 1.11 + 1.095 0.200000 16873 1.25 + 1.299 0.300000 25325 1.43 + 1.469 0.400000 33755 1.67 + 1.628 0.500000 42169 2.00 + 1.705 0.550000 46385 2.22 + 1.783 0.600000 50617 2.50 + 1.862 0.650000 54806 2.86 + 1.946 0.700000 59029 3.33 + 2.037 0.750000 63246 4.00 + 2.087 0.775000 65374 4.44 + 2.141 0.800000 67517 5.00 + 2.199 0.825000 69555 5.71 + 2.263 0.850000 71690 6.67 + 2.335 0.875000 73817 8.00 + 2.375 0.887500 74857 8.89 + 2.419 0.900000 75900 10.00 + 2.469 0.912500 76960 11.43 + 2.527 0.925000 78014 13.33 + 2.595 0.937500 79060 16.00 + 2.633 0.943750 79562 17.78 + 2.679 0.950000 80100 20.00 + 2.729 0.956250 80634 22.86 + 2.785 0.962500 81158 26.67 + 2.851 0.968750 81673 32.00 + 2.889 0.971875 81940 35.56 + 2.931 0.975000 82202 40.00 + 2.981 0.978125 82462 45.71 + 3.039 0.981250 82726 53.33 + 3.109 0.984375 82989 64.00 + 3.145 0.985938 83119 71.11 + 3.191 0.987500 83251 80.00 + 3.249 0.989062 83388 91.43 + 3.307 0.990625 83515 106.67 + 3.387 0.992188 83648 128.00 + 3.427 0.992969 83712 142.22 + 3.475 0.993750 83781 160.00 + 3.519 0.994531 83844 182.86 + 3.603 0.995313 83909 213.33 + 3.709 0.996094 83975 256.00 + 3.761 0.996484 84010 284.44 + 3.809 0.996875 84041 320.00 + 3.851 0.997266 84074 365.71 + 3.899 0.997656 84108 426.67 + 3.965 0.998047 84140 512.00 + 4.019 0.998242 84157 568.89 + 4.055 0.998437 84173 640.00 + 4.093 0.998633 84189 731.43 + 4.167 0.998828 84206 853.33 + 4.231 0.999023 84222 1024.00 + 4.255 0.999121 84230 1137.78 + 4.283 0.999219 84239 1280.00 + 4.307 0.999316 84247 1462.86 + 4.371 0.999414 84255 1706.67 + 4.419 0.999512 84263 2048.00 + 4.475 0.999561 84268 2275.56 + 4.507 0.999609 84272 2560.00 + 4.535 0.999658 84276 2925.71 + 4.627 0.999707 84280 3413.33 + 4.655 0.999756 84284 4096.00 + 4.683 0.999780 84286 4551.11 + 4.747 0.999805 84288 5120.00 + 4.803 0.999829 84290 5851.43 + 4.811 0.999854 84292 6826.67 + 4.839 0.999878 84294 8192.00 + 4.887 0.999890 84295 9102.22 + 4.891 0.999902 84296 10240.00 + 4.927 0.999915 84297 11702.86 + 4.995 0.999927 84298 13653.33 + 5.051 0.999939 84299 16384.00 + 5.131 0.999945 84300 18204.44 + 5.131 0.999951 84300 20480.00 + 5.147 0.999957 84301 23405.71 + 5.147 0.999963 84301 27306.67 + 5.155 0.999969 84302 32768.00 + 5.155 0.999973 84302 36408.89 + 5.155 0.999976 84302 40960.00 + 5.299 0.999979 84303 46811.43 + 5.299 0.999982 84303 54613.33 + 5.299 0.999985 84303 65536.00 + 5.299 0.999986 84303 72817.78 + 5.299 0.999988 84303 81920.00 + 5.667 0.999989 84304 93622.86 + 5.667 1.000000 84304 inf +#[Mean = 1.639, StdDeviation = 0.625] +#[Max = 5.664, Total count = 84304] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 169714 requests in 20.00s, 20.07MB read +Requests/sec: 8485.49 +Transfer/sec: 1.00MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_alloc.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_alloc.html new file mode 100644 index 000000000..4d3b97220 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_alloc.html @@ -0,0 +1,1397 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_cpu.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_cpu.html new file mode 100644 index 000000000..a7f8997de --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_cpu.html @@ -0,0 +1,5340 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_lock.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_lock.html new file mode 100644 index 000000000..cbcc5fb8c --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_lock.html @@ -0,0 +1,516 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_wrk.txt new file mode 100644 index 000000000..fbb03aa43 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_get_wrk.txt @@ -0,0 +1,150 @@ +Running 5m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.399ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.390ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.369ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.385ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.374ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.387ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.396ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.391ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.23ms 1.57ms 46.27ms 99.31% + Req/Sec 1.84k 140.68 3.11k 59.11% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.12ms + 75.000% 1.50ms + 90.000% 1.82ms + 99.000% 2.53ms + 99.900% 31.92ms + 99.990% 43.46ms + 99.999% 44.86ms +100.000% 46.30ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.086 0.000000 1 1.00 + 0.493 0.100000 406424 1.11 + 0.677 0.200000 814135 1.25 + 0.833 0.300000 1218794 1.43 + 0.979 0.400000 1624426 1.67 + 1.122 0.500000 2029918 2.00 + 1.194 0.550000 2234536 2.22 + 1.266 0.600000 2437025 2.50 + 1.339 0.650000 2639272 2.86 + 1.415 0.700000 2842685 3.33 + 1.496 0.750000 3045795 4.00 + 1.539 0.775000 3146715 4.44 + 1.585 0.800000 3247711 5.00 + 1.635 0.825000 3350057 5.71 + 1.689 0.850000 3450824 6.67 + 1.750 0.875000 3552740 8.00 + 1.783 0.887500 3602703 8.89 + 1.820 0.900000 3654261 10.00 + 1.860 0.912500 3704329 11.43 + 1.905 0.925000 3754848 13.33 + 1.958 0.937500 3805786 16.00 + 1.988 0.943750 3831282 17.78 + 2.021 0.950000 3856510 20.00 + 2.059 0.956250 3882435 22.86 + 2.101 0.962500 3907238 26.67 + 2.151 0.968750 3932262 32.00 + 2.181 0.971875 3945366 35.56 + 2.213 0.975000 3957554 40.00 + 2.253 0.978125 3970519 45.71 + 2.299 0.981250 3983006 53.33 + 2.357 0.984375 3995592 64.00 + 2.395 0.985938 4002126 71.11 + 2.437 0.987500 4008146 80.00 + 2.491 0.989062 4014500 91.43 + 2.565 0.990625 4020922 106.67 + 2.679 0.992188 4027202 128.00 + 2.771 0.992969 4030352 142.22 + 2.943 0.993750 4033515 160.00 + 3.491 0.994531 4036685 182.86 + 5.035 0.995313 4039851 213.33 + 6.995 0.996094 4043024 256.00 + 8.087 0.996484 4044610 284.44 + 9.383 0.996875 4046195 320.00 + 11.343 0.997266 4047779 365.71 + 14.471 0.997656 4049364 426.67 + 19.599 0.998047 4050949 512.00 + 22.399 0.998242 4051744 568.89 + 24.879 0.998437 4052540 640.00 + 27.183 0.998633 4053328 731.43 + 29.631 0.998828 4054121 853.33 + 32.255 0.999023 4054912 1024.00 + 33.759 0.999121 4055314 1137.78 + 35.039 0.999219 4055717 1280.00 + 35.711 0.999316 4056102 1462.86 + 36.543 0.999414 4056504 1706.67 + 38.015 0.999512 4056901 2048.00 + 38.559 0.999561 4057092 2275.56 + 39.071 0.999609 4057290 2560.00 + 39.615 0.999658 4057490 2925.71 + 40.191 0.999707 4057687 3413.33 + 40.895 0.999756 4057891 4096.00 + 41.247 0.999780 4057991 4551.11 + 41.695 0.999805 4058086 5120.00 + 42.239 0.999829 4058185 5851.43 + 42.751 0.999854 4058288 6826.67 + 43.103 0.999878 4058385 8192.00 + 43.327 0.999890 4058439 9102.22 + 43.487 0.999902 4058484 10240.00 + 43.615 0.999915 4058529 11702.86 + 43.775 0.999927 4058583 13653.33 + 43.935 0.999939 4058629 16384.00 + 44.031 0.999945 4058657 18204.44 + 44.095 0.999951 4058677 20480.00 + 44.191 0.999957 4058704 23405.71 + 44.287 0.999963 4058736 27306.67 + 44.383 0.999969 4058753 32768.00 + 44.447 0.999973 4058770 36408.89 + 44.511 0.999976 4058782 40960.00 + 44.575 0.999979 4058792 46811.43 + 44.639 0.999982 4058807 54613.33 + 44.735 0.999985 4058818 65536.00 + 44.767 0.999986 4058824 72817.78 + 44.799 0.999988 4058827 81920.00 + 44.831 0.999989 4058833 93622.86 + 44.927 0.999991 4058840 109226.67 + 44.959 0.999992 4058845 131072.00 + 44.991 0.999993 4058850 145635.56 + 45.023 0.999994 4058851 163840.00 + 45.055 0.999995 4058855 187245.71 + 45.087 0.999995 4058857 218453.33 + 45.183 0.999996 4058861 262144.00 + 45.215 0.999997 4058864 291271.11 + 45.215 0.999997 4058864 327680.00 + 45.247 0.999997 4058865 374491.43 + 45.311 0.999998 4058867 436906.67 + 45.407 0.999998 4058868 524288.00 + 45.439 0.999998 4058870 582542.22 + 45.439 0.999998 4058870 655360.00 + 45.439 0.999999 4058870 748982.86 + 45.471 0.999999 4058871 873813.33 + 45.503 0.999999 4058872 1048576.00 + 45.503 0.999999 4058872 1165084.44 + 45.503 0.999999 4058872 1310720.00 + 45.599 0.999999 4058873 1497965.71 + 45.599 0.999999 4058873 1747626.67 + 45.791 1.000000 4058874 2097152.00 + 45.791 1.000000 4058874 2330168.89 + 45.791 1.000000 4058874 2621440.00 + 45.791 1.000000 4058874 2995931.43 + 45.791 1.000000 4058874 3495253.33 + 46.303 1.000000 4058875 4194304.00 + 46.303 1.000000 4058875 inf +#[Mean = 1.227, StdDeviation = 1.568] +#[Max = 46.272, Total count = 4058875] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 4199524 requests in 5.00m, 1.17GB read + Non-2xx or 3xx responses: 884836 +Requests/sec: 13998.41 +Transfer/sec: 3.98MB +------------------------------ + +HTTP Status 404 Count: 884836 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_alloc.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_alloc.html new file mode 100644 index 000000000..c5d9e8ef2 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_alloc.html @@ -0,0 +1,1428 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_cpu.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_cpu.html new file mode 100644 index 000000000..cf79492db --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_cpu.html @@ -0,0 +1,7928 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_lock.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_lock.html new file mode 100644 index 000000000..ed067e3fa --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_lock.html @@ -0,0 +1,560 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_wrk.txt new file mode 100644 index 000000000..507ac3e87 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/old_put_wrk.txt @@ -0,0 +1,147 @@ +Running 5m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.639ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.649ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.639ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.629ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.627ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.634ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.642ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.632ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.74ms 1.79ms 32.48ms 90.06% + Req/Sec 2.30k 310.90 4.44k 81.90% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.27ms + 75.000% 1.82ms + 90.000% 3.51ms + 99.000% 9.50ms + 99.900% 16.16ms + 99.990% 27.84ms + 99.999% 31.22ms +100.000% 32.49ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.083 0.000000 1 1.00 + 0.532 0.100000 507397 1.11 + 0.739 0.200000 1016913 1.25 + 0.921 0.300000 1524003 1.43 + 1.097 0.400000 2030768 1.67 + 1.275 0.500000 2539306 2.00 + 1.366 0.550000 2792278 2.22 + 1.459 0.600000 3044158 2.50 + 1.560 0.650000 3299303 2.86 + 1.676 0.700000 3552300 3.33 + 1.823 0.750000 3806033 4.00 + 1.917 0.775000 3932435 4.44 + 2.037 0.800000 4059225 5.00 + 2.201 0.825000 4186867 5.71 + 2.459 0.850000 4312971 6.67 + 2.909 0.875000 4439765 8.00 + 3.197 0.887500 4503012 8.89 + 3.511 0.900000 4566241 10.00 + 3.847 0.912500 4629914 11.43 + 4.211 0.925000 4693340 13.33 + 4.623 0.937500 4756465 16.00 + 4.859 0.943750 4788278 17.78 + 5.119 0.950000 4819963 20.00 + 5.415 0.956250 4851858 22.86 + 5.751 0.962500 4883350 26.67 + 6.163 0.968750 4915076 32.00 + 6.403 0.971875 4931055 35.56 + 6.679 0.975000 4946924 40.00 + 7.007 0.978125 4962652 45.71 + 7.419 0.981250 4978438 53.33 + 7.999 0.984375 4994287 64.00 + 8.367 0.985938 5002356 71.11 + 8.775 0.987500 5010259 80.00 + 9.223 0.989062 5018147 91.43 + 9.711 0.990625 5026046 106.67 + 10.279 0.992188 5033986 128.00 + 10.599 0.992969 5037956 142.22 + 10.959 0.993750 5041920 160.00 + 11.375 0.994531 5045835 182.86 + 11.871 0.995313 5049786 213.33 + 12.439 0.996094 5053743 256.00 + 12.767 0.996484 5055723 284.44 + 13.111 0.996875 5057728 320.00 + 13.471 0.997266 5059695 365.71 + 13.887 0.997656 5061696 426.67 + 14.359 0.998047 5063678 512.00 + 14.639 0.998242 5064656 568.89 + 14.959 0.998437 5065651 640.00 + 15.319 0.998633 5066628 731.43 + 15.743 0.998828 5067633 853.33 + 16.223 0.999023 5068612 1024.00 + 16.543 0.999121 5069121 1137.78 + 16.895 0.999219 5069599 1280.00 + 17.375 0.999316 5070099 1462.86 + 17.999 0.999414 5070587 1706.67 + 18.895 0.999512 5071086 2048.00 + 19.487 0.999561 5071331 2275.56 + 20.127 0.999609 5071582 2560.00 + 21.167 0.999658 5071825 2925.71 + 22.511 0.999707 5072074 3413.33 + 23.711 0.999756 5072324 4096.00 + 24.319 0.999780 5072446 4551.11 + 25.023 0.999805 5072568 5120.00 + 25.839 0.999829 5072693 5851.43 + 26.559 0.999854 5072820 6826.67 + 27.279 0.999878 5072941 8192.00 + 27.567 0.999890 5073004 9102.22 + 27.951 0.999902 5073066 10240.00 + 28.367 0.999915 5073126 11702.86 + 28.799 0.999927 5073188 13653.33 + 29.295 0.999939 5073249 16384.00 + 29.551 0.999945 5073282 18204.44 + 29.727 0.999951 5073312 20480.00 + 29.935 0.999957 5073342 23405.71 + 30.191 0.999963 5073373 27306.67 + 30.479 0.999969 5073407 32768.00 + 30.559 0.999973 5073422 36408.89 + 30.671 0.999976 5073436 40960.00 + 30.751 0.999979 5073450 46811.43 + 30.895 0.999982 5073466 54613.33 + 31.007 0.999985 5073481 65536.00 + 31.103 0.999986 5073490 72817.78 + 31.135 0.999988 5073497 81920.00 + 31.199 0.999989 5073504 93622.86 + 31.295 0.999991 5073512 109226.67 + 31.343 0.999992 5073522 131072.00 + 31.375 0.999993 5073526 145635.56 + 31.439 0.999994 5073528 163840.00 + 31.487 0.999995 5073533 187245.71 + 31.519 0.999995 5073536 218453.33 + 31.567 0.999996 5073539 262144.00 + 31.583 0.999997 5073542 291271.11 + 31.647 0.999997 5073543 327680.00 + 31.679 0.999997 5073546 374491.43 + 31.695 0.999998 5073549 436906.67 + 31.695 0.999998 5073549 524288.00 + 31.791 0.999998 5073550 582542.22 + 31.999 0.999998 5073552 655360.00 + 31.999 0.999999 5073552 748982.86 + 32.127 0.999999 5073553 873813.33 + 32.175 0.999999 5073554 1048576.00 + 32.175 0.999999 5073554 1165084.44 + 32.255 0.999999 5073555 1310720.00 + 32.255 0.999999 5073555 1497965.71 + 32.399 0.999999 5073557 1747626.67 + 32.399 1.000000 5073557 2097152.00 + 32.399 1.000000 5073557 2330168.89 + 32.399 1.000000 5073557 2621440.00 + 32.399 1.000000 5073557 2995931.43 + 32.399 1.000000 5073557 3495253.33 + 32.399 1.000000 5073557 4194304.00 + 32.399 1.000000 5073557 4660337.78 + 32.495 1.000000 5073558 5242880.00 + 32.495 1.000000 5073558 inf +#[Mean = 1.740, StdDeviation = 1.785] +#[Max = 32.480, Total count = 5073558] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 5249348 requests in 5.00m, 550.87MB read +Requests/sec: 17497.92 +Transfer/sec: 1.84MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_10000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_10000_wrk.txt new file mode 100644 index 000000000..3073b9ff5 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_10000_wrk.txt @@ -0,0 +1,118 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 156.410ms, rate sampling interval: 535ms + Thread calibration: mean lat.: 155.005ms, rate sampling interval: 531ms + Thread calibration: mean lat.: 155.158ms, rate sampling interval: 532ms + Thread calibration: mean lat.: 155.069ms, rate sampling interval: 532ms + Thread calibration: mean lat.: 155.167ms, rate sampling interval: 532ms + Thread calibration: mean lat.: 155.093ms, rate sampling interval: 532ms + Thread calibration: mean lat.: 154.958ms, rate sampling interval: 532ms + Thread calibration: mean lat.: 155.084ms, rate sampling interval: 532ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 428.75ms 103.73ms 665.09ms 65.73% + Req/Sec 1.15k 26.59 1.18k 76.39% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 404.99ms + 75.000% 491.77ms + 90.000% 616.96ms + 99.000% 644.61ms + 99.900% 661.50ms + 99.990% 664.06ms + 99.999% 665.60ms +100.000% 665.60ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 286.207 0.000000 1 1.00 + 313.599 0.100000 9156 1.11 + 340.479 0.200000 18285 1.25 + 354.303 0.300000 27270 1.43 + 375.551 0.400000 36282 1.67 + 404.991 0.500000 45395 2.00 + 418.047 0.550000 50005 2.22 + 423.167 0.600000 54504 2.50 + 437.759 0.650000 59080 2.86 + 456.703 0.700000 63474 3.33 + 491.775 0.750000 68008 4.00 + 501.503 0.775000 70310 4.44 + 530.943 0.800000 72532 5.00 + 558.079 0.825000 74814 5.71 + 581.119 0.850000 77089 6.67 + 604.159 0.875000 79337 8.00 + 614.911 0.887500 80616 8.89 + 616.959 0.900000 81647 10.00 + 619.007 0.912500 82869 11.43 + 622.079 0.925000 83917 13.33 + 626.687 0.937500 85115 16.00 + 628.223 0.943750 85611 17.78 + 630.271 0.950000 86306 20.00 + 631.295 0.956250 86755 22.86 + 632.831 0.962500 87435 26.67 + 633.855 0.968750 87835 32.00 + 634.879 0.971875 88136 35.56 + 636.927 0.975000 88427 40.00 + 638.975 0.978125 88775 45.71 + 640.511 0.981250 89021 53.33 + 641.535 0.984375 89257 64.00 + 642.559 0.985938 89504 71.11 + 643.071 0.987500 89597 80.00 + 644.095 0.989062 89720 91.43 + 645.119 0.990625 89860 106.67 + 646.143 0.992188 90002 128.00 + 646.655 0.992969 90051 142.22 + 647.679 0.993750 90100 160.00 + 650.751 0.994531 90178 182.86 + 653.311 0.995313 90245 213.33 + 655.871 0.996094 90328 256.00 + 656.383 0.996484 90347 284.44 + 657.407 0.996875 90409 320.00 + 657.919 0.997266 90439 365.71 + 658.431 0.997656 90468 426.67 + 658.943 0.998047 90489 512.00 + 659.455 0.998242 90507 568.89 + 659.967 0.998437 90532 640.00 + 660.479 0.998633 90553 731.43 + 660.991 0.998828 90572 853.33 + 661.503 0.999023 90594 1024.00 + 661.503 0.999121 90594 1137.78 + 662.015 0.999219 90612 1280.00 + 662.015 0.999316 90612 1462.86 + 662.015 0.999414 90612 1706.67 + 662.527 0.999512 90625 2048.00 + 663.039 0.999561 90638 2275.56 + 663.039 0.999609 90638 2560.00 + 663.039 0.999658 90638 2925.71 + 663.551 0.999707 90652 3413.33 + 663.551 0.999756 90652 4096.00 + 663.551 0.999780 90652 4551.11 + 663.551 0.999805 90652 5120.00 + 663.551 0.999829 90652 5851.43 + 663.551 0.999854 90652 6826.67 + 664.063 0.999878 90658 8192.00 + 664.063 0.999890 90658 9102.22 + 664.063 0.999902 90658 10240.00 + 664.063 0.999915 90658 11702.86 + 664.575 0.999927 90662 13653.33 + 664.575 0.999939 90662 16384.00 + 664.575 0.999945 90662 18204.44 + 664.575 0.999951 90662 20480.00 + 664.575 0.999957 90662 23405.71 + 664.575 0.999963 90662 27306.67 + 665.087 0.999969 90663 32768.00 + 665.087 0.999973 90663 36408.89 + 665.087 0.999976 90663 40960.00 + 665.599 0.999979 90665 46811.43 + 665.599 1.000000 90665 inf +#[Mean = 428.750, StdDeviation = 103.727] +#[Max = 665.088, Total count = 90665] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 183401 requests in 20.00s, 55.38MB read + Non-2xx or 3xx responses: 39048 +Requests/sec: 9169.81 +Transfer/sec: 2.77MB +------------------------------ + +HTTP Status 404 Count: 39048 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_12000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_12000_wrk.txt new file mode 100644 index 000000000..2417ae27c --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_12000_wrk.txt @@ -0,0 +1,123 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 426.342ms, rate sampling interval: 1643ms + Thread calibration: mean lat.: 427.225ms, rate sampling interval: 1646ms + Thread calibration: mean lat.: 426.461ms, rate sampling interval: 1644ms + Thread calibration: mean lat.: 426.179ms, rate sampling interval: 1642ms + Thread calibration: mean lat.: 481.598ms, rate sampling interval: 1686ms + Thread calibration: mean lat.: 426.327ms, rate sampling interval: 1643ms + Thread calibration: mean lat.: 426.155ms, rate sampling interval: 1642ms + Thread calibration: mean lat.: 426.085ms, rate sampling interval: 1642ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.40s 269.02ms 1.90s 57.79% + Req/Sec 1.13k 4.54 1.14k 65.96% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.39s + 75.000% 1.64s + 90.000% 1.77s + 99.000% 1.85s + 99.900% 1.88s + 99.990% 1.89s + 99.999% 1.90s +100.000% 1.90s + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 927.743 0.000000 1 1.00 + 1023.999 0.100000 9064 1.11 + 1120.255 0.200000 17970 1.25 + 1214.463 0.300000 27013 1.43 + 1298.431 0.400000 35991 1.67 + 1388.543 0.500000 44955 2.00 + 1436.671 0.550000 49491 2.22 + 1487.871 0.600000 54008 2.50 + 1532.927 0.650000 58429 2.86 + 1581.055 0.700000 62905 3.33 + 1636.351 0.750000 67471 4.00 + 1658.879 0.775000 69658 4.44 + 1682.431 0.800000 71969 5.00 + 1704.959 0.825000 74151 5.71 + 1728.511 0.850000 76450 6.67 + 1752.063 0.875000 78679 8.00 + 1763.327 0.887500 79796 8.89 + 1773.567 0.900000 80888 10.00 + 1783.807 0.912500 82091 11.43 + 1795.071 0.925000 83118 13.33 + 1805.311 0.937500 84261 16.00 + 1810.431 0.943750 84815 17.78 + 1815.551 0.950000 85523 20.00 + 1819.647 0.956250 85948 22.86 + 1825.791 0.962500 86534 26.67 + 1831.935 0.968750 87103 32.00 + 1835.007 0.971875 87357 35.56 + 1838.079 0.975000 87611 40.00 + 1842.175 0.978125 87977 45.71 + 1844.223 0.981250 88197 53.33 + 1848.319 0.984375 88482 64.00 + 1850.367 0.985938 88603 71.11 + 1852.415 0.987500 88756 80.00 + 1854.463 0.989062 88969 91.43 + 1855.487 0.990625 89053 106.67 + 1856.511 0.992188 89151 128.00 + 1857.535 0.992969 89239 142.22 + 1858.559 0.993750 89320 160.00 + 1859.583 0.994531 89406 182.86 + 1860.607 0.995313 89496 213.33 + 1860.607 0.996094 89496 256.00 + 1861.631 0.996484 89545 284.44 + 1863.679 0.996875 89581 320.00 + 1866.751 0.997266 89609 365.71 + 1869.823 0.997656 89643 426.67 + 1872.895 0.998047 89671 512.00 + 1874.943 0.998242 89691 568.89 + 1876.991 0.998437 89712 640.00 + 1879.039 0.998633 89726 731.43 + 1881.087 0.998828 89748 853.33 + 1882.111 0.999023 89760 1024.00 + 1884.159 0.999121 89777 1137.78 + 1884.159 0.999219 89777 1280.00 + 1885.183 0.999316 89787 1462.86 + 1886.207 0.999414 89797 1706.67 + 1887.231 0.999512 89808 2048.00 + 1887.231 0.999561 89808 2275.56 + 1888.255 0.999609 89814 2560.00 + 1889.279 0.999658 89819 2925.71 + 1890.303 0.999707 89824 3413.33 + 1891.327 0.999756 89829 4096.00 + 1891.327 0.999780 89829 4551.11 + 1891.327 0.999805 89829 5120.00 + 1892.351 0.999829 89832 5851.43 + 1893.375 0.999854 89839 6826.67 + 1893.375 0.999878 89839 8192.00 + 1893.375 0.999890 89839 9102.22 + 1893.375 0.999902 89839 10240.00 + 1893.375 0.999915 89839 11702.86 + 1894.399 0.999927 89844 13653.33 + 1894.399 0.999939 89844 16384.00 + 1894.399 0.999945 89844 18204.44 + 1894.399 0.999951 89844 20480.00 + 1894.399 0.999957 89844 23405.71 + 1894.399 0.999963 89844 27306.67 + 1894.399 0.999969 89844 32768.00 + 1894.399 0.999973 89844 36408.89 + 1894.399 0.999976 89844 40960.00 + 1896.447 0.999979 89845 46811.43 + 1896.447 0.999982 89845 54613.33 + 1896.447 0.999985 89845 65536.00 + 1896.447 0.999986 89845 72817.78 + 1896.447 0.999988 89845 81920.00 + 1897.471 0.999989 89846 93622.86 + 1897.471 1.000000 89846 inf +#[Mean = 1396.775, StdDeviation = 269.021] +#[Max = 1896.448, Total count = 89846] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 179837 requests in 20.00s, 54.32MB read + Non-2xx or 3xx responses: 38357 +Requests/sec: 8991.62 +Transfer/sec: 2.72MB +------------------------------ + +HTTP Status 404 Count: 38357 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_14000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_14000_wrk.txt new file mode 100644 index 000000000..42f3029c6 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_14000_wrk.txt @@ -0,0 +1,98 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1680.789ms, rate sampling interval: 6217ms + Thread calibration: mean lat.: 1681.659ms, rate sampling interval: 6221ms + Thread calibration: mean lat.: 1681.051ms, rate sampling interval: 6217ms + Thread calibration: mean lat.: 1680.993ms, rate sampling interval: 6217ms + Thread calibration: mean lat.: 1636.659ms, rate sampling interval: 5836ms + Thread calibration: mean lat.: 1681.134ms, rate sampling interval: 6217ms + Thread calibration: mean lat.: 1681.151ms, rate sampling interval: 6217ms + Thread calibration: mean lat.: 1681.308ms, rate sampling interval: 6217ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 5.19s 1.02s 6.97s 57.86% + Req/Sec 1.13k 0.97 1.13k 87.50% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 5.19s + 75.000% 6.07s + 90.000% 6.60s + 99.000% 6.93s + 99.900% 6.97s + 99.990% 6.98s + 99.999% 6.98s +100.000% 6.98s + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 3233.791 0.000000 4 1.00 + 3788.799 0.100000 9007 1.11 + 4132.863 0.200000 17961 1.25 + 4481.023 0.300000 26979 1.43 + 4833.279 0.400000 35937 1.67 + 5189.631 0.500000 44944 2.00 + 5369.855 0.550000 49455 2.22 + 5541.887 0.600000 53832 2.50 + 5718.015 0.650000 58357 2.86 + 5898.239 0.700000 62888 3.33 + 6070.271 0.750000 67327 4.00 + 6160.383 0.775000 69561 4.44 + 6246.399 0.800000 71824 5.00 + 6336.511 0.825000 74039 5.71 + 6426.623 0.850000 76289 6.67 + 6512.639 0.875000 78534 8.00 + 6557.695 0.887500 79677 8.89 + 6598.655 0.900000 80759 10.00 + 6643.711 0.912500 81871 11.43 + 6688.767 0.925000 83026 13.33 + 6729.727 0.937500 84133 16.00 + 6750.207 0.943750 84720 17.78 + 6774.783 0.950000 85245 20.00 + 6803.455 0.956250 85871 22.86 + 6823.935 0.962500 86354 26.67 + 6852.607 0.968750 86968 32.00 + 6864.895 0.971875 87266 35.56 + 6877.183 0.975000 87522 40.00 + 6889.471 0.978125 87810 45.71 + 6901.759 0.981250 88082 53.33 + 6914.047 0.984375 88336 64.00 + 6922.239 0.985938 88533 71.11 + 6926.335 0.987500 88637 80.00 + 6930.431 0.989062 88733 91.43 + 6938.623 0.990625 88919 106.67 + 6942.719 0.992188 89013 128.00 + 6946.815 0.992969 89114 142.22 + 6950.911 0.993750 89204 160.00 + 6955.007 0.994531 89302 182.86 + 6955.007 0.995313 89302 213.33 + 6959.103 0.996094 89398 256.00 + 6959.103 0.996484 89398 284.44 + 6963.199 0.996875 89490 320.00 + 6963.199 0.997266 89490 365.71 + 6967.295 0.997656 89585 426.67 + 6967.295 0.998047 89585 512.00 + 6967.295 0.998242 89585 568.89 + 6967.295 0.998437 89585 640.00 + 6971.391 0.998633 89677 731.43 + 6971.391 0.998828 89677 853.33 + 6971.391 0.999023 89677 1024.00 + 6971.391 0.999121 89677 1137.78 + 6971.391 0.999219 89677 1280.00 + 6971.391 0.999316 89677 1462.86 + 6971.391 0.999414 89677 1706.67 + 6971.391 0.999512 89677 2048.00 + 6971.391 0.999561 89677 2275.56 + 6971.391 0.999609 89677 2560.00 + 6975.487 0.999658 89712 2925.71 + 6975.487 1.000000 89712 inf +#[Mean = 5189.015, StdDeviation = 1018.121] +#[Max = 6971.392, Total count = 89712] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 180604 requests in 20.00s, 54.56MB read + Non-2xx or 3xx responses: 38492 +Requests/sec: 9030.54 +Transfer/sec: 2.73MB +------------------------------ + +HTTP Status 404 Count: 38492 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_7000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_7000_wrk.txt new file mode 100644 index 000000000..b00170cd7 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_7000_wrk.txt @@ -0,0 +1,121 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.288ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.325ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.290ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.306ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.302ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.291ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.302ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.300ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.21ms 505.33us 4.14ms 67.14% + Req/Sec 0.92k 102.55 1.33k 69.41% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.18ms + 75.000% 1.54ms + 90.000% 1.87ms + 99.000% 2.55ms + 99.900% 3.19ms + 99.990% 3.71ms + 99.999% 3.89ms +100.000% 4.14ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.170 0.000000 1 1.00 + 0.569 0.100000 6944 1.11 + 0.753 0.200000 13891 1.25 + 0.907 0.300000 20869 1.43 + 1.047 0.400000 27780 1.67 + 1.182 0.500000 34719 2.00 + 1.248 0.550000 38216 2.22 + 1.316 0.600000 41658 2.50 + 1.385 0.650000 45141 2.86 + 1.457 0.700000 48610 3.33 + 1.536 0.750000 52084 4.00 + 1.581 0.775000 53832 4.44 + 1.628 0.800000 55556 5.00 + 1.679 0.825000 57287 5.71 + 1.734 0.850000 59029 6.67 + 1.797 0.875000 60770 8.00 + 1.835 0.887500 61630 8.89 + 1.873 0.900000 62511 10.00 + 1.912 0.912500 63363 11.43 + 1.960 0.925000 64233 13.33 + 2.017 0.937500 65093 16.00 + 2.049 0.943750 65534 17.78 + 2.081 0.950000 65960 20.00 + 2.119 0.956250 66394 22.86 + 2.165 0.962500 66829 26.67 + 2.217 0.968750 67267 32.00 + 2.247 0.971875 67487 35.56 + 2.281 0.975000 67697 40.00 + 2.319 0.978125 67918 45.71 + 2.361 0.981250 68129 53.33 + 2.417 0.984375 68347 64.00 + 2.449 0.985938 68459 71.11 + 2.481 0.987500 68565 80.00 + 2.523 0.989062 68674 91.43 + 2.569 0.990625 68785 106.67 + 2.613 0.992188 68888 128.00 + 2.641 0.992969 68941 142.22 + 2.677 0.993750 68998 160.00 + 2.717 0.994531 69053 182.86 + 2.773 0.995313 69104 213.33 + 2.829 0.996094 69158 256.00 + 2.855 0.996484 69187 284.44 + 2.895 0.996875 69213 320.00 + 2.933 0.997266 69240 365.71 + 2.987 0.997656 69269 426.67 + 3.029 0.998047 69294 512.00 + 3.045 0.998242 69307 568.89 + 3.079 0.998437 69321 640.00 + 3.111 0.998633 69337 731.43 + 3.159 0.998828 69348 853.33 + 3.189 0.999023 69362 1024.00 + 3.237 0.999121 69370 1137.78 + 3.255 0.999219 69375 1280.00 + 3.291 0.999316 69382 1462.86 + 3.333 0.999414 69389 1706.67 + 3.427 0.999512 69396 2048.00 + 3.445 0.999561 69399 2275.56 + 3.475 0.999609 69402 2560.00 + 3.509 0.999658 69406 2925.71 + 3.549 0.999707 69410 3413.33 + 3.599 0.999756 69413 4096.00 + 3.607 0.999780 69414 4551.11 + 3.623 0.999805 69416 5120.00 + 3.639 0.999829 69418 5851.43 + 3.641 0.999854 69419 6826.67 + 3.697 0.999878 69421 8192.00 + 3.709 0.999890 69422 9102.22 + 3.731 0.999902 69423 10240.00 + 3.733 0.999915 69424 11702.86 + 3.733 0.999927 69424 13653.33 + 3.737 0.999939 69425 16384.00 + 3.771 0.999945 69426 18204.44 + 3.771 0.999951 69426 20480.00 + 3.825 0.999957 69427 23405.71 + 3.825 0.999963 69427 27306.67 + 3.825 0.999969 69427 32768.00 + 3.895 0.999973 69428 36408.89 + 3.895 0.999976 69428 40960.00 + 3.895 0.999979 69428 46811.43 + 3.895 0.999982 69428 54613.33 + 3.895 0.999985 69428 65536.00 + 4.139 0.999986 69429 72817.78 + 4.139 1.000000 69429 inf +#[Mean = 1.210, StdDeviation = 0.505] +#[Max = 4.136, Total count = 69429] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 139791 requests in 20.00s, 42.26MB read + Non-2xx or 3xx responses: 30002 +Requests/sec: 6989.37 +Transfer/sec: 2.11MB +------------------------------ + +HTTP Status 404 Count: 30002 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_alloc.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_alloc.html new file mode 100644 index 000000000..17d95bb08 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_alloc.html @@ -0,0 +1,7192 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_cpu.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_cpu.html new file mode 100644 index 000000000..287704f41 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_cpu.html @@ -0,0 +1,15513 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_lock.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_lock.html new file mode 100644 index 000000000..cca268d49 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_lock.html @@ -0,0 +1,2048 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_wrk.txt new file mode 100644 index 000000000..4e914fdce --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_stable_wrk.txt @@ -0,0 +1,146 @@ +Running 5m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.502ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.495ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.515ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.524ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.521ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.472ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.478ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.437ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.27ms 646.40us 23.50ms 76.91% + Req/Sec 1.05k 85.63 1.55k 83.06% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.22ms + 75.000% 1.61ms + 90.000% 1.96ms + 99.000% 2.72ms + 99.900% 4.21ms + 99.990% 20.85ms + 99.999% 22.09ms +100.000% 23.52ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.137 0.000000 1 1.00 + 0.585 0.100000 232829 1.11 + 0.772 0.200000 464155 1.25 + 0.930 0.300000 696867 1.43 + 1.078 0.400000 928158 1.67 + 1.224 0.500000 1161154 2.00 + 1.297 0.550000 1276389 2.22 + 1.371 0.600000 1392083 2.50 + 1.448 0.650000 1508378 2.86 + 1.528 0.700000 1624497 3.33 + 1.613 0.750000 1739874 4.00 + 1.659 0.775000 1797887 4.44 + 1.708 0.800000 1856376 5.00 + 1.760 0.825000 1913557 5.71 + 1.818 0.850000 1971563 6.67 + 1.883 0.875000 2029662 8.00 + 1.919 0.887500 2058574 8.89 + 1.959 0.900000 2088100 10.00 + 2.002 0.912500 2116691 11.43 + 2.051 0.925000 2145406 13.33 + 2.109 0.937500 2174733 16.00 + 2.143 0.943750 2189680 17.78 + 2.179 0.950000 2203797 20.00 + 2.221 0.956250 2218171 22.86 + 2.269 0.962500 2232736 26.67 + 2.327 0.968750 2247216 32.00 + 2.361 0.971875 2254490 35.56 + 2.399 0.975000 2261487 40.00 + 2.443 0.978125 2268797 45.71 + 2.495 0.981250 2276013 53.33 + 2.559 0.984375 2283251 64.00 + 2.595 0.985938 2286875 71.11 + 2.637 0.987500 2290426 80.00 + 2.687 0.989062 2294092 91.43 + 2.745 0.990625 2297665 106.67 + 2.815 0.992188 2301254 128.00 + 2.859 0.992969 2303111 142.22 + 2.907 0.993750 2304890 160.00 + 2.967 0.994531 2306712 182.86 + 3.035 0.995313 2308518 213.33 + 3.117 0.996094 2310292 256.00 + 3.167 0.996484 2311215 284.44 + 3.227 0.996875 2312100 320.00 + 3.299 0.997266 2313003 365.71 + 3.387 0.997656 2313920 426.67 + 3.507 0.998047 2314827 512.00 + 3.587 0.998242 2315271 568.89 + 3.693 0.998437 2315721 640.00 + 3.823 0.998633 2316183 731.43 + 3.999 0.998828 2316629 853.33 + 4.259 0.999023 2317079 1024.00 + 4.463 0.999121 2317307 1137.78 + 4.771 0.999219 2317536 1280.00 + 5.239 0.999316 2317758 1462.86 + 6.103 0.999414 2317985 1706.67 + 8.223 0.999512 2318211 2048.00 + 9.967 0.999561 2318324 2275.56 + 12.127 0.999609 2318438 2560.00 + 13.447 0.999658 2318551 2925.71 + 15.415 0.999707 2318664 3413.33 + 17.183 0.999756 2318777 4096.00 + 17.823 0.999780 2318834 4551.11 + 18.479 0.999805 2318891 5120.00 + 19.503 0.999829 2318947 5851.43 + 20.255 0.999854 2319008 6826.67 + 20.639 0.999878 2319063 8192.00 + 20.767 0.999890 2319090 9102.22 + 20.879 0.999902 2319121 10240.00 + 21.007 0.999915 2319148 11702.86 + 21.103 0.999927 2319174 13653.33 + 21.215 0.999939 2319203 16384.00 + 21.327 0.999945 2319218 18204.44 + 21.407 0.999951 2319231 20480.00 + 21.455 0.999957 2319246 23405.71 + 21.567 0.999963 2319259 27306.67 + 21.679 0.999969 2319273 32768.00 + 21.727 0.999973 2319280 36408.89 + 21.807 0.999976 2319289 40960.00 + 21.839 0.999979 2319294 46811.43 + 21.903 0.999982 2319303 54613.33 + 21.951 0.999985 2319309 65536.00 + 22.015 0.999986 2319314 72817.78 + 22.031 0.999988 2319316 81920.00 + 22.079 0.999989 2319319 93622.86 + 22.127 0.999991 2319323 109226.67 + 22.191 0.999992 2319326 131072.00 + 22.271 0.999993 2319328 145635.56 + 22.303 0.999994 2319329 163840.00 + 22.383 0.999995 2319331 187245.71 + 22.511 0.999995 2319333 218453.33 + 22.575 0.999996 2319336 262144.00 + 22.575 0.999997 2319336 291271.11 + 22.575 0.999997 2319336 327680.00 + 22.639 0.999997 2319337 374491.43 + 22.783 0.999998 2319338 436906.67 + 22.815 0.999998 2319339 524288.00 + 22.879 0.999998 2319340 582542.22 + 22.879 0.999998 2319340 655360.00 + 22.879 0.999999 2319340 748982.86 + 23.183 0.999999 2319341 873813.33 + 23.183 0.999999 2319341 1048576.00 + 23.359 0.999999 2319342 1165084.44 + 23.359 0.999999 2319342 1310720.00 + 23.359 0.999999 2319342 1497965.71 + 23.359 0.999999 2319342 1747626.67 + 23.359 1.000000 2319342 2097152.00 + 23.519 1.000000 2319343 2330168.89 + 23.519 1.000000 2319343 inf +#[Mean = 1.268, StdDeviation = 0.646] +#[Max = 23.504, Total count = 2319343] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 2399741 requests in 5.00m, 730.22MB read + Non-2xx or 3xx responses: 505648 +Requests/sec: 7999.15 +Transfer/sec: 2.43MB +------------------------------ + +HTTP Status 404 Count: 505648 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_wrk.txt new file mode 100644 index 000000000..32c0308c0 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_8000_wrk.txt @@ -0,0 +1,122 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.440ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.416ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.372ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.439ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.418ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.409ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.393ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.427ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.29ms 541.90us 4.70ms 67.17% + Req/Sec 1.05k 87.80 1.44k 81.65% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.25ms + 75.000% 1.65ms + 90.000% 2.00ms + 99.000% 2.71ms + 99.900% 3.56ms + 99.990% 4.23ms + 99.999% 4.51ms +100.000% 4.70ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.180 0.000000 1 1.00 + 0.612 0.100000 7940 1.11 + 0.803 0.200000 15876 1.25 + 0.960 0.300000 23809 1.43 + 1.109 0.400000 31744 1.67 + 1.255 0.500000 39696 2.00 + 1.329 0.550000 43651 2.22 + 1.406 0.600000 47644 2.50 + 1.482 0.650000 51611 2.86 + 1.563 0.700000 55591 3.33 + 1.650 0.750000 59553 4.00 + 1.694 0.775000 61502 4.44 + 1.745 0.800000 63518 5.00 + 1.798 0.825000 65472 5.71 + 1.856 0.850000 67475 6.67 + 1.919 0.875000 69460 8.00 + 1.956 0.887500 70452 8.89 + 1.995 0.900000 71429 10.00 + 2.039 0.912500 72421 11.43 + 2.091 0.925000 73424 13.33 + 2.149 0.937500 74393 16.00 + 2.183 0.943750 74906 17.78 + 2.219 0.950000 75398 20.00 + 2.259 0.956250 75891 22.86 + 2.305 0.962500 76399 26.67 + 2.359 0.968750 76885 32.00 + 2.391 0.971875 77134 35.56 + 2.425 0.975000 77373 40.00 + 2.467 0.978125 77625 45.71 + 2.513 0.981250 77869 53.33 + 2.567 0.984375 78114 64.00 + 2.605 0.985938 78246 71.11 + 2.641 0.987500 78364 80.00 + 2.685 0.989062 78488 91.43 + 2.741 0.990625 78614 106.67 + 2.801 0.992188 78736 128.00 + 2.837 0.992969 78795 142.22 + 2.889 0.993750 78857 160.00 + 2.941 0.994531 78919 182.86 + 3.005 0.995313 78982 213.33 + 3.077 0.996094 79045 256.00 + 3.115 0.996484 79074 284.44 + 3.161 0.996875 79105 320.00 + 3.211 0.997266 79136 365.71 + 3.267 0.997656 79167 426.67 + 3.333 0.998047 79198 512.00 + 3.371 0.998242 79213 568.89 + 3.425 0.998437 79231 640.00 + 3.467 0.998633 79245 731.43 + 3.505 0.998828 79260 853.33 + 3.567 0.999023 79275 1024.00 + 3.609 0.999121 79283 1137.78 + 3.679 0.999219 79292 1280.00 + 3.747 0.999316 79298 1462.86 + 3.793 0.999414 79306 1706.67 + 3.857 0.999512 79314 2048.00 + 3.893 0.999561 79318 2275.56 + 3.949 0.999609 79322 2560.00 + 3.987 0.999658 79325 2925.71 + 4.009 0.999707 79329 3413.33 + 4.045 0.999756 79333 4096.00 + 4.085 0.999780 79335 4551.11 + 4.107 0.999805 79337 5120.00 + 4.119 0.999829 79339 5851.43 + 4.163 0.999854 79341 6826.67 + 4.195 0.999878 79343 8192.00 + 4.231 0.999890 79344 9102.22 + 4.295 0.999902 79345 10240.00 + 4.327 0.999915 79346 11702.86 + 4.367 0.999927 79347 13653.33 + 4.379 0.999939 79348 16384.00 + 4.379 0.999945 79348 18204.44 + 4.431 0.999951 79349 20480.00 + 4.431 0.999957 79349 23405.71 + 4.487 0.999963 79350 27306.67 + 4.487 0.999969 79350 32768.00 + 4.487 0.999973 79350 36408.89 + 4.507 0.999976 79351 40960.00 + 4.507 0.999979 79351 46811.43 + 4.507 0.999982 79351 54613.33 + 4.507 0.999985 79351 65536.00 + 4.507 0.999986 79351 72817.78 + 4.703 0.999988 79352 81920.00 + 4.703 1.000000 79352 inf +#[Mean = 1.292, StdDeviation = 0.542] +#[Max = 4.700, Total count = 79352] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 159749 requests in 20.00s, 48.21MB read + Non-2xx or 3xx responses: 34288 +Requests/sec: 7987.65 +Transfer/sec: 2.41MB +------------------------------ + +HTTP Status 404 Count: 34288 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_9000_stable_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_9000_stable_wrk.txt new file mode 100644 index 000000000..bfeb94e67 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_9000_stable_wrk.txt @@ -0,0 +1,135 @@ +Running 1m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 2.478ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.496ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.518ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.481ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.483ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.540ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.541ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.521ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.08ms 1.81ms 19.12ms 94.52% + Req/Sec 1.19k 118.15 1.78k 73.02% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.74ms + 75.000% 2.36ms + 90.000% 3.18ms + 99.000% 13.86ms + 99.900% 16.80ms + 99.990% 17.93ms + 99.999% 18.54ms +100.000% 19.14ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.148 0.000000 1 1.00 + 0.876 0.100000 45055 1.11 + 1.141 0.200000 90038 1.25 + 1.351 0.300000 134864 1.43 + 1.546 0.400000 179897 1.67 + 1.742 0.500000 224796 2.00 + 1.845 0.550000 247280 2.22 + 1.951 0.600000 269618 2.50 + 2.069 0.650000 292185 2.86 + 2.201 0.700000 314517 3.33 + 2.355 0.750000 337198 4.00 + 2.443 0.775000 348331 4.44 + 2.543 0.800000 359558 5.00 + 2.659 0.825000 370751 5.71 + 2.795 0.850000 381908 6.67 + 2.965 0.875000 393139 8.00 + 3.065 0.887500 398828 8.89 + 3.177 0.900000 404392 10.00 + 3.315 0.912500 409986 11.43 + 3.483 0.925000 415614 13.33 + 3.693 0.937500 421210 16.00 + 3.825 0.943750 424040 17.78 + 3.985 0.950000 426816 20.00 + 4.183 0.956250 429652 22.86 + 4.443 0.962500 432440 26.67 + 4.799 0.968750 435243 32.00 + 5.047 0.971875 436642 35.56 + 5.383 0.975000 438059 40.00 + 5.859 0.978125 439447 45.71 + 6.591 0.981250 440856 53.33 + 8.019 0.984375 442256 64.00 + 9.807 0.985938 442957 71.11 + 12.831 0.987500 443660 80.00 + 13.551 0.989062 444369 91.43 + 14.071 0.990625 445072 106.67 + 14.583 0.992188 445769 128.00 + 14.823 0.992969 446123 142.22 + 15.055 0.993750 446470 160.00 + 15.279 0.994531 446831 182.86 + 15.495 0.995313 447182 213.33 + 15.679 0.996094 447528 256.00 + 15.791 0.996484 447701 284.44 + 15.911 0.996875 447882 320.00 + 16.031 0.997266 448050 365.71 + 16.167 0.997656 448227 426.67 + 16.311 0.998047 448402 512.00 + 16.399 0.998242 448494 568.89 + 16.479 0.998437 448587 640.00 + 16.575 0.998633 448660 731.43 + 16.687 0.998828 448751 853.33 + 16.815 0.999023 448840 1024.00 + 16.895 0.999121 448884 1137.78 + 16.975 0.999219 448926 1280.00 + 17.055 0.999316 448968 1462.86 + 17.135 0.999414 449011 1706.67 + 17.263 0.999512 449058 2048.00 + 17.311 0.999561 449077 2275.56 + 17.375 0.999609 449102 2560.00 + 17.439 0.999658 449121 2925.71 + 17.519 0.999707 449148 3413.33 + 17.583 0.999756 449167 4096.00 + 17.599 0.999780 449176 4551.11 + 17.647 0.999805 449188 5120.00 + 17.711 0.999829 449200 5851.43 + 17.791 0.999854 449210 6826.67 + 17.839 0.999878 449220 8192.00 + 17.887 0.999890 449225 9102.22 + 17.951 0.999902 449231 10240.00 + 18.015 0.999915 449237 11702.86 + 18.063 0.999927 449242 13653.33 + 18.111 0.999939 449249 16384.00 + 18.127 0.999945 449250 18204.44 + 18.175 0.999951 449255 20480.00 + 18.175 0.999957 449255 23405.71 + 18.255 0.999963 449258 27306.67 + 18.319 0.999969 449262 32768.00 + 18.319 0.999973 449262 36408.89 + 18.399 0.999976 449265 40960.00 + 18.399 0.999979 449265 46811.43 + 18.415 0.999982 449267 54613.33 + 18.431 0.999985 449268 65536.00 + 18.431 0.999986 449268 72817.78 + 18.479 0.999988 449269 81920.00 + 18.543 0.999989 449271 93622.86 + 18.543 0.999991 449271 109226.67 + 18.543 0.999992 449271 131072.00 + 18.543 0.999993 449271 145635.56 + 18.607 0.999994 449272 163840.00 + 18.607 0.999995 449272 187245.71 + 18.607 0.999995 449272 218453.33 + 18.767 0.999996 449273 262144.00 + 18.767 0.999997 449273 291271.11 + 18.767 0.999997 449273 327680.00 + 18.767 0.999997 449273 374491.43 + 18.767 0.999998 449273 436906.67 + 19.135 0.999998 449274 524288.00 + 19.135 1.000000 449274 inf +#[Mean = 2.078, StdDeviation = 1.813] +#[Max = 19.120, Total count = 449274] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 539713 requests in 1.00m, 163.97MB read + Non-2xx or 3xx responses: 113608 +Requests/sec: 8995.18 +Transfer/sec: 2.73MB +------------------------------ + +HTTP Status 404 Count: 113608 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_9000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_9000_wrk.txt new file mode 100644 index 000000000..cbe5eae4b --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_get_9000_wrk.txt @@ -0,0 +1,123 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 2.612ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.618ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.630ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.625ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.605ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.665ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.658ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.667ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.81ms 800.07us 7.15ms 71.30% + Req/Sec 1.19k 117.72 1.67k 73.56% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.71ms + 75.000% 2.24ms + 90.000% 2.85ms + 99.000% 4.27ms + 99.900% 5.50ms + 99.990% 6.51ms + 99.999% 6.99ms +100.000% 7.16ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.186 0.000000 1 1.00 + 0.899 0.100000 8954 1.11 + 1.142 0.200000 17879 1.25 + 1.341 0.300000 26783 1.43 + 1.525 0.400000 35729 1.67 + 1.705 0.500000 44663 2.00 + 1.798 0.550000 49112 2.22 + 1.896 0.600000 53559 2.50 + 2.004 0.650000 58058 2.86 + 2.115 0.700000 62515 3.33 + 2.241 0.750000 66959 4.00 + 2.317 0.775000 69214 4.44 + 2.397 0.800000 71457 5.00 + 2.487 0.825000 73648 5.71 + 2.589 0.850000 75904 6.67 + 2.707 0.875000 78119 8.00 + 2.775 0.887500 79231 8.89 + 2.851 0.900000 80339 10.00 + 2.941 0.912500 81460 11.43 + 3.041 0.925000 82585 13.33 + 3.159 0.937500 83693 16.00 + 3.225 0.943750 84244 17.78 + 3.295 0.950000 84811 20.00 + 3.379 0.956250 85366 22.86 + 3.473 0.962500 85925 26.67 + 3.591 0.968750 86484 32.00 + 3.655 0.971875 86759 35.56 + 3.725 0.975000 87042 40.00 + 3.817 0.978125 87323 45.71 + 3.905 0.981250 87594 53.33 + 4.003 0.984375 87875 64.00 + 4.061 0.985938 88010 71.11 + 4.127 0.987500 88151 80.00 + 4.215 0.989062 88296 91.43 + 4.307 0.990625 88433 106.67 + 4.407 0.992188 88576 128.00 + 4.463 0.992969 88643 142.22 + 4.527 0.993750 88711 160.00 + 4.615 0.994531 88782 182.86 + 4.683 0.995313 88848 213.33 + 4.783 0.996094 88918 256.00 + 4.835 0.996484 88953 284.44 + 4.907 0.996875 88987 320.00 + 4.987 0.997266 89021 365.71 + 5.063 0.997656 89056 426.67 + 5.163 0.998047 89091 512.00 + 5.227 0.998242 89109 568.89 + 5.271 0.998437 89126 640.00 + 5.359 0.998633 89144 731.43 + 5.411 0.998828 89161 853.33 + 5.519 0.999023 89179 1024.00 + 5.579 0.999121 89187 1137.78 + 5.659 0.999219 89196 1280.00 + 5.695 0.999316 89204 1462.86 + 5.783 0.999414 89213 1706.67 + 5.883 0.999512 89222 2048.00 + 5.915 0.999561 89226 2275.56 + 5.975 0.999609 89231 2560.00 + 5.999 0.999658 89235 2925.71 + 6.043 0.999707 89239 3413.33 + 6.159 0.999756 89245 4096.00 + 6.179 0.999780 89246 4551.11 + 6.219 0.999805 89248 5120.00 + 6.247 0.999829 89250 5851.43 + 6.303 0.999854 89252 6826.67 + 6.439 0.999878 89255 8192.00 + 6.511 0.999890 89256 9102.22 + 6.531 0.999902 89257 10240.00 + 6.563 0.999915 89258 11702.86 + 6.591 0.999927 89259 13653.33 + 6.607 0.999939 89260 16384.00 + 6.627 0.999945 89261 18204.44 + 6.627 0.999951 89261 20480.00 + 6.811 0.999957 89262 23405.71 + 6.811 0.999963 89262 27306.67 + 6.919 0.999969 89263 32768.00 + 6.919 0.999973 89263 36408.89 + 6.919 0.999976 89263 40960.00 + 6.987 0.999979 89264 46811.43 + 6.987 0.999982 89264 54613.33 + 6.987 0.999985 89264 65536.00 + 6.987 0.999986 89264 72817.78 + 6.987 0.999988 89264 81920.00 + 7.155 0.999989 89265 93622.86 + 7.155 1.000000 89265 inf +#[Mean = 1.813, StdDeviation = 0.800] +#[Max = 7.152, Total count = 89265] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 179706 requests in 20.00s, 54.29MB read + Non-2xx or 3xx responses: 38351 +Requests/sec: 8985.48 +Transfer/sec: 2.71MB +------------------------------ + +HTTP Status 404 Count: 38351 +HTTP Status 503 Count: 0 diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_10000_stable_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_10000_stable_wrk.txt new file mode 100644 index 000000000..a18555328 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_10000_stable_wrk.txt @@ -0,0 +1,143 @@ +Running 5m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 3.030ms, rate sampling interval: 11ms + Thread calibration: mean lat.: 3.083ms, rate sampling interval: 11ms + Thread calibration: mean lat.: 3.065ms, rate sampling interval: 11ms + Thread calibration: mean lat.: 3.069ms, rate sampling interval: 11ms + Thread calibration: mean lat.: 3.066ms, rate sampling interval: 11ms + Thread calibration: mean lat.: 3.056ms, rate sampling interval: 11ms + Thread calibration: mean lat.: 3.080ms, rate sampling interval: 11ms + Thread calibration: mean lat.: 3.063ms, rate sampling interval: 11ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 6.39ms 6.87ms 78.91ms 87.86% + Req/Sec 1.31k 209.25 2.00k 73.35% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 3.77ms + 75.000% 9.20ms + 90.000% 14.28ms + 99.000% 30.78ms + 99.900% 68.93ms + 99.990% 75.58ms + 99.999% 77.44ms +100.000% 78.97ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.176 0.000000 1 1.00 + 1.152 0.100000 290420 1.11 + 1.613 0.200000 580172 1.25 + 2.081 0.300000 870119 1.43 + 2.719 0.400000 1159739 1.67 + 3.771 0.500000 1449910 2.00 + 4.567 0.550000 1595147 2.22 + 5.559 0.600000 1739576 2.50 + 6.691 0.650000 1884943 2.86 + 7.911 0.700000 2029556 3.33 + 9.199 0.750000 2175004 4.00 + 9.879 0.775000 2247532 4.44 + 10.599 0.800000 2320092 5.00 + 11.351 0.825000 2391852 5.71 + 12.175 0.850000 2464421 6.67 + 13.119 0.875000 2537251 8.00 + 13.655 0.887500 2573574 8.89 + 14.279 0.900000 2609537 10.00 + 15.055 0.912500 2645748 11.43 + 15.991 0.925000 2681923 13.33 + 17.103 0.937500 2718173 16.00 + 17.759 0.943750 2736511 17.78 + 18.495 0.950000 2754381 20.00 + 19.343 0.956250 2772590 22.86 + 20.271 0.962500 2790498 26.67 + 21.407 0.968750 2808762 32.00 + 22.159 0.971875 2817817 35.56 + 23.055 0.975000 2826703 40.00 + 24.063 0.978125 2835795 45.71 + 25.295 0.981250 2844885 53.33 + 26.735 0.984375 2853951 64.00 + 27.583 0.985938 2858468 71.11 + 28.655 0.987500 2862980 80.00 + 29.951 0.989062 2867490 91.43 + 31.407 0.990625 2872049 106.67 + 33.279 0.992188 2876565 128.00 + 34.367 0.992969 2878838 142.22 + 35.711 0.993750 2881097 160.00 + 37.695 0.994531 2883335 182.86 + 39.647 0.995313 2885612 213.33 + 43.583 0.996094 2887858 256.00 + 46.239 0.996484 2889009 284.44 + 48.383 0.996875 2890124 320.00 + 51.455 0.997266 2891255 365.71 + 54.559 0.997656 2892390 426.67 + 57.759 0.998047 2893525 512.00 + 59.007 0.998242 2894096 568.89 + 60.511 0.998437 2894666 640.00 + 62.111 0.998633 2895225 731.43 + 65.663 0.998828 2895787 853.33 + 69.247 0.999023 2896359 1024.00 + 70.655 0.999121 2896645 1137.78 + 71.743 0.999219 2896929 1280.00 + 72.319 0.999316 2897232 1462.86 + 72.703 0.999414 2897492 1706.67 + 73.087 0.999512 2897782 2048.00 + 73.279 0.999561 2897927 2275.56 + 73.471 0.999609 2898067 2560.00 + 73.727 0.999658 2898202 2925.71 + 74.047 0.999707 2898363 3413.33 + 74.367 0.999756 2898485 4096.00 + 74.559 0.999780 2898565 4551.11 + 74.687 0.999805 2898620 5120.00 + 74.879 0.999829 2898692 5851.43 + 75.135 0.999854 2898774 6826.67 + 75.327 0.999878 2898832 8192.00 + 75.519 0.999890 2898878 9102.22 + 75.647 0.999902 2898908 10240.00 + 75.775 0.999915 2898942 11702.86 + 75.903 0.999927 2898973 13653.33 + 76.095 0.999939 2899011 16384.00 + 76.223 0.999945 2899032 18204.44 + 76.287 0.999951 2899041 20480.00 + 76.415 0.999957 2899065 23405.71 + 76.543 0.999963 2899078 27306.67 + 76.735 0.999969 2899096 32768.00 + 76.863 0.999973 2899109 36408.89 + 76.927 0.999976 2899114 40960.00 + 77.055 0.999979 2899127 46811.43 + 77.119 0.999982 2899132 54613.33 + 77.247 0.999985 2899141 65536.00 + 77.311 0.999986 2899147 72817.78 + 77.311 0.999988 2899147 81920.00 + 77.439 0.999989 2899154 93622.86 + 77.567 0.999991 2899157 109226.67 + 77.695 0.999992 2899163 131072.00 + 77.695 0.999993 2899163 145635.56 + 77.759 0.999994 2899166 163840.00 + 77.823 0.999995 2899169 187245.71 + 77.823 0.999995 2899169 218453.33 + 77.887 0.999996 2899171 262144.00 + 78.079 0.999997 2899173 291271.11 + 78.207 0.999997 2899175 327680.00 + 78.207 0.999997 2899175 374491.43 + 78.335 0.999998 2899179 436906.67 + 78.335 0.999998 2899179 524288.00 + 78.335 0.999998 2899179 582542.22 + 78.335 0.999998 2899179 655360.00 + 78.335 0.999999 2899179 748982.86 + 78.335 0.999999 2899179 873813.33 + 78.399 0.999999 2899180 1048576.00 + 78.399 0.999999 2899180 1165084.44 + 78.399 0.999999 2899180 1310720.00 + 78.463 0.999999 2899181 1497965.71 + 78.463 0.999999 2899181 1747626.67 + 78.463 1.000000 2899181 2097152.00 + 78.463 1.000000 2899181 2330168.89 + 78.463 1.000000 2899181 2621440.00 + 78.975 1.000000 2899182 2995931.43 + 78.975 1.000000 2899182 inf +#[Mean = 6.394, StdDeviation = 6.865] +#[Max = 78.912, Total count = 2899182] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 2999664 requests in 5.00m, 354.73MB read +Requests/sec: 9998.91 +Transfer/sec: 1.18MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_10000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_10000_wrk.txt new file mode 100644 index 000000000..d9097b62e --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_10000_wrk.txt @@ -0,0 +1,119 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 3.517ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.504ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.511ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.549ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.531ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.559ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.523ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 3.551ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.27ms 1.77ms 17.71ms 87.96% + Req/Sec 1.32k 157.88 1.89k 71.88% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.85ms + 75.000% 2.70ms + 90.000% 4.02ms + 99.000% 9.73ms + 99.900% 15.98ms + 99.990% 17.10ms + 99.999% 17.71ms +100.000% 17.73ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.199 0.000000 1 1.00 + 0.848 0.100000 9922 1.11 + 1.133 0.200000 19864 1.25 + 1.374 0.300000 29769 1.43 + 1.606 0.400000 39692 1.67 + 1.851 0.500000 49596 2.00 + 1.982 0.550000 54566 2.22 + 2.129 0.600000 59566 2.50 + 2.291 0.650000 64505 2.86 + 2.479 0.700000 69451 3.33 + 2.703 0.750000 74403 4.00 + 2.841 0.775000 76875 4.44 + 2.997 0.800000 79355 5.00 + 3.181 0.825000 81828 5.71 + 3.399 0.850000 84323 6.67 + 3.671 0.875000 86793 8.00 + 3.829 0.887500 88027 8.89 + 4.019 0.900000 89270 10.00 + 4.243 0.912500 90522 11.43 + 4.483 0.925000 91762 13.33 + 4.747 0.937500 92994 16.00 + 4.911 0.943750 93606 17.78 + 5.095 0.950000 94234 20.00 + 5.303 0.956250 94855 22.86 + 5.563 0.962500 95466 26.67 + 5.899 0.968750 96085 32.00 + 6.123 0.971875 96400 35.56 + 6.383 0.975000 96708 40.00 + 6.691 0.978125 97022 45.71 + 7.047 0.981250 97330 53.33 + 7.475 0.984375 97637 64.00 + 7.811 0.985938 97791 71.11 + 8.239 0.987500 97945 80.00 + 8.959 0.989062 98100 91.43 + 10.471 0.990625 98256 106.67 + 12.367 0.992188 98410 128.00 + 13.095 0.992969 98487 142.22 + 13.711 0.993750 98566 160.00 + 14.135 0.994531 98642 182.86 + 14.495 0.995313 98721 213.33 + 14.807 0.996094 98799 256.00 + 14.935 0.996484 98838 284.44 + 15.031 0.996875 98878 320.00 + 15.183 0.997266 98913 365.71 + 15.327 0.997656 98953 426.67 + 15.503 0.998047 98993 512.00 + 15.583 0.998242 99011 568.89 + 15.711 0.998437 99031 640.00 + 15.791 0.998633 99049 731.43 + 15.887 0.998828 99069 853.33 + 16.007 0.999023 99088 1024.00 + 16.095 0.999121 99097 1137.78 + 16.175 0.999219 99107 1280.00 + 16.287 0.999316 99119 1462.86 + 16.375 0.999414 99126 1706.67 + 16.495 0.999512 99138 2048.00 + 16.527 0.999561 99141 2275.56 + 16.559 0.999609 99147 2560.00 + 16.655 0.999658 99151 2925.71 + 16.703 0.999707 99155 3413.33 + 16.751 0.999756 99160 4096.00 + 16.767 0.999780 99163 4551.11 + 16.799 0.999805 99165 5120.00 + 16.879 0.999829 99169 5851.43 + 16.895 0.999854 99170 6826.67 + 17.023 0.999878 99172 8192.00 + 17.103 0.999890 99174 9102.22 + 17.135 0.999902 99175 10240.00 + 17.231 0.999915 99176 11702.86 + 17.263 0.999927 99177 13653.33 + 17.295 0.999939 99178 16384.00 + 17.359 0.999945 99180 18204.44 + 17.359 0.999951 99180 20480.00 + 17.359 0.999957 99180 23405.71 + 17.391 0.999963 99181 27306.67 + 17.391 0.999969 99181 32768.00 + 17.503 0.999973 99182 36408.89 + 17.503 0.999976 99182 40960.00 + 17.503 0.999979 99182 46811.43 + 17.711 0.999982 99183 54613.33 + 17.711 0.999985 99183 65536.00 + 17.711 0.999986 99183 72817.78 + 17.711 0.999988 99183 81920.00 + 17.711 0.999989 99183 93622.86 + 17.727 0.999991 99184 109226.67 + 17.727 1.000000 99184 inf +#[Mean = 2.269, StdDeviation = 1.771] +#[Max = 17.712, Total count = 99184] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 199664 requests in 20.00s, 23.61MB read +Requests/sec: 9983.74 +Transfer/sec: 1.18MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_11000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_11000_wrk.txt new file mode 100644 index 000000000..947d450d4 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_11000_wrk.txt @@ -0,0 +1,119 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 12.040ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 12.000ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 12.108ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 12.094ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 12.047ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 12.093ms, rate sampling interval: 40ms + Thread calibration: mean lat.: 13.111ms, rate sampling interval: 41ms + Thread calibration: mean lat.: 12.073ms, rate sampling interval: 40ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 15.81ms 6.09ms 40.90ms 73.82% + Req/Sec 1.39k 101.76 1.60k 70.14% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 14.52ms + 75.000% 19.26ms + 90.000% 23.68ms + 99.000% 36.64ms + 99.900% 38.72ms + 99.990% 39.84ms + 99.999% 40.83ms +100.000% 40.93ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 3.281 0.000000 1 1.00 + 9.543 0.100000 10904 1.11 + 10.791 0.200000 21788 1.25 + 11.799 0.300000 32647 1.43 + 12.951 0.400000 43550 1.67 + 14.519 0.500000 54429 2.00 + 15.391 0.550000 59887 2.22 + 16.255 0.600000 65299 2.50 + 17.199 0.650000 70752 2.86 + 18.207 0.700000 76173 3.33 + 19.263 0.750000 81619 4.00 + 19.791 0.775000 84346 4.44 + 20.399 0.800000 87111 5.00 + 21.103 0.825000 89812 5.71 + 21.903 0.850000 92522 6.67 + 22.783 0.875000 95226 8.00 + 23.231 0.887500 96600 8.89 + 23.679 0.900000 97965 10.00 + 24.143 0.912500 99334 11.43 + 24.639 0.925000 100692 13.33 + 25.231 0.937500 102034 16.00 + 25.647 0.943750 102698 17.78 + 26.319 0.950000 103377 20.00 + 27.279 0.956250 104059 22.86 + 28.479 0.962500 104736 26.67 + 30.271 0.968750 105413 32.00 + 31.183 0.971875 105754 35.56 + 33.535 0.975000 106093 40.00 + 34.463 0.978125 106441 45.71 + 35.167 0.981250 106782 53.33 + 35.743 0.984375 107120 64.00 + 35.999 0.985938 107282 71.11 + 36.255 0.987500 107466 80.00 + 36.479 0.989062 107631 91.43 + 36.735 0.990625 107802 106.67 + 36.991 0.992188 107978 128.00 + 37.087 0.992969 108055 142.22 + 37.247 0.993750 108138 160.00 + 37.375 0.994531 108216 182.86 + 37.567 0.995313 108310 213.33 + 37.727 0.996094 108396 256.00 + 37.823 0.996484 108440 284.44 + 37.887 0.996875 108474 320.00 + 38.015 0.997266 108515 365.71 + 38.111 0.997656 108557 426.67 + 38.239 0.998047 108601 512.00 + 38.303 0.998242 108621 568.89 + 38.399 0.998437 108641 640.00 + 38.495 0.998633 108666 731.43 + 38.591 0.998828 108686 853.33 + 38.751 0.999023 108708 1024.00 + 38.815 0.999121 108717 1137.78 + 38.911 0.999219 108730 1280.00 + 38.975 0.999316 108737 1462.86 + 39.071 0.999414 108752 1706.67 + 39.103 0.999512 108759 2048.00 + 39.199 0.999561 108768 2275.56 + 39.263 0.999609 108772 2560.00 + 39.295 0.999658 108775 2925.71 + 39.359 0.999707 108780 3413.33 + 39.423 0.999756 108785 4096.00 + 39.487 0.999780 108788 4551.11 + 39.519 0.999805 108791 5120.00 + 39.583 0.999829 108795 5851.43 + 39.615 0.999854 108796 6826.67 + 39.711 0.999878 108798 8192.00 + 39.839 0.999890 108801 9102.22 + 39.839 0.999902 108801 10240.00 + 39.903 0.999915 108802 11702.86 + 40.031 0.999927 108805 13653.33 + 40.031 0.999939 108805 16384.00 + 40.095 0.999945 108806 18204.44 + 40.095 0.999951 108806 20480.00 + 40.127 0.999957 108807 23405.71 + 40.287 0.999963 108808 27306.67 + 40.287 0.999969 108808 32768.00 + 40.415 0.999973 108809 36408.89 + 40.415 0.999976 108809 40960.00 + 40.415 0.999979 108809 46811.43 + 40.831 0.999982 108810 54613.33 + 40.831 0.999985 108810 65536.00 + 40.831 0.999986 108810 72817.78 + 40.831 0.999988 108810 81920.00 + 40.831 0.999989 108810 93622.86 + 40.927 0.999991 108811 109226.67 + 40.927 1.000000 108811 inf +#[Mean = 15.813, StdDeviation = 6.086] +#[Max = 40.896, Total count = 108811] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 217921 requests in 20.00s, 25.77MB read +Requests/sec: 10895.18 +Transfer/sec: 1.29MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_13500_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_13500_wrk.txt new file mode 100644 index 000000000..1eace9468 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_13500_wrk.txt @@ -0,0 +1,120 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 813.484ms, rate sampling interval: 2891ms + Thread calibration: mean lat.: 812.954ms, rate sampling interval: 2891ms + Thread calibration: mean lat.: 813.433ms, rate sampling interval: 2891ms + Thread calibration: mean lat.: 813.322ms, rate sampling interval: 2891ms + Thread calibration: mean lat.: 813.415ms, rate sampling interval: 2891ms + Thread calibration: mean lat.: 813.692ms, rate sampling interval: 2891ms + Thread calibration: mean lat.: 813.694ms, rate sampling interval: 2893ms + Thread calibration: mean lat.: 814.013ms, rate sampling interval: 2893ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.28s 403.09ms 2.97s 57.24% + Req/Sec 1.40k 10.04 1.41k 66.67% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 2.30s + 75.000% 2.62s + 90.000% 2.83s + 99.000% 2.94s + 99.900% 2.97s + 99.990% 2.97s + 99.999% 2.97s +100.000% 2.97s + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 1567.743 0.000000 1 1.00 + 1713.151 0.100000 11095 1.11 + 1849.343 0.200000 22211 1.25 + 1980.415 0.300000 33251 1.43 + 2154.495 0.400000 44380 1.67 + 2301.951 0.500000 55432 2.00 + 2369.535 0.550000 61089 2.22 + 2422.783 0.600000 66503 2.50 + 2488.319 0.650000 72118 2.86 + 2549.759 0.700000 77693 3.33 + 2617.343 0.750000 83157 4.00 + 2660.351 0.775000 85986 4.44 + 2691.071 0.800000 88790 5.00 + 2727.935 0.825000 91532 5.71 + 2764.799 0.850000 94393 6.67 + 2795.519 0.875000 97082 8.00 + 2811.903 0.887500 98374 8.89 + 2832.383 0.900000 99837 10.00 + 2848.767 0.912500 101263 11.43 + 2861.055 0.925000 102536 13.33 + 2877.439 0.937500 104010 16.00 + 2883.583 0.943750 104620 17.78 + 2891.775 0.950000 105405 20.00 + 2897.919 0.956250 106103 22.86 + 2906.111 0.962500 106765 26.67 + 2916.351 0.968750 107563 32.00 + 2918.399 0.971875 107739 35.56 + 2922.495 0.975000 108101 40.00 + 2926.591 0.978125 108436 45.71 + 2930.687 0.981250 108760 53.33 + 2934.783 0.984375 109179 64.00 + 2936.831 0.985938 109375 71.11 + 2938.879 0.987500 109567 80.00 + 2940.927 0.989062 109728 91.43 + 2942.975 0.990625 109870 106.67 + 2945.023 0.992188 110007 128.00 + 2947.071 0.992969 110142 142.22 + 2949.119 0.993750 110264 160.00 + 2949.119 0.994531 110264 182.86 + 2951.167 0.995313 110340 213.33 + 2955.263 0.996094 110437 256.00 + 2957.311 0.996484 110486 284.44 + 2959.359 0.996875 110551 320.00 + 2959.359 0.997266 110551 365.71 + 2961.407 0.997656 110632 426.67 + 2961.407 0.998047 110632 512.00 + 2963.455 0.998242 110718 568.89 + 2963.455 0.998437 110718 640.00 + 2963.455 0.998633 110718 731.43 + 2963.455 0.998828 110718 853.33 + 2965.503 0.999023 110786 1024.00 + 2965.503 0.999121 110786 1137.78 + 2965.503 0.999219 110786 1280.00 + 2965.503 0.999316 110786 1462.86 + 2965.503 0.999414 110786 1706.67 + 2965.503 0.999512 110786 2048.00 + 2967.551 0.999561 110825 2275.56 + 2967.551 0.999609 110825 2560.00 + 2967.551 0.999658 110825 2925.71 + 2967.551 0.999707 110825 3413.33 + 2967.551 0.999756 110825 4096.00 + 2967.551 0.999780 110825 4551.11 + 2967.551 0.999805 110825 5120.00 + 2967.551 0.999829 110825 5851.43 + 2967.551 0.999854 110825 6826.67 + 2967.551 0.999878 110825 8192.00 + 2967.551 0.999890 110825 9102.22 + 2969.599 0.999902 110835 10240.00 + 2969.599 0.999915 110835 11702.86 + 2969.599 0.999927 110835 13653.33 + 2969.599 0.999939 110835 16384.00 + 2969.599 0.999945 110835 18204.44 + 2969.599 0.999951 110835 20480.00 + 2969.599 0.999957 110835 23405.71 + 2969.599 0.999963 110835 27306.67 + 2969.599 0.999969 110835 32768.00 + 2969.599 0.999973 110835 36408.89 + 2969.599 0.999976 110835 40960.00 + 2969.599 0.999979 110835 46811.43 + 2969.599 0.999982 110835 54613.33 + 2969.599 0.999985 110835 65536.00 + 2969.599 0.999986 110835 72817.78 + 2969.599 0.999988 110835 81920.00 + 2969.599 0.999989 110835 93622.86 + 2969.599 0.999991 110835 109226.67 + 2971.647 0.999992 110836 131072.00 + 2971.647 1.000000 110836 inf +#[Mean = 2275.614, StdDeviation = 403.090] +#[Max = 2969.600, Total count = 110836] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 221004 requests in 20.00s, 26.13MB read +Requests/sec: 11051.11 +Transfer/sec: 1.31MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_17000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_17000_wrk.txt new file mode 100644 index 000000000..299838473 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_17000_wrk.txt @@ -0,0 +1,107 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 3032.454ms, rate sampling interval: 8667ms + Thread calibration: mean lat.: 3031.918ms, rate sampling interval: 8667ms + Thread calibration: mean lat.: 3032.039ms, rate sampling interval: 8667ms + Thread calibration: mean lat.: 3031.902ms, rate sampling interval: 8667ms + Thread calibration: mean lat.: 3031.324ms, rate sampling interval: 8658ms + Thread calibration: mean lat.: 3031.484ms, rate sampling interval: 8667ms + Thread calibration: mean lat.: 3031.375ms, rate sampling interval: 8667ms + Thread calibration: mean lat.: 3030.904ms, rate sampling interval: 8658ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 6.28s 976.19ms 8.01s 57.66% + Req/Sec 1.40k 0.00 1.40k 100.00% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 6.28s + 75.000% 7.13s + 90.000% 7.63s + 99.000% 7.94s + 99.900% 7.99s + 99.990% 8.01s + 99.999% 8.01s +100.000% 8.01s + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 4571.135 0.000000 7 1.00 + 4939.775 0.100000 11212 1.11 + 5267.455 0.200000 22272 1.25 + 5603.327 0.300000 33375 1.43 + 5943.295 0.400000 44487 1.67 + 6279.167 0.500000 55594 2.00 + 6455.295 0.550000 61258 2.22 + 6623.231 0.600000 66736 2.50 + 6791.167 0.650000 72307 2.86 + 6971.391 0.700000 77860 3.33 + 7131.135 0.750000 83459 4.00 + 7217.151 0.775000 86300 4.44 + 7299.071 0.800000 88999 5.00 + 7385.087 0.825000 91853 5.71 + 7471.103 0.850000 94602 6.67 + 7553.023 0.875000 97326 8.00 + 7593.983 0.887500 98716 8.89 + 7634.943 0.900000 100103 10.00 + 7675.903 0.912500 101474 11.43 + 7720.959 0.925000 102978 13.33 + 7761.919 0.937500 104280 16.00 + 7782.399 0.943750 104960 17.78 + 7802.879 0.950000 105689 20.00 + 7823.359 0.956250 106404 22.86 + 7843.839 0.962500 107129 26.67 + 7864.319 0.968750 107745 32.00 + 7876.607 0.971875 108107 35.56 + 7888.895 0.975000 108462 40.00 + 7901.183 0.978125 108799 45.71 + 7913.471 0.981250 109157 53.33 + 7925.759 0.984375 109559 64.00 + 7929.855 0.985938 109689 71.11 + 7933.951 0.987500 109815 80.00 + 7942.143 0.989062 110079 91.43 + 7946.239 0.990625 110209 106.67 + 7950.335 0.992188 110321 128.00 + 7954.431 0.992969 110442 142.22 + 7958.527 0.993750 110547 160.00 + 7962.623 0.994531 110638 182.86 + 7966.719 0.995313 110737 213.33 + 7970.815 0.996094 110823 256.00 + 7970.815 0.996484 110823 284.44 + 7974.911 0.996875 110894 320.00 + 7974.911 0.997266 110894 365.71 + 7979.007 0.997656 110958 426.67 + 7983.103 0.998047 111011 512.00 + 7983.103 0.998242 111011 568.89 + 7987.199 0.998437 111056 640.00 + 7987.199 0.998633 111056 731.43 + 7991.295 0.998828 111094 853.33 + 7991.295 0.999023 111094 1024.00 + 7991.295 0.999121 111094 1137.78 + 7995.391 0.999219 111132 1280.00 + 7995.391 0.999316 111132 1462.86 + 7995.391 0.999414 111132 1706.67 + 7999.487 0.999512 111157 2048.00 + 7999.487 0.999561 111157 2275.56 + 7999.487 0.999609 111157 2560.00 + 7999.487 0.999658 111157 2925.71 + 7999.487 0.999707 111157 3413.33 + 8003.583 0.999756 111174 4096.00 + 8003.583 0.999780 111174 4551.11 + 8003.583 0.999805 111174 5120.00 + 8003.583 0.999829 111174 5851.43 + 8003.583 0.999854 111174 6826.67 + 8003.583 0.999878 111174 8192.00 + 8007.679 0.999890 111181 9102.22 + 8007.679 0.999902 111181 10240.00 + 8007.679 0.999915 111181 11702.86 + 8007.679 0.999927 111181 13653.33 + 8007.679 0.999939 111181 16384.00 + 8007.679 0.999945 111181 18204.44 + 8011.775 0.999951 111187 20480.00 + 8011.775 1.000000 111187 inf +#[Mean = 6283.197, StdDeviation = 976.193] +#[Max = 8007.680, Total count = 111187] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 203762 requests in 20.00s, 24.10MB read +Requests/sec: 10188.76 +Transfer/sec: 1.20MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_alloc.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_alloc.html new file mode 100644 index 000000000..312d5024b --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_alloc.html @@ -0,0 +1,7234 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_cpu.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_cpu.html new file mode 100644 index 000000000..7a7c6cc61 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_cpu.html @@ -0,0 +1,19434 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_lock.html b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_lock.html new file mode 100644 index 000000000..3b826ce28 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_lock.html @@ -0,0 +1,2099 @@ + + + + + + + +

Flame Graph

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_wrk.txt new file mode 100644 index 000000000..d8a337eaa --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_8500_stable_wrk.txt @@ -0,0 +1,142 @@ +Running 5m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.951ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.606ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.002ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.960ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.576ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.702ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.780ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 2.586ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.60ms 2.06ms 37.41ms 89.32% + Req/Sec 1.12k 210.15 2.11k 68.40% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 2.23ms + 75.000% 3.04ms + 90.000% 4.22ms + 99.000% 10.20ms + 99.900% 23.71ms + 99.990% 34.46ms + 99.999% 35.97ms +100.000% 37.44ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.166 0.000000 1 1.00 + 0.951 0.100000 246771 1.11 + 1.334 0.200000 493404 1.25 + 1.656 0.300000 739611 1.43 + 1.950 0.400000 986314 1.67 + 2.231 0.500000 1232660 2.00 + 2.375 0.550000 1356075 2.22 + 2.523 0.600000 1479012 2.50 + 2.679 0.650000 1602438 2.86 + 2.849 0.700000 1726229 3.33 + 3.041 0.750000 1848382 4.00 + 3.153 0.775000 1910596 4.44 + 3.279 0.800000 1971457 5.00 + 3.429 0.825000 2033782 5.71 + 3.611 0.850000 2095171 6.67 + 3.855 0.875000 2156629 8.00 + 4.017 0.887500 2187304 8.89 + 4.223 0.900000 2217932 10.00 + 4.503 0.912500 2248802 11.43 + 4.891 0.925000 2279610 13.33 + 5.411 0.937500 2310362 16.00 + 5.731 0.943750 2325752 17.78 + 6.091 0.950000 2341236 20.00 + 6.475 0.956250 2356644 22.86 + 6.895 0.962500 2372003 26.67 + 7.351 0.968750 2387304 32.00 + 7.603 0.971875 2395024 35.56 + 7.875 0.975000 2402803 40.00 + 8.171 0.978125 2410411 45.71 + 8.519 0.981250 2418247 53.33 + 8.935 0.984375 2425818 64.00 + 9.207 0.985938 2429770 71.11 + 9.527 0.987500 2433559 80.00 + 9.919 0.989062 2437414 91.43 + 10.423 0.990625 2441242 106.67 + 11.111 0.992188 2445079 128.00 + 11.559 0.992969 2446991 142.22 + 12.087 0.993750 2448913 160.00 + 12.711 0.994531 2450838 182.86 + 13.487 0.995313 2452772 213.33 + 14.367 0.996094 2454681 256.00 + 14.903 0.996484 2455652 284.44 + 15.511 0.996875 2456618 320.00 + 16.207 0.997266 2457577 365.71 + 17.103 0.997656 2458538 426.67 + 18.335 0.998047 2459503 512.00 + 19.215 0.998242 2459982 568.89 + 20.191 0.998437 2460461 640.00 + 21.279 0.998633 2460943 731.43 + 22.463 0.998828 2461423 853.33 + 23.919 0.999023 2461901 1024.00 + 24.927 0.999121 2462142 1137.78 + 25.839 0.999219 2462381 1280.00 + 27.295 0.999316 2462622 1462.86 + 28.879 0.999414 2462863 1706.67 + 30.575 0.999512 2463106 2048.00 + 31.295 0.999561 2463227 2275.56 + 31.839 0.999609 2463348 2560.00 + 32.319 0.999658 2463466 2925.71 + 32.735 0.999707 2463589 3413.33 + 33.183 0.999756 2463710 4096.00 + 33.407 0.999780 2463776 4551.11 + 33.599 0.999805 2463826 5120.00 + 33.823 0.999829 2463887 5851.43 + 34.047 0.999854 2463954 6826.67 + 34.271 0.999878 2464018 8192.00 + 34.335 0.999890 2464039 9102.22 + 34.463 0.999902 2464069 10240.00 + 34.591 0.999915 2464104 11702.86 + 34.719 0.999927 2464132 13653.33 + 34.879 0.999939 2464164 16384.00 + 34.943 0.999945 2464173 18204.44 + 35.071 0.999951 2464193 20480.00 + 35.103 0.999957 2464202 23405.71 + 35.199 0.999963 2464217 27306.67 + 35.295 0.999969 2464232 32768.00 + 35.359 0.999973 2464239 36408.89 + 35.455 0.999976 2464248 40960.00 + 35.551 0.999979 2464255 46811.43 + 35.647 0.999982 2464263 54613.33 + 35.807 0.999985 2464270 65536.00 + 35.871 0.999986 2464274 72817.78 + 35.903 0.999988 2464277 81920.00 + 35.967 0.999989 2464282 93622.86 + 35.999 0.999991 2464285 109226.67 + 36.095 0.999992 2464288 131072.00 + 36.159 0.999993 2464290 145635.56 + 36.191 0.999994 2464292 163840.00 + 36.255 0.999995 2464293 187245.71 + 36.383 0.999995 2464295 218453.33 + 36.447 0.999996 2464299 262144.00 + 36.447 0.999997 2464299 291271.11 + 36.447 0.999997 2464299 327680.00 + 36.511 0.999997 2464300 374491.43 + 36.831 0.999998 2464301 436906.67 + 36.863 0.999998 2464302 524288.00 + 36.863 0.999998 2464302 582542.22 + 36.927 0.999998 2464303 655360.00 + 36.927 0.999999 2464303 748982.86 + 37.151 0.999999 2464304 873813.33 + 37.151 0.999999 2464304 1048576.00 + 37.151 0.999999 2464304 1165084.44 + 37.215 0.999999 2464305 1310720.00 + 37.215 0.999999 2464305 1497965.71 + 37.215 0.999999 2464305 1747626.67 + 37.215 1.000000 2464305 2097152.00 + 37.215 1.000000 2464305 2330168.89 + 37.439 1.000000 2464306 2621440.00 + 37.439 1.000000 2464306 inf +#[Mean = 2.605, StdDeviation = 2.061] +#[Max = 37.408, Total count = 2464306] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 2549715 requests in 5.00m, 301.52MB read +Requests/sec: 8499.00 +Transfer/sec: 1.01MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_9000_stable_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_9000_stable_wrk.txt new file mode 100644 index 000000000..5448ce6bb --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_9000_stable_wrk.txt @@ -0,0 +1,130 @@ +Running 1m test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 1.861ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.884ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.907ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.919ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.919ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.881ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.945ms, rate sampling interval: 10ms + Thread calibration: mean lat.: 1.901ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.54ms 2.83ms 35.52ms 89.83% + Req/Sec 1.19k 182.26 1.78k 69.80% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.69ms + 75.000% 2.59ms + 90.000% 5.43ms + 99.000% 13.41ms + 99.900% 32.10ms + 99.990% 34.11ms + 99.999% 35.10ms +100.000% 35.55ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.172 0.000000 1 1.00 + 0.782 0.100000 44968 1.11 + 1.046 0.200000 89926 1.25 + 1.268 0.300000 134924 1.43 + 1.475 0.400000 179849 1.67 + 1.692 0.500000 224736 2.00 + 1.812 0.550000 247112 2.22 + 1.945 0.600000 269608 2.50 + 2.103 0.650000 292279 2.86 + 2.303 0.700000 314618 3.33 + 2.587 0.750000 336960 4.00 + 2.793 0.775000 348183 4.44 + 3.061 0.800000 359424 5.00 + 3.435 0.825000 370656 5.71 + 3.929 0.850000 381884 6.67 + 4.587 0.875000 393111 8.00 + 4.983 0.887500 398770 8.89 + 5.431 0.900000 404353 10.00 + 5.943 0.912500 409972 11.43 + 6.487 0.925000 415597 13.33 + 7.075 0.937500 421216 16.00 + 7.403 0.943750 423999 17.78 + 7.775 0.950000 426827 20.00 + 8.183 0.956250 429625 22.86 + 8.647 0.962500 432429 26.67 + 9.191 0.968750 435252 32.00 + 9.511 0.971875 436657 35.56 + 9.863 0.975000 438053 40.00 + 10.279 0.978125 439450 45.71 + 10.735 0.981250 440866 53.33 + 11.391 0.984375 442258 64.00 + 11.879 0.985938 442956 71.11 + 12.415 0.987500 443657 80.00 + 13.023 0.989062 444357 91.43 + 13.719 0.990625 445065 106.67 + 14.607 0.992188 445761 128.00 + 15.207 0.992969 446111 142.22 + 16.039 0.993750 446465 160.00 + 17.087 0.994531 446813 182.86 + 18.559 0.995313 447163 213.33 + 20.927 0.996094 447514 256.00 + 22.223 0.996484 447692 284.44 + 23.007 0.996875 447865 320.00 + 24.479 0.997266 448041 365.71 + 25.967 0.997656 448216 426.67 + 28.047 0.998047 448391 512.00 + 28.735 0.998242 448483 568.89 + 29.311 0.998437 448567 640.00 + 30.079 0.998633 448654 731.43 + 31.471 0.998828 448742 853.33 + 32.143 0.999023 448831 1024.00 + 32.367 0.999121 448878 1137.78 + 32.575 0.999219 448921 1280.00 + 32.735 0.999316 448966 1462.86 + 32.895 0.999414 449007 1706.67 + 33.087 0.999512 449060 2048.00 + 33.151 0.999561 449073 2275.56 + 33.247 0.999609 449099 2560.00 + 33.343 0.999658 449122 2925.71 + 33.439 0.999707 449141 3413.33 + 33.567 0.999756 449160 4096.00 + 33.663 0.999780 449172 4551.11 + 33.759 0.999805 449184 5120.00 + 33.823 0.999829 449192 5851.43 + 34.015 0.999854 449208 6826.67 + 34.079 0.999878 449222 8192.00 + 34.079 0.999890 449222 9102.22 + 34.143 0.999902 449225 10240.00 + 34.175 0.999915 449230 11702.86 + 34.303 0.999927 449237 13653.33 + 34.367 0.999939 449241 16384.00 + 34.463 0.999945 449244 18204.44 + 34.527 0.999951 449249 20480.00 + 34.527 0.999957 449249 23405.71 + 34.559 0.999963 449252 27306.67 + 34.655 0.999969 449256 32768.00 + 34.655 0.999973 449256 36408.89 + 34.719 0.999976 449258 40960.00 + 34.751 0.999979 449259 46811.43 + 34.783 0.999982 449261 54613.33 + 34.815 0.999985 449262 65536.00 + 34.815 0.999986 449262 72817.78 + 35.039 0.999988 449263 81920.00 + 35.103 0.999989 449264 93622.86 + 35.103 0.999991 449264 109226.67 + 35.167 0.999992 449266 131072.00 + 35.167 0.999993 449266 145635.56 + 35.167 0.999994 449266 163840.00 + 35.167 0.999995 449266 187245.71 + 35.167 0.999995 449266 218453.33 + 35.263 0.999996 449267 262144.00 + 35.263 0.999997 449267 291271.11 + 35.263 0.999997 449267 327680.00 + 35.263 0.999997 449267 374491.43 + 35.263 0.999998 449267 436906.67 + 35.551 0.999998 449268 524288.00 + 35.551 1.000000 449268 inf +#[Mean = 2.537, StdDeviation = 2.827] +#[Max = 35.520, Total count = 449268] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 539708 requests in 1.00m, 63.82MB read +Requests/sec: 8995.05 +Transfer/sec: 1.06MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_9000_wrk.txt b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_9000_wrk.txt new file mode 100644 index 000000000..c2906504e --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/html/stage5/sync_put_9000_wrk.txt @@ -0,0 +1,118 @@ +Running 20s test @ http://localhost:8080 + 8 threads and 128 connections + Thread calibration: mean lat.: 35.976ms, rate sampling interval: 350ms + Thread calibration: mean lat.: 36.022ms, rate sampling interval: 351ms + Thread calibration: mean lat.: 35.967ms, rate sampling interval: 351ms + Thread calibration: mean lat.: 36.011ms, rate sampling interval: 351ms + Thread calibration: mean lat.: 35.979ms, rate sampling interval: 352ms + Thread calibration: mean lat.: 36.072ms, rate sampling interval: 352ms + Thread calibration: mean lat.: 36.017ms, rate sampling interval: 351ms + Thread calibration: mean lat.: 36.066ms, rate sampling interval: 351ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.71ms 1.23ms 15.95ms 90.55% + Req/Sec 1.13k 4.71 1.14k 85.27% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.49ms + 75.000% 2.00ms + 90.000% 2.62ms + 99.000% 6.87ms + 99.900% 13.75ms + 99.990% 15.32ms + 99.999% 15.95ms +100.000% 15.96ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.162 0.000000 1 1.00 + 0.719 0.100000 8964 1.11 + 0.958 0.200000 17879 1.25 + 1.151 0.300000 26814 1.43 + 1.325 0.400000 35735 1.67 + 1.492 0.500000 44662 2.00 + 1.579 0.550000 49139 2.22 + 1.672 0.600000 53604 2.50 + 1.768 0.650000 58046 2.86 + 1.875 0.700000 62498 3.33 + 1.995 0.750000 66970 4.00 + 2.065 0.775000 69205 4.44 + 2.145 0.800000 71445 5.00 + 2.233 0.825000 73690 5.71 + 2.337 0.850000 75915 6.67 + 2.463 0.875000 78140 8.00 + 2.533 0.887500 79239 8.89 + 2.619 0.900000 80373 10.00 + 2.723 0.912500 81466 11.43 + 2.847 0.925000 82587 13.33 + 3.009 0.937500 83699 16.00 + 3.121 0.943750 84259 17.78 + 3.247 0.950000 84814 20.00 + 3.427 0.956250 85370 22.86 + 3.697 0.962500 85928 26.67 + 4.219 0.968750 86486 32.00 + 4.619 0.971875 86769 35.56 + 4.987 0.975000 87046 40.00 + 5.375 0.978125 87327 45.71 + 5.699 0.981250 87602 53.33 + 6.059 0.984375 87881 64.00 + 6.259 0.985938 88022 71.11 + 6.459 0.987500 88164 80.00 + 6.683 0.989062 88300 91.43 + 6.987 0.990625 88439 106.67 + 7.383 0.992188 88578 128.00 + 7.647 0.992969 88648 142.22 + 8.023 0.993750 88718 160.00 + 8.575 0.994531 88787 182.86 + 9.575 0.995313 88858 213.33 + 10.327 0.996094 88927 256.00 + 10.719 0.996484 88962 284.44 + 11.207 0.996875 88997 320.00 + 11.815 0.997266 89032 365.71 + 12.423 0.997656 89066 426.67 + 12.783 0.998047 89101 512.00 + 12.919 0.998242 89120 568.89 + 13.063 0.998437 89137 640.00 + 13.263 0.998633 89153 731.43 + 13.559 0.998828 89172 853.33 + 13.751 0.999023 89188 1024.00 + 13.815 0.999121 89197 1137.78 + 13.879 0.999219 89206 1280.00 + 13.983 0.999316 89214 1462.86 + 14.319 0.999414 89223 1706.67 + 14.423 0.999512 89232 2048.00 + 14.647 0.999561 89236 2275.56 + 14.687 0.999609 89241 2560.00 + 14.887 0.999658 89245 2925.71 + 14.983 0.999707 89249 3413.33 + 15.111 0.999756 89254 4096.00 + 15.167 0.999780 89257 4551.11 + 15.175 0.999805 89259 5120.00 + 15.183 0.999829 89260 5851.43 + 15.279 0.999854 89262 6826.67 + 15.303 0.999878 89265 8192.00 + 15.319 0.999890 89266 9102.22 + 15.439 0.999902 89267 10240.00 + 15.487 0.999915 89268 11702.86 + 15.631 0.999927 89269 13653.33 + 15.639 0.999939 89270 16384.00 + 15.647 0.999945 89271 18204.44 + 15.647 0.999951 89271 20480.00 + 15.799 0.999957 89272 23405.71 + 15.799 0.999963 89272 27306.67 + 15.815 0.999969 89273 32768.00 + 15.815 0.999973 89273 36408.89 + 15.815 0.999976 89273 40960.00 + 15.951 0.999979 89274 46811.43 + 15.951 0.999982 89274 54613.33 + 15.951 0.999985 89274 65536.00 + 15.951 0.999986 89274 72817.78 + 15.951 0.999988 89274 81920.00 + 15.959 0.999989 89275 93622.86 + 15.959 1.000000 89275 inf +#[Mean = 1.706, StdDeviation = 1.235] +#[Max = 15.952, Total count = 89275] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 179713 requests in 20.00s, 21.25MB read +Requests/sec: 8985.23 +Transfer/sec: 1.06MB diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/scripts/lua/get_request.lua b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/scripts/lua/get_request.lua index 3a2df0863..dc7a7cfac 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/scripts/lua/get_request.lua +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/scripts/lua/get_request.lua @@ -10,7 +10,7 @@ function init(args) end function request() - key = math.random(17500000) + key = math.random(1750000) return wrk.format("GET", "/v0/entity?id=k" .. key) end diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/scripts/sh/base.sh b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/scripts/sh/base.sh index cab182fa3..9481db03f 100755 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/scripts/sh/base.sh +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/scripts/sh/base.sh @@ -1,7 +1,7 @@ #!/bin/bash NAME=$(date +"%s") JFR="../../info-$NAME.jfr" -PREFIX="../../html/stage4" +PREFIX="../../html/stage5" (wrk2 -c 128 -t 8 -L -d $1 -R $2 -s "../lua/$3.lua" http://localhost:8080 > "${PREFIX}/${NAME}_wrk.txt") & ./ap/bin/asprof -t -e cpu,alloc,lock -d $1 -f $JFR MainServer diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/reports/stage5.md b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/stage5.md new file mode 100644 index 000000000..a08b4b5cd --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/reports/stage5.md @@ -0,0 +1,156 @@ +## Гипотезы + +В данной части задания мы осуществили переход с `one.nio.HttpClient` на предоставляемый в стандартном пакете `HttpClient` в силу того, +что второй поддерживает асинхронное взаимодействие. + +В связи с чем сначала сравним `one.nio` реализацию со стандартной, +а затем стандартную синхронную со стандартной асинхронной и сделаем выводы. + +Ожидается просадка производительности в первом случае и какое-то повышение во втором. + +## Факты + +Размер кластера в дальнейшем будет = 3 + +По-прежнему используется `consistent hashing` и соответсвенно выбираются следующие ноды по кругу + +**GET** запросы идут на базу заполненую на ~700MB, т.е. 45 таблиц по 15MB. + +## Прошлый этап + +**PUT** 17000rps: [5](html/stage5/old_put_cpu.html) [5](html/stage5/old_put_wrk.txt) + +**GET** 14000rps: [5](html/stage5/old_get_cpu.html) [5](html/stage5/old_get_wrk.txt) + +## Новый этап + +### `HttpCleint` с синхронным взаимодействием + +*(хеш коммита: `df67db85dbc02878a2bf29d97662744f52a6cc61`)* + +#### PUT + +Перебираем rps: +* [9000](html%2Fstage5%2Fsync_put_9000_wrk.txt) +* [10000](html%2Fstage5%2Fsync_put_10000_wrk.txt) +* [11000](html%2Fstage5%2Fsync_put_11000_wrk.txt) +* [13500](html%2Fstage5%2Fsync_put_13500_wrk.txt) +* [17000](html%2Fstage5%2Fsync_put_17000_wrk.txt) + +На [9000](html%2Fstage5%2Fsync_put_9000_stable_wrk.txt) +и [10000](html%2Fstage5%2Fsync_put_10000_stable_wrk.txt) +начинает значительно проседать производительность при долгой нагрузке + +Поэтому остановился на 8500rps + +8500rps 5min: [alloc](html%2Fstage5%2Fsync_put_8500_stable_alloc.html) +[cpu](html%2Fstage5%2Fsync_put_8500_stable_cpu.html) +[lock](html%2Fstage5%2Fsync_put_8500_stable_lock.html) +[rps](html%2Fstage5%2Fsync_put_8500_stable_wrk.txt) + +#### GET + +Перебираем rps: +* [7000](html%2Fstage5%2Fsync_get_7000_wrk.txt) +* [8000](html%2Fstage5%2Fsync_get_8000_wrk.txt) +* [9000](html%2Fstage5%2Fsync_get_9000_wrk.txt) +* [10000](html%2Fstage5%2Fsync_get_10000_wrk.txt) +* [12000](html%2Fstage5%2Fsync_get_12000_wrk.txt) +* [14000](html%2Fstage5%2Fsync_get_14000_wrk.txt) + +[9000](html%2Fstage5%2Fsync_get_9000_stable_wrk.txt) rps не держатся стабильно, +поэтому остановился на 8000 + +8000rps 5min: [alloc](html%2Fstage5%2Fsync_get_8000_stable_alloc.html) + [cpu](html%2Fstage5%2Fsync_get_8000_stable_cpu.html) + [lock](html%2Fstage5%2Fsync_get_8000_stable_lock.html) + [rps](html%2Fstage5%2Fsync_get_8000_stable_wrk.txt) + +#### Сравнение с `one.nio` + +Как мы видим стандартный клиент значительно медленее библиотечного + +Также это видно и по `cpu` относительно процентного соотношения работы DAO и непосредственно работы с сетью + +В силу падения RPS локи по добалению в очередь отошли на второй план. + +И основное время простое происходит при использовании общих ресурсов, заявлемых в стандартном `HttpClient'е` + +В плане алокаций можно говорить о паритете двух сравнимаемых реализаций + +### `HttpCleint` с асинхронным взаимодействием + +При реализации поменялась немного структура кода, +а именно,в асинхронном случае запросы на валидность проверяются сразу. + +Профили бывает полезно смотреть не только для анализа узкий мест, +но и обнаружить нежелательное поведение. + +Так, начав [профилировать](html%2Fstage5%2Fasync_bug_put_8500_cpu.html), +я обнаружил, что часть задач для `future` выполняется в `ForkJoinPool`. + +Хотя мы пытались этого избежать, создав контролируемые нами пулы, как для `HttpExecutor'а`, +так и для первичной обработки запросов. + +Однако, отдельный пул на производительность сильно не повлиял: +[8500](html%2Fstage5%2Fasync_bug_put_8500_wrk.txt) +[10000](html%2Fstage5%2Fasync_bug_put_10000_wrk.txt) +[14000](html%2Fstage5%2Fasync_bug_put_14000_wrk.txt) +[16000](html%2Fstage5%2Fasync_bug_put_16000_wrk.txt) +[18000](html%2Fstage5%2Fasync_bug_put_18000_wrk.txt) +#### PUT + +Перебираем rps: +* [8500](html%2Fstage5%2Fasync_put_8500_wrk.txt) +* [12000](html%2Fstage5%2Fasync_put_12000_wrk.txt) +* [13000](html%2Fstage5%2Fasync_put_13000_wrk.txt) +* [14000](html%2Fstage5%2Fasync_put_14000_wrk.txt) +* [15000](html%2Fstage5%2Fasync_put_15000_wrk.txt) +* [16000](html%2Fstage5%2Fasync_put_16000_wrk.txt) +* [18000](html%2Fstage5%2Fasync_put_18000_wrk.txt) + +Просадка при [14000](html%2Fstage5%2Fasync_put_14000_stable_wrk.txt)rps, +поэтому остановился на 12000 + +12000rps 5min: +[alloc](html%2Fstage5%2Fasync_put_12000_stable_alloc.html) +[cpu](html%2Fstage5%2Fasync_put_12000_stable_cpu.html) +[lock](html%2Fstage5%2Fasync_put_12000_stable_lock.html) +[rps](html%2Fstage5%2Fasync_put_12000_stable_wrk.txt) + +#### GET + +Перебираем rps: +* [8500](html%2Fstage5%2Fasync_get_8500_wrk.txt) +* [11000](html%2Fstage5%2Fasync_get_11000_wrk.txt) +* [12000](html%2Fstage5%2Fasync_get_12000_wrk.txt) +* [13000](html%2Fstage5%2Fasync_get_13000_wrk.txt) +* [14000](html%2Fstage5%2Fasync_get_14000_wrk.txt) +* [15000](html%2Fstage5%2Fasync_get_15000_wrk.txt) +* [18000](html%2Fstage5%2Fasync_get_18000_wrk.txt) + +Остановился на 11000rps + +11000rps 5min: +[alloc](html%2Fstage5%2Fasync_get_11000_stable_alloc.html) +[cpu](html%2Fstage5%2Fasync_get_11000_stable_cpu.html) +[lock](html%2Fstage5%2Fasync_get_11000_stable_lock.html) +[rps](html%2Fstage5%2Fasync_get_11000_stable_wrk.txt) + +#### Сравнение с синхронной версией + +Как мы видим асинхронная реализация действительно повысила производительность + +Локи распределеись в соответствии с непосредственным выполнением запросов и возврата их в общий пул. +А наш код от них избавлен в части формирования ответа на запрос + +Как мы видим непосредственное взаимодействие с DAO - это лишь малая часть задачи, т.к. сеть значительно дороже, дольше. +А учитывая репликацию, то количество работы с сетью значительно превышает обычную задачу. + +Это в целом и наблюдается из графов. Аллокации демонстрируют тоже + +## Вывод + +Как мы видим, несмотря даже на асинхронное взаимодействие, +сеть остается бутылочным горлышком. Так, к примеру, на графах мы видим, что `GET` запросы значительно дольше +и сильнее загружают `CPU`, однако просадка `RPS` уже не так значительна как раньше diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/FullServiceInfo.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/FullServiceInfo.java index b2191720d..156bcd0a8 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/FullServiceInfo.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/FullServiceInfo.java @@ -5,6 +5,7 @@ import ru.vk.itmo.test.kovalevigor.server.util.Partition; import java.io.IOException; +import java.net.http.HttpClient; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -15,6 +16,7 @@ public class FullServiceInfo implements ServiceInfo, AutoCloseable { private final List clusterPartitions; public FullServiceInfo( + HttpClient httpClient, List clusterUrls, String clusterUrl ) { @@ -28,7 +30,7 @@ public FullServiceInfo( String url = clusterUrls.get(i); clusterPartitions.add( new Partition( - url.equals(clusterUrl) ? null : new ServerRemoteStrategy(url), + url.equals(clusterUrl) ? null : new ServerRemoteStrategy(httpClient, url), offset, nextOffset ) diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/ServiceFactoryImpl.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/ServiceFactoryImpl.java index 1fc21b66a..1bc2c36f4 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/ServiceFactoryImpl.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/ServiceFactoryImpl.java @@ -4,7 +4,7 @@ import ru.vk.itmo.ServiceConfig; import ru.vk.itmo.test.ServiceFactory; -@ServiceFactory(stage = 4) +@ServiceFactory(stage = 5) public class ServiceFactoryImpl implements ServiceFactory.Factory { @Override diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/ServiceImpl.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/ServiceImpl.java index 25e5057c9..f3cc7fabe 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/ServiceImpl.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/ServiceImpl.java @@ -11,16 +11,25 @@ import ru.vk.itmo.test.kovalevigor.server.strategy.decorators.ServerReplicationStrategyDecorator; import ru.vk.itmo.test.kovalevigor.server.strategy.decorators.ServerRequestValidationStrategyDecorator; import ru.vk.itmo.test.kovalevigor.server.strategy.decorators.ServerSendResponseStrategyDecorator; +import ru.vk.itmo.test.kovalevigor.server.util.ServerUtil; import java.io.IOException; +import java.net.http.HttpClient; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.REMOTE_TIMEOUT; public class ServiceImpl implements Service { public static final long FLUSH_THRESHOLD_BYTES = 128 * 1024 * 1024 / 3 * 8; + public static final int HTTP_EXECUTOR_SIZE = 4; private ServerFull server; private FullServiceInfo fullServiceInfo; public final DaoServerConfig config; + private HttpClient httpClient; + private ExecutorService httpExecutor; public ServiceImpl(ServiceConfig config, long flushThresholdBytes) { this.config = mapConfig(config); @@ -33,15 +42,22 @@ public ServiceImpl(ServiceConfig config) { @Override public CompletableFuture start() throws IOException { + httpExecutor = Executors.newFixedThreadPool(HTTP_EXECUTOR_SIZE); + httpClient = HttpClient.newBuilder() + .executor(httpExecutor) + .connectTimeout(REMOTE_TIMEOUT) + .version(java.net.http.HttpClient.Version.HTTP_1_1) + .build(); fullServiceInfo = new FullServiceInfo( + httpClient, config.clusterUrls, config.selfUrl ); server = new ServerBasedOnStrategy( config, new ServerOneExecutorStrategyDecorator( - new ServerRequestValidationStrategyDecorator( - new ServerSendResponseStrategyDecorator( + new ServerSendResponseStrategyDecorator( + new ServerRequestValidationStrategyDecorator( new ServerReplicationStrategyDecorator( new ServerDaoStrategy(config), fullServiceInfo @@ -58,6 +74,8 @@ public CompletableFuture start() throws IOException { @Override public CompletableFuture stop() throws IOException { if (server != null) { + ServerUtil.shutdownAndAwaitTermination(httpExecutor); + httpClient.close(); server.stop(); server.close(); fullServiceInfo.close(); diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerBasedOnStrategy.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerBasedOnStrategy.java index 74ecd2fa9..93fdafb29 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerBasedOnStrategy.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerBasedOnStrategy.java @@ -10,7 +10,7 @@ public class ServerBasedOnStrategy extends HttpServer implements ServerFull { - private final ServerStrategy serverStrategy; + protected final ServerStrategy serverStrategy; private boolean stopped; public ServerBasedOnStrategy(HttpServerConfig config, ServerStrategy serverStrategy) throws IOException { diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerRejectStrategy.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerRejectStrategy.java index 5f82fa346..58e389a18 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerRejectStrategy.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerRejectStrategy.java @@ -12,7 +12,7 @@ public class ServerRejectStrategy implements ServerStrategy { @Override public Response handleRequest(Request request, HttpSession session) throws IOException { - handleDefault(request, session); + rejectRequest(request, session); return null; } @@ -26,6 +26,11 @@ public void rejectRequest(Request request, HttpSession session) { sendResponseWithoutIo(session, Responses.SERVICE_UNAVAILABLE); } + @Override + public void handleIOException(Request request, HttpSession session, IOException exception) { + // do nothing + } + @Override public void close() throws IOException { // nothing to close diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerRemoteStrategy.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerRemoteStrategy.java index becbe7786..a61954bb0 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerRemoteStrategy.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerRemoteStrategy.java @@ -1,42 +1,78 @@ package ru.vk.itmo.test.kovalevigor.server.strategy; -import one.nio.http.HttpClient; -import one.nio.http.HttpException; import one.nio.http.HttpSession; import one.nio.http.Request; import one.nio.http.Response; -import one.nio.net.ConnectionString; -import one.nio.pool.PoolException; +import ru.vk.itmo.test.kovalevigor.server.util.Headers; import java.io.IOException; -import java.net.ConnectException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; +import java.util.logging.Level; import static ru.vk.itmo.test.kovalevigor.server.strategy.ServerDaoStrategy.log; +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.REMOTE_TIMEOUT; +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.REMOTE_TIMEOUT_TIMEUNIT; +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.REMOTE_TIMEOUT_VALUE; public class ServerRemoteStrategy extends ServerRejectStrategy { - public static final int REMOTE_TIMEOUT = 1000; + private final HttpClient httpClient; + private final String remoteUrl; - private final HttpClient remoteClient; - - public ServerRemoteStrategy(String remoteUrl) { - this.remoteClient = new HttpClient(new ConnectionString(remoteUrl)); + public ServerRemoteStrategy(HttpClient httpClient, String remoteUrl) { + this.httpClient = httpClient; + this.remoteUrl = remoteUrl; } @Override - public Response handleRequest(Request request, HttpSession session) throws IOException { + public Response handleRequest(Request request, HttpSession session) { try { - Response response = remoteClient.invoke(request, REMOTE_TIMEOUT); - return new Response(response); - } catch (HttpException | PoolException | ConnectException e) { - log.severe("Exception while redirection"); + return mapResponse(httpClient.send(mapRequest(request), HttpResponse.BodyHandlers.ofByteArray())); } catch (InterruptedException e) { Thread.currentThread().interrupt(); + } catch (IOException e) { + log.log(Level.SEVERE, "Exception while redirection", e); } return null; } @Override - public void close() throws IOException { - remoteClient.close(); + public CompletableFuture handleRequestAsync(Request request, HttpSession session, Executor executor) { + return httpClient.sendAsync(mapRequest(request), HttpResponse.BodyHandlers.ofByteArray()) + .orTimeout(REMOTE_TIMEOUT_VALUE, REMOTE_TIMEOUT_TIMEUNIT) + .thenApplyAsync(ServerRemoteStrategy::mapResponse, executor); + } + + private HttpRequest mapRequest(Request request) { + HttpRequest.Builder httpRequestBuilder = HttpRequest.newBuilder(URI.create(remoteUrl + request.getURI())) + .method( + request.getMethodName(), + request.getBody() == null + ? HttpRequest.BodyPublishers.noBody() + : HttpRequest.BodyPublishers.ofByteArray(request.getBody()) + ) + .timeout(REMOTE_TIMEOUT); + for (Headers header : Headers.values()) { + String headerValue = Headers.getHeader(request, header); + if (headerValue != null) { + httpRequestBuilder.header(header.getName(), headerValue); + } + } + return httpRequestBuilder.build(); + } + + private static Response mapResponse(HttpResponse httpResponse) { + Response response = new Response( + Integer.toString(httpResponse.statusCode()), + httpResponse.body() + ); + for (Headers header : Headers.values()) { + Headers.addHeader(response, header, httpResponse.headers().firstValue(header.getName())); + } + return response; } } diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerStrategy.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerStrategy.java index d5e85ee3b..07147fe61 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerStrategy.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerStrategy.java @@ -5,15 +5,49 @@ import one.nio.http.Response; import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; public interface ServerStrategy extends AutoCloseable { Response handleRequest(Request request, HttpSession session) throws IOException; + default CompletableFuture handleRequestAsync(Request request, HttpSession session) { + return handleRequestAsync(request, session, null); + } + + default CompletableFuture handleRequestAsync( + Request request, + HttpSession session, + Executor executor + ) { + return CompletableFuture.supplyAsync(() -> { + try { + return handleRequest(request, session); + } catch (IOException e) { + handleIOException(request, session, e); + } + return null; + }, executor); + } + void handleDefault(Request request, HttpSession session) throws IOException; + default CompletableFuture handleDefaultAsync(Request request, HttpSession session, Executor executor) { + return CompletableFuture.supplyAsync(() -> { + try { + handleDefault(request, session); + } catch (IOException e) { + handleIOException(request, session, e); + } + return null; + }, executor); + } + void rejectRequest(Request request, HttpSession session); + void handleIOException(Request request, HttpSession session, IOException exception); + @Override void close() throws IOException; diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/AckEitherCompletableFuture.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/AckEitherCompletableFuture.java new file mode 100644 index 000000000..96c781060 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/AckEitherCompletableFuture.java @@ -0,0 +1,52 @@ +package ru.vk.itmo.test.kovalevigor.server.strategy.decorators; + +import one.nio.http.Response; +import ru.vk.itmo.test.kovalevigor.server.util.Responses; + +import java.io.IOException; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; + +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.GOOD_STATUSES; +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.logIO; +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.mergeResponses; + +public class AckEitherCompletableFuture extends CompletableFuture { + private final AtomicReference replicasResponse; + private final AtomicInteger responseCount; + private final AtomicInteger totalCount; + private final int ack; + + public AckEitherCompletableFuture(int ack, int from) { + this.ack = ack; + replicasResponse = new AtomicReference<>(); + responseCount = new AtomicInteger(); + totalCount = new AtomicInteger(from); + } + + public void markCompletedFuture(Response response, Throwable exception) { + totalCount.decrementAndGet(); + if (response != null && GOOD_STATUSES.contains(response.getStatus())) { + responseCount.incrementAndGet(); + Response oldResponse; + Response merged; + do { + oldResponse = replicasResponse.get(); + merged = mergeResponses(oldResponse, response); + } while (!replicasResponse.compareAndSet(oldResponse, merged)); + + if (responseCount.get() >= ack) { + complete(Objects.requireNonNullElseGet(merged, Responses.NOT_FOUND::toResponse)); + return; + } + } else if (response == null && exception instanceof IOException ioException) { + logIO(ioException); + } + + if (totalCount.get() == 0) { + complete(null); + } + } +} diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerOneExecutorStrategyDecorator.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerOneExecutorStrategyDecorator.java index 5a2cd74f9..ee75b54d9 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerOneExecutorStrategyDecorator.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerOneExecutorStrategyDecorator.java @@ -9,6 +9,7 @@ import java.io.IOException; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -44,12 +45,18 @@ public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { rejectRequest(serverTask.request, serverTask.session); } + @SuppressWarnings("FutureReturnValueIgnored") @Override public Response handleRequest(Request request, HttpSession session) { - executorService.execute(new ServerTask(request, session, super::handleRequest)); + handleRequestAsync(request, session); return null; } + @Override + public CompletableFuture handleRequestAsync(Request request, HttpSession session) { + return super.handleRequestAsync(request, session, executorService); + } + @Override public void close() throws IOException { shutdownAndAwaitTermination(executorService); diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerReplicationStrategyDecorator.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerReplicationStrategyDecorator.java index cdf25d900..1b70a2268 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerReplicationStrategyDecorator.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerReplicationStrategyDecorator.java @@ -11,9 +11,13 @@ import java.io.IOException; import java.util.Collection; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.GOOD_STATUSES; -import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.compareTimestamps; +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.REMOTE_TIMEOUT_VALUE; +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.mergeResponses; public class ServerReplicationStrategyDecorator extends ServerStrategyDecorator { @@ -56,6 +60,40 @@ public Response handleRequest(Request request, HttpSession session) throws IOExc return checkReplicaResponse(responseCount, ack, replicasResponse); } + @SuppressWarnings("FutureReturnValueIgnored") + @Override + public CompletableFuture handleRequestAsync( + Request request, + HttpSession session, + Executor executor + ) { + if (Headers.hasHeader(request, Headers.REPLICATION)) { + return super.handleRequestAsync(request, session, executor); + } + int ack = Parameters.getParameter(request, Parameters.ACK, Integer::parseInt, serviceInfo.getQuorum()); + int from = Parameters.getParameter(request, Parameters.FROM, Integer::parseInt, serviceInfo.getClusterSize()); + if (ack > from || ack == 0) { + return CompletableFuture.completedFuture(Responses.BAD_REQUEST.toResponse()); + } + + Collection strategies = serviceInfo.getPartitionStrategy( + this, + Parameters.getParameter(request, Parameters.ID), + from + ); + + Headers.addHeader(request, Headers.REPLICATION, ""); + AckEitherCompletableFuture result = new AckEitherCompletableFuture(ack, from); + for (ServerStrategy strategy : strategies) { + CompletableFuture future = + strategy == this + ? super.handleRequestAsync(request, session, executor) + : strategy.handleRequestAsync(request, session, executor); + future.whenCompleteAsync(result::markCompletedFuture, executor); + } + return result.orTimeout(REMOTE_TIMEOUT_VALUE, TimeUnit.SECONDS); + } + private static Response checkReplicaResponse(int responseCount, int ack, Response replicasResponse) { Response response; if (responseCount >= ack) { @@ -69,22 +107,4 @@ private static Response checkReplicaResponse(int responseCount, int ack, Respons } return response; } - - private Response mergeResponses(Response lhs, Response rhs) { - if (lhs == null) { - return rhs; - } else if (rhs == null) { - return lhs; - } - - int compare = compareTimestamps(getTimestamp(lhs), getTimestamp(rhs)); - if (compare == 0) { - return rhs; - } - return compare > 0 ? lhs : rhs; - } - - private static String getTimestamp(Response response) { - return Headers.getHeader(response, Headers.TIMESTAMP); - } } diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerRequestValidationStrategyDecorator.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerRequestValidationStrategyDecorator.java index b43f44b2f..15a553d04 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerRequestValidationStrategyDecorator.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerRequestValidationStrategyDecorator.java @@ -12,6 +12,8 @@ import java.util.EnumSet; import java.util.Map; import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; public class ServerRequestValidationStrategyDecorator extends ServerStrategyDecorator { @@ -29,19 +31,36 @@ public ServerRequestValidationStrategyDecorator(ServerStrategy httpServer) { @Override public Response handleRequest(Request request, HttpSession session) throws IOException { + Response response = checkErrors(request); + return response == null + ? super.handleRequest(request, session) + : response; + } + + @Override + public CompletableFuture handleRequestAsync( + Request request, + HttpSession session, + Executor executor + ) { + Response response = checkErrors(request); + return response == null + ? super.handleRequestAsync(request, session, executor) + : CompletableFuture.completedFuture(response); + } + + private static Response checkErrors(Request request) { Paths path = Paths.getPath(request.getPath()); if (path != null) { if (checkMethods(request, path)) { if (checkParameters(request, path)) { - return super.handleRequest(request, session); + return null; } } else { - session.sendResponse(Responses.NOT_ALLOWED.toResponse()); - return null; + return Responses.NOT_ALLOWED.toResponse(); } } - handleDefault(request, session); - return null; + return Responses.BAD_REQUEST.toResponse(); } private static boolean checkMethods(Request request, Paths path) { diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerSendResponseStrategyDecorator.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerSendResponseStrategyDecorator.java index 62cea9bb9..564c2a1c0 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerSendResponseStrategyDecorator.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerSendResponseStrategyDecorator.java @@ -6,6 +6,15 @@ import ru.vk.itmo.test.kovalevigor.server.strategy.ServerStrategy; import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; +import java.util.concurrent.TimeoutException; +import java.util.logging.Level; + +import static ru.vk.itmo.test.kovalevigor.server.strategy.ServerDaoStrategy.log; +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.closeSession; +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.sendErrorWithoutIo; +import static ru.vk.itmo.test.kovalevigor.server.util.ServerUtil.sendResponseWithoutIo; public class ServerSendResponseStrategyDecorator extends ServerStrategyDecorator { @@ -14,15 +23,44 @@ public ServerSendResponseStrategyDecorator(ServerStrategy httpServer) { } @Override - public Response handleRequest(Request request, HttpSession session) throws IOException { - Response response = super.handleRequest(request, session); + public Response handleRequest(Request request, HttpSession session) { + try { + sendResponse(super.handleRequest(request, session), session); + } catch (IOException e) { + log.log(Level.SEVERE, "IO while executing", e); + closeSession(session, e); + } + return null; + } + + @Override + public CompletableFuture handleRequestAsync( + Request request, + HttpSession session, + Executor executor + ) { + return super.handleRequestAsync(request, session, executor) + .whenCompleteAsync((response, exception) -> { + if (response == null && exception != null) { + if (exception instanceof TimeoutException) { + sendErrorWithoutIo(session, Response.GATEWAY_TIMEOUT, ""); + } else { + log.log(Level.SEVERE, "IO exception", exception); + sendErrorWithoutIo(session, Response.INTERNAL_ERROR, ""); + } + } else { + sendResponse(response, session); + } + }, executor); + } + + public void sendResponse(Response response, HttpSession session) { if (response == null && Thread.currentThread().isInterrupted()) { - session.sendError(Response.INTERNAL_ERROR, ""); + sendErrorWithoutIo(session, Response.INTERNAL_ERROR, ""); } else if (response == null) { - session.sendError(Response.GATEWAY_TIMEOUT, ""); + sendErrorWithoutIo(session, Response.GATEWAY_TIMEOUT, ""); } else { - session.sendResponse(response); + sendResponseWithoutIo(session, response); } - return null; } } diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerStrategyDecorator.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerStrategyDecorator.java index 080ebdd17..fc70d7a99 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerStrategyDecorator.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerStrategyDecorator.java @@ -6,6 +6,8 @@ import ru.vk.itmo.test.kovalevigor.server.strategy.ServerStrategy; import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; public class ServerStrategyDecorator implements ServerStrategy { @@ -25,11 +27,26 @@ public void handleDefault(Request request, HttpSession session) throws IOExcepti serverStrategy.handleDefault(request, session); } + @Override + public CompletableFuture handleRequestAsync(Request request, HttpSession session) { + return serverStrategy.handleRequestAsync(request, session); + } + + @Override + public CompletableFuture handleRequestAsync(Request request, HttpSession session, Executor executor) { + return serverStrategy.handleRequestAsync(request, session, executor); + } + @Override public void rejectRequest(Request request, HttpSession session) { serverStrategy.rejectRequest(request, session); } + @Override + public void handleIOException(Request request, HttpSession session, IOException exception) { + serverStrategy.handleIOException(request, session, exception); + } + @Override public void close() throws IOException { serverStrategy.close(); diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/util/Headers.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/util/Headers.java index 0754c1422..5042c010a 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/util/Headers.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/util/Headers.java @@ -14,15 +14,15 @@ public enum Headers { private final String name; Headers(String name) { - this.name = name + ":"; + this.name = name; } public static String getHeader(Response response, Headers header) { - return response.getHeader(header.name); + return response.getHeader(header.getOneNioName()); } public static String getHeader(Request request, Headers header) { - return request.getHeader(header.name); + return request.getHeader(header.getOneNioName()); } public static boolean hasHeader(Request request, Headers header) { @@ -30,10 +30,18 @@ public static boolean hasHeader(Request request, Headers header) { } public static void addHeader(Response response, Headers header, Object value) { - response.addHeader(header.name + value.toString()); + response.addHeader(header.getOneNioName() + value.toString()); } public static void addHeader(Request request, Headers header, Object value) { - request.addHeader(header.name + value.toString()); + request.addHeader(header.getOneNioName() + value.toString()); + } + + public String getName() { + return this.name; + } + + private String getOneNioName() { + return this.name + ":"; } } diff --git a/src/main/java/ru/vk/itmo/test/kovalevigor/server/util/ServerUtil.java b/src/main/java/ru/vk/itmo/test/kovalevigor/server/util/ServerUtil.java index 0037f0da3..049a4908a 100644 --- a/src/main/java/ru/vk/itmo/test/kovalevigor/server/util/ServerUtil.java +++ b/src/main/java/ru/vk/itmo/test/kovalevigor/server/util/ServerUtil.java @@ -1,8 +1,10 @@ package ru.vk.itmo.test.kovalevigor.server.util; import one.nio.http.HttpSession; +import one.nio.http.Response; import java.io.IOException; +import java.time.Duration; import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; @@ -18,24 +20,45 @@ public final class ServerUtil { 200, 201, 202, 404 ); + public static final TimeUnit REMOTE_TIMEOUT_TIMEUNIT = TimeUnit.MILLISECONDS; + public static final int REMOTE_TIMEOUT_VALUE = 500; + public static final Duration REMOTE_TIMEOUT = Duration.ofMillis(500); + private ServerUtil() { } + public static void sendResponseWithoutIo(HttpSession session, Response response) { + try { + session.sendResponse(response); + } catch (IOException ioException) { + logIO(ioException); + closeSession(session, ioException); + } + } + public static void sendResponseWithoutIo(HttpSession session, Responses response) { + sendResponseWithoutIo(session, response.toResponse()); + } + + public static void sendErrorWithoutIo(HttpSession session, String code, String message) { try { - session.sendResponse(response.toResponse()); + session.sendError(code, message); } catch (IOException ioException) { - log.log(Level.SEVERE, "IO in socket", ioException); + logIO(ioException); closeSession(session, ioException); } } + public static void logIO(IOException exception) { + log.log(Level.SEVERE, "IO in socket", exception); + } + public static void closeSession(HttpSession session, Exception base) { try { session.sendError(Responses.SERVICE_UNAVAILABLE.getResponseCode(), null); } catch (IOException ioException) { ioException.addSuppressed(base); - log.log(Level.SEVERE, "IO in socket", ioException); + logIO(ioException); session.handleException(ioException); } } @@ -82,4 +105,22 @@ public static int compareTimestamps(String lhs, String rhs) { } return 0; } + + public static Response mergeResponses(Response lhs, Response rhs) { + if (lhs == null) { + return rhs; + } else if (rhs == null) { + return lhs; + } + + int compare = compareTimestamps(getTimestamp(lhs), getTimestamp(rhs)); + if (compare == 0) { + return rhs; + } + return compare > 0 ? lhs : rhs; + } + + public static String getTimestamp(Response response) { + return Headers.getHeader(response, Headers.TIMESTAMP); + } } diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/ConsistentHashing.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/ConsistentHashing.java new file mode 100644 index 000000000..e27fd83e1 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/ConsistentHashing.java @@ -0,0 +1,86 @@ +package ru.vk.itmo.test.pavelemelyanov; + +import one.nio.util.Hash; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.NavigableMap; +import java.util.SortedMap; +import java.util.TreeMap; + +public class ConsistentHashing { + private final NavigableMap virtualNodeMapping = new TreeMap<>(); + private final List clusterUrls; + + public ConsistentHashing(List clusterUrls, int numbOfVirtualNodes) { + this.clusterUrls = clusterUrls; + for (String clusterUrl : clusterUrls) { + for (int i = 0; i < numbOfVirtualNodes; i++) { + addNode(i, clusterUrl); + } + } + } + + public String getNode(String key) { + if (virtualNodeMapping.isEmpty()) { + return null; + } + + final int hash = getHash(key); + SortedMap tailMap = virtualNodeMapping.tailMap(hash); + return (tailMap.isEmpty() ? virtualNodeMapping.firstEntry() : tailMap.firstEntry()).getValue(); + } + + public List getNodes(String key, int from) { + List res = new ArrayList<>(); + + if (key != null && from > 0) { + if (from < clusterUrls.size()) { + int slot = getHash(key); + Iterator it = new ClockwiseIterator(slot); + while (it.hasNext() && res.size() < from) { + String part = it.next(); + res.add(part); + } + } else { + res.addAll(clusterUrls); + } + } + + return res; + } + + private int getHash(String key) { + return Hash.murmur3(key); + } + + private void addNode(int numOfNode, String node) { + int hash = getHash(node + numOfNode); + virtualNodeMapping.put(hash, node); + } + + private class ClockwiseIterator implements Iterator { + private final Iterator head; + private final Iterator tail; + + public ClockwiseIterator(int slot) { + this.head = virtualNodeMapping.headMap(slot) + .values() + .iterator(); + this.tail = virtualNodeMapping.tailMap(slot) + .values() + .iterator(); + } + + @Override + public boolean hasNext() { + return head.hasNext() || tail.hasNext(); + } + + @Override + public String next() { + return tail.hasNext() ? tail.next() : head.next(); + } + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/ExecutorServiceConfig.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/ExecutorServiceConfig.java index 9314a722c..c5a4f7f79 100644 --- a/src/main/java/ru/vk/itmo/test/pavelemelyanov/ExecutorServiceConfig.java +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/ExecutorServiceConfig.java @@ -1,16 +1,21 @@ package ru.vk.itmo.test.pavelemelyanov; +import one.nio.async.CustomThreadFactory; + import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; public final class ExecutorServiceConfig { public static final int CORE_AMOUNT = Runtime.getRuntime().availableProcessors(); - public static final int CORE_POOL_SIZE = CORE_AMOUNT / 2; + public static final int CORE_POOL_SIZE = CORE_AMOUNT; public static final int MAX_CORE_POOL_SIZE = CORE_AMOUNT; - public static final int KEEP_ALIVE_TIME = 200; - public static final int QUEUE_CAPACITY = 64; + public static final long KEEP_ALIVE_TIME = 60; + public static final TimeUnit UNIT = TimeUnit.SECONDS; + public static final int QUEUE_CAPACITY = 1000; + public static final CustomThreadFactory threadFactory = new CustomThreadFactory("t", true); public static final BlockingQueue queue = new ArrayBlockingQueue<>(QUEUE_CAPACITY); public static final RejectedExecutionHandler HANDLER = new ThreadPoolExecutor.AbortPolicy(); diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/ExecutorServiceWrapper.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/ExecutorServiceWrapper.java new file mode 100644 index 000000000..807d73426 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/ExecutorServiceWrapper.java @@ -0,0 +1,46 @@ +package ru.vk.itmo.test.pavelemelyanov; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +public class ExecutorServiceWrapper { + public static final int TERMINATION_TIMEOUT = 60; + private static final Logger LOG = LoggerFactory.getLogger(MyServer.class); + + private final ExecutorService workingPool; + + public ExecutorServiceWrapper() { + workingPool = new ThreadPoolExecutor( + ExecutorServiceConfig.CORE_POOL_SIZE, + ExecutorServiceConfig.MAX_CORE_POOL_SIZE, + ExecutorServiceConfig.KEEP_ALIVE_TIME, + ExecutorServiceConfig.UNIT, + ExecutorServiceConfig.queue, + ExecutorServiceConfig.threadFactory, + ExecutorServiceConfig.HANDLER + ); + } + + public ExecutorService getExecutorService() { + return workingPool; + } + + public void shutdownAndAwaitTermination() { + workingPool.shutdown(); + try { + if (!workingPool.awaitTermination(TERMINATION_TIMEOUT, TimeUnit.SECONDS)) { + workingPool.shutdownNow(); + if (!workingPool.awaitTermination(TERMINATION_TIMEOUT, TimeUnit.SECONDS)) { + LOG.error("ExecutorService error with stopping"); + } + } + } catch (InterruptedException ex) { + workingPool.shutdownNow(); + Thread.currentThread().interrupt(); + } + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/FactoryImpl.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/FactoryImpl.java index b2ddafa1c..226bf7cd5 100644 --- a/src/main/java/ru/vk/itmo/test/pavelemelyanov/FactoryImpl.java +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/FactoryImpl.java @@ -4,7 +4,7 @@ import ru.vk.itmo.ServiceConfig; import ru.vk.itmo.test.ServiceFactory; -@ServiceFactory(stage = 1) +@ServiceFactory(stage = 5) public class FactoryImpl implements ServiceFactory.Factory { @Override diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/HttpUtils.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/HttpUtils.java new file mode 100644 index 000000000..da8c5f8f8 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/HttpUtils.java @@ -0,0 +1,34 @@ +package ru.vk.itmo.test.pavelemelyanov; + +import one.nio.http.Request; +import one.nio.http.Response; + +import java.net.HttpURLConnection; +import java.util.Map; +import java.util.Set; + +public final class HttpUtils { + public static final String NOT_ENOUGH_REPLICAS = "504 Not Enough Replicas"; + public static final Set SUPPORTED_METHODS = Set.of( + Request.METHOD_GET, + Request.METHOD_PUT, + Request.METHOD_DELETE + ); + public static final int REQUEST_TIMEOUT_IN_MILLIS = 3000; + public static final Map HTTP_CODE = Map.of( + HttpURLConnection.HTTP_OK, Response.OK, + HttpURLConnection.HTTP_ACCEPTED, Response.ACCEPTED, + HttpURLConnection.HTTP_CREATED, Response.CREATED, + HttpURLConnection.HTTP_NOT_FOUND, Response.NOT_FOUND, + HttpURLConnection.HTTP_BAD_REQUEST, Response.BAD_REQUEST, + HttpURLConnection.HTTP_INTERNAL_ERROR, Response.INTERNAL_ERROR + ); + public static final int NUMBER_OF_VIRTUAL_NODES = 100; + public static final String HTTP_TIMESTAMP_HEADER = "X-Timestamp"; + public static final String NIO_TIMESTAMP_HEADER = "x-timestamp:"; + public static final String HTTP_TERMINATION_HEADER = "X-Termination"; + + private HttpUtils() { + + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/MyServer.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/MyServer.java index 5b3fcc639..c19ee7c34 100644 --- a/src/main/java/ru/vk/itmo/test/pavelemelyanov/MyServer.java +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/MyServer.java @@ -1,148 +1,268 @@ package ru.vk.itmo.test.pavelemelyanov; +import one.nio.http.HttpException; import one.nio.http.HttpServer; import one.nio.http.HttpServerConfig; import one.nio.http.HttpSession; import one.nio.http.Request; import one.nio.http.Response; import one.nio.server.AcceptorConfig; -import one.nio.util.Utf8; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import ru.vk.itmo.ServiceConfig; -import ru.vk.itmo.dao.BaseEntry; -import ru.vk.itmo.dao.Entry; -import ru.vk.itmo.test.reference.dao.ReferenceDao; +import ru.vk.itmo.test.pavelemelyanov.dao.Dao; +import ru.vk.itmo.test.pavelemelyanov.dao.EntryWithTimestamp; import java.io.IOException; -import java.io.UncheckedIOException; import java.lang.foreign.MemorySegment; -import java.lang.foreign.ValueLayout; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; public class MyServer extends HttpServer { private static final String V0_PATH = "/v0/entity"; private static final String ID_PARAM = "id="; + private static final String FROM_PARAM = "from="; + private static final String ACK_PARAM = "ack="; + private static final int SERVER_ERROR = 500; + private static final Logger LOG = LoggerFactory.getLogger(MyServer.class); - private final ReferenceDao dao; private final ExecutorService workersPool; + private final HttpClient httpClient; + private final ConsistentHashing shards; + private final RequestHandler requestHandler; + private final String selfUrl; + private final int clusterSize; - public MyServer(ServiceConfig config, ReferenceDao dao) throws IOException { - super(configureServer(config)); - this.dao = dao; - workersPool = configureWorkersPool(); + public MyServer( + ServiceConfig config, + Dao> dao, + ExecutorServiceWrapper worker, + ConsistentHashing shards) throws IOException { + super(createServerConfig(config)); + this.selfUrl = config.selfUrl(); + this.shards = shards; + this.requestHandler = new RequestHandler(dao); + this.workersPool = worker.getExecutorService(); + this.clusterSize = config.clusterUrls().size(); + + this.httpClient = HttpClient.newBuilder() + .executor(workersPool).build(); } @Override - public void handleRequest(Request request, HttpSession session) { - if (!request.getPath().equals(V0_PATH)) { - sendResponse( - session, - new Response(Response.BAD_REQUEST, Response.EMPTY) - ); - return; - } - - String paramId = request.getParameter(ID_PARAM); - if (paramId == null || paramId.isBlank()) { - sendResponse( - session, - new Response(Response.BAD_REQUEST, Response.EMPTY) - ); - return; - } + public void handleDefault(Request request, HttpSession session) throws IOException { + Response response = HttpUtils.SUPPORTED_METHODS.contains(request.getMethod()) + ? new Response(Response.BAD_REQUEST, Response.EMPTY) + : new Response(Response.METHOD_NOT_ALLOWED, Response.EMPTY); + session.sendResponse(response); + } + @Override + public void handleRequest(Request request, HttpSession session) throws IOException { try { + if (!request.getURI().startsWith(getPathWithIdParam()) + || !HttpUtils.SUPPORTED_METHODS.contains(request.getMethod())) { + handleDefault(request, session); + return; + } + + String paramId = request.getParameter(ID_PARAM); + String fromStr = request.getParameter(FROM_PARAM); + String ackStr = request.getParameter(ACK_PARAM); + + int from = fromStr == null || fromStr.isBlank() ? clusterSize : Integer.parseInt(fromStr); + int ack = ackStr == null || ackStr.isBlank() ? from / 2 + 1 : Integer.parseInt(ackStr); + + if (ack == 0 || from > clusterSize || ack > from || paramId == null || paramId.isEmpty()) { + sendResponse(session, new Response(Response.BAD_REQUEST, Response.EMPTY)); + return; + } + + long processingStartTime = System.currentTimeMillis(); workersPool.execute(() -> { try { - sendResponse( - session, - handleRequestToEntity(request, paramId) - ); - } catch (Exception e) { - sendResponse( - session, - new Response(Response.INTERNAL_ERROR, Response.EMPTY) - ); + processingRequest(request, session, processingStartTime, paramId, from, ack); + } catch (IOException e) { + LOG.error("Exception while sending close connection", e); + session.scheduleClose(); } }); } catch (RejectedExecutionException e) { - sendResponse( - session, - new Response(Response.SERVICE_UNAVAILABLE, Response.EMPTY) - ); + session.sendResponse(new Response("429 Too Many Requests", Response.EMPTY)); } } - @Override - public synchronized void stop() { - super.stop(); - workersPool.close(); + private void processingRequest(Request request, HttpSession session, long processingStartTime, + String paramId, int from, int ack) throws IOException { + if (System.currentTimeMillis() - processingStartTime > HttpUtils.REQUEST_TIMEOUT_IN_MILLIS) { + session.sendResponse(new Response(Response.REQUEST_TIMEOUT, Response.EMPTY)); + return; + } + try { + if (request.getHeader(HttpUtils.HTTP_TERMINATION_HEADER) == null) { + sendResponse(session, handleProxyRequest(request, paramId, from, ack)); + return; + } + sendResponse(session, requestHandler.handle(request, paramId)); + } catch (Exception e) { + if (e.getClass() == HttpException.class) { + session.sendResponse(new Response(Response.BAD_REQUEST, Response.EMPTY)); + return; + } + LOG.error("Exception during handleRequest: ", e); + session.sendResponse(new Response(Response.INTERNAL_ERROR, Response.EMPTY)); + } + } + + private void sendResponse(HttpSession session, Response response) { + try { + session.sendResponse(response); + } catch (IOException e) { + LOG.error("Error sending response", e); + session.scheduleClose(); + } + } + + private HttpRequest createProxyRequest(Request request, String nodeUrl, String params) { + var bodyPublisher = request.getBody() == null + ? HttpRequest.BodyPublishers.noBody() + : HttpRequest.BodyPublishers.ofByteArray(request.getBody()); + return HttpRequest.newBuilder(URI.create(nodeUrl + getPathWithIdParam() + params)) + .method(request.getMethodName(), bodyPublisher) + .setHeader(HttpUtils.HTTP_TERMINATION_HEADER, "true") + .build(); } - private Response handleRequestToEntity(Request request, String id) { - return switch (request.getMethod()) { - case Request.METHOD_GET -> getEntity(id); - case Request.METHOD_PUT -> putEntity(request, id); - case Request.METHOD_DELETE -> deleteEntity(id); - default -> new Response(Response.METHOD_NOT_ALLOWED, Response.EMPTY); - }; + private CompletableFuture sendProxyRequest(HttpRequest httpRequest) { + return httpClient.sendAsync(httpRequest, HttpResponse.BodyHandlers.ofByteArray()) + .thenApplyAsync(this::processingResponse); } - private Response getEntity(String id) { - MemorySegment key = convertFromString(id); - Entry entry = dao.get(key); - if (entry == null) { - return new Response(Response.NOT_FOUND, Response.EMPTY); + private Response processingResponse(HttpResponse response) { + String statusCode = HttpUtils.HTTP_CODE.getOrDefault(response.statusCode(), null); + if (statusCode == null) { + return new Response(Response.INTERNAL_ERROR, response.body()); } - return Response.ok(entry.value().toArray(ValueLayout.JAVA_BYTE)); + Response newResponse = new Response(statusCode, response.body()); + long timestamp = response.headers() + .firstValueAsLong(HttpUtils.HTTP_TIMESTAMP_HEADER) + .orElse(0); + newResponse.addHeader(HttpUtils.NIO_TIMESTAMP_HEADER + timestamp); + return newResponse; } - private Response putEntity(Request request, String id) { - MemorySegment key = convertFromString(id); - MemorySegment value = MemorySegment.ofArray(request.getBody()); - dao.upsert(new BaseEntry<>(key, value)); - return new Response(Response.CREATED, Response.EMPTY); + private List> sendProxyRequests(Map httpRequests, + List nodeUrls) { + List> responses = new ArrayList<>(); + for (String nodeUrl : nodeUrls) { + HttpRequest httpRequest = httpRequests.get(nodeUrl); + if (!Objects.equals(selfUrl, nodeUrl)) { + responses.add(sendProxyRequest(httpRequest)); + } + } + return responses; } - private Response deleteEntity(String id) { - MemorySegment key = convertFromString(id); - dao.upsert(new BaseEntry<>(key, null)); - return new Response(Response.ACCEPTED, Response.EMPTY); + private Response handleProxyRequest(Request request, String paramId, int from, int ack) { + List nodeUrls = shards.getNodes(paramId, from); + + if (nodeUrls.size() < from) { + return new Response(HttpUtils.NOT_ENOUGH_REPLICAS, Response.EMPTY); + } + + HashMap httpRequests = new HashMap<>(nodeUrls.size()); + for (var nodeUrl : nodeUrls) { + httpRequests.put(nodeUrl, createProxyRequest(request, nodeUrl, paramId)); + } + + List> responses = sendProxyRequests(httpRequests, nodeUrls); + + if (httpRequests.containsKey(selfUrl)) { + responses.add( + CompletableFuture.supplyAsync(() -> requestHandler.handle(request, paramId)) + ); + } + + return getQuorumResult(request, from, ack, responses); } - private static MemorySegment convertFromString(String value) { - return MemorySegment.ofArray(Utf8.toBytes(value)); + private Response getQuorumResult(Request request, int from, int ack, + List> responses) { + List successResponses = new CopyOnWriteArrayList<>(); + CompletableFuture result = new CompletableFuture<>(); + AtomicInteger successResponseCount = new AtomicInteger(); + AtomicInteger errorResponseCount = new AtomicInteger(); + + for (var responseFuture : responses) { + responseFuture.whenCompleteAsync((response, throwable) -> { + if (throwable == null || (response != null && response.getStatus() < SERVER_ERROR)) { + successResponseCount.incrementAndGet(); + successResponses.add(response); + } else { + errorResponseCount.incrementAndGet(); + } + + if (successResponseCount.get() >= ack) { + result.complete(getResult(request, successResponses)); + } + + if (errorResponseCount.get() == from - ack + 1) { + result.complete(new Response(HttpUtils.NOT_ENOUGH_REPLICAS, Response.EMPTY)); + } + }).exceptionally(e -> new Response(Response.INTERNAL_ERROR, Response.EMPTY)); + } + + try { + return result.get(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + return new Response(Response.INTERNAL_ERROR, Response.EMPTY); + } catch (ExecutionException e) { + return new Response(Response.INTERNAL_ERROR, Response.EMPTY); + } } - private static HttpServerConfig configureServer(ServiceConfig serviceConfig) { - var httpServerConfig = new HttpServerConfig(); - var acceptorConfig = new AcceptorConfig(); + private static HttpServerConfig createServerConfig(ServiceConfig serviceConfig) { + HttpServerConfig serverConfig = new HttpServerConfig(); + AcceptorConfig acceptorConfig = new AcceptorConfig(); acceptorConfig.port = serviceConfig.selfPort(); acceptorConfig.reusePort = true; - httpServerConfig.acceptors = new AcceptorConfig[] {acceptorConfig}; - httpServerConfig.closeSessions = true; - return httpServerConfig; + serverConfig.acceptors = new AcceptorConfig[] {acceptorConfig}; + serverConfig.closeSessions = true; + return serverConfig; + } + + private Response getResult(Request request, List successResponses) { + if (request.getMethod() == Request.METHOD_GET) { + sortResponses(successResponses); + return successResponses.getLast(); + } + return successResponses.getFirst(); } - private static ExecutorService configureWorkersPool() { - return new ThreadPoolExecutor( - ExecutorServiceConfig.CORE_POOL_SIZE, - ExecutorServiceConfig.MAX_CORE_POOL_SIZE, - ExecutorServiceConfig.KEEP_ALIVE_TIME, - TimeUnit.MILLISECONDS, - ExecutorServiceConfig.queue, - ExecutorServiceConfig.HANDLER - ); + private void sortResponses(List successResponses) { + successResponses.sort(Comparator.comparingLong(r -> { + String timestamp = r.getHeader(HttpUtils.NIO_TIMESTAMP_HEADER); + return timestamp == null ? 0 : Long.parseLong(timestamp); + })); } - private void sendResponse(HttpSession session, Response response) { - try { - session.sendResponse(response); - } catch (IOException e) { - throw new UncheckedIOException(e); - } + private static String getPathWithIdParam() { + return V0_PATH + "?" + ID_PARAM; } } diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/RequestHandler.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/RequestHandler.java new file mode 100644 index 000000000..88c384f66 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/RequestHandler.java @@ -0,0 +1,85 @@ +package ru.vk.itmo.test.pavelemelyanov; + +import one.nio.http.Param; +import one.nio.http.Request; +import one.nio.http.Response; +import ru.vk.itmo.test.pavelemelyanov.dao.BaseEntryWithTimestamp; +import ru.vk.itmo.test.pavelemelyanov.dao.Dao; +import ru.vk.itmo.test.pavelemelyanov.dao.EntryWithTimestamp; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.ValueLayout; +import java.nio.charset.StandardCharsets; + +import static ru.vk.itmo.test.pavelemelyanov.HttpUtils.HTTP_TIMESTAMP_HEADER; + +public class RequestHandler { + private final Dao> dao; + + public RequestHandler(Dao> dao) { + this.dao = dao; + } + + public Response handle(Request request, String id) { + if (id == null || id.isBlank()) { + return new Response(Response.BAD_REQUEST, Response.EMPTY); + } + + return switch (request.getMethod()) { + case Request.METHOD_GET -> getEntry(id); + case Request.METHOD_PUT -> putEntry(id, request); + case Request.METHOD_DELETE -> deleteEntry(id); + default -> new Response(Response.BAD_REQUEST, Response.EMPTY); + }; + } + + private Response getEntry(@Param(value = "id", required = true) String id) { + MemorySegment key = convertFromString(id); + EntryWithTimestamp entry = dao.get(key); + + if (entry == null || entry.value() == null) { + long timestamp = entry != null ? entry.timestamp() : 0; + return sendResponseWithTimestamp( + Response.NOT_FOUND, + Response.EMPTY, + timestamp + ); + } + + return sendResponseWithTimestamp( + Response.OK, + entry.value().toArray(ValueLayout.JAVA_BYTE), + entry.timestamp() + ); + } + + private Response putEntry(@Param(value = "id", required = true) String id, Request request) { + if (request.getBody() == null) { + return new Response(Response.BAD_REQUEST, Response.EMPTY); + } + + MemorySegment key = convertFromString(id); + MemorySegment value = MemorySegment.ofArray(request.getBody()); + + dao.upsert(new BaseEntryWithTimestamp(key, value, System.currentTimeMillis())); + + return new Response(Response.CREATED, Response.EMPTY); + } + + private Response deleteEntry(@Param(value = "id", required = true) String id) { + MemorySegment key = convertFromString(id); + dao.upsert(new BaseEntryWithTimestamp<>(key, null, System.currentTimeMillis())); + + return new Response(Response.ACCEPTED, Response.EMPTY); + } + + private Response sendResponseWithTimestamp(String resultCode, byte[] body, long timestamp) { + Response response = new Response(resultCode, body); + response.addHeader(HTTP_TIMESTAMP_HEADER + timestamp); + return response; + } + + private static MemorySegment convertFromString(String value) { + return MemorySegment.ofArray(value.getBytes(StandardCharsets.UTF_8)); + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/ServerStarter.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/ServerStarter.java index c91617d96..dc799c41e 100644 --- a/src/main/java/ru/vk/itmo/test/pavelemelyanov/ServerStarter.java +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/ServerStarter.java @@ -2,34 +2,49 @@ import ru.vk.itmo.ServiceConfig; import ru.vk.itmo.dao.Config; -import ru.vk.itmo.test.reference.dao.ReferenceDao; +import ru.vk.itmo.test.pavelemelyanov.dao.ReferenceDao; import java.io.IOException; +import java.nio.file.Files; import java.nio.file.Path; +import java.util.ArrayList; import java.util.List; +import static ru.vk.itmo.test.pavelemelyanov.HttpUtils.NUMBER_OF_VIRTUAL_NODES; + public final class ServerStarter { - private static final Path WORKING_DIR = Path.of("./data1/"); private static final String URL = "http://localhost"; - private static final int FLUSH_THRESHOLD_BYTES = 2 * 1024 * 1024; + public static final long FLUSHING_THRESHOLD_BYTES = 1024 * 1024; + private static final int BASE_PORT = 8080; + private static final int CLUSTER_SIZE = 3; public static void main(String[] args) throws IOException { - ReferenceDao dao = new ReferenceDao( - new Config( - WORKING_DIR, - FLUSH_THRESHOLD_BYTES - ) - ); - MyServer server = new MyServer( - new ServiceConfig( - 8080, - URL, - List.of(URL), - WORKING_DIR - ), - dao - ); - server.start(); + List clusterUrls = new ArrayList<>(); + for (int i = 0; i < CLUSTER_SIZE; i++) { + int tempPortValue = BASE_PORT + i; + clusterUrls.add(URL + ":" + tempPortValue); + } + + ExecutorServiceWrapper worker = new ExecutorServiceWrapper(); + + for (int i = 0; i < CLUSTER_SIZE; i++) { + Path data = Files.createTempDirectory("data12"); + + var dao = new ReferenceDao(new Config(data, FLUSHING_THRESHOLD_BYTES)); + + ServiceConfig serviceConfig = new ServiceConfig( + BASE_PORT + i, + clusterUrls.get(i), + clusterUrls, + data + ); + + ConsistentHashing consistentHashing = new ConsistentHashing(clusterUrls, NUMBER_OF_VIRTUAL_NODES); + + MyServer server = new MyServer(serviceConfig, dao, worker, consistentHashing); + + server.start(); + } } private ServerStarter() { diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/ServiceImpl.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/ServiceImpl.java index ffc778afd..3f6415dfd 100644 --- a/src/main/java/ru/vk/itmo/test/pavelemelyanov/ServiceImpl.java +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/ServiceImpl.java @@ -3,35 +3,47 @@ import ru.vk.itmo.Service; import ru.vk.itmo.ServiceConfig; import ru.vk.itmo.dao.Config; -import ru.vk.itmo.test.reference.dao.ReferenceDao; +import ru.vk.itmo.test.pavelemelyanov.dao.Dao; +import ru.vk.itmo.test.pavelemelyanov.dao.ReferenceDao; import java.io.IOException; import java.util.concurrent.CompletableFuture; +import static ru.vk.itmo.test.pavelemelyanov.HttpUtils.NUMBER_OF_VIRTUAL_NODES; + public class ServiceImpl implements Service { - private static final int FLUSH_THRESHOLD_BYTES = 40 * 1024 * 1024; + private static final int FLUSH_THRESHOLD_BYTES = 1024 * 1024; private final ServiceConfig config; - private MyServer server; - private ReferenceDao dao; + private Dao dao; + private ExecutorServiceWrapper worker; + private Boolean isClosed = false; public ServiceImpl(ServiceConfig config) { this.config = config; } @Override - public CompletableFuture start() throws IOException { + public synchronized CompletableFuture start() throws IOException { dao = new ReferenceDao(new Config(config.workingDir(), FLUSH_THRESHOLD_BYTES)); - server = new MyServer(config, dao); + worker = new ExecutorServiceWrapper(); + var consistentHashing = new ConsistentHashing(config.clusterUrls(), NUMBER_OF_VIRTUAL_NODES); + server = new MyServer(config, dao, worker, consistentHashing); server.start(); + isClosed = false; return CompletableFuture.completedFuture(null); } @Override - public CompletableFuture stop() throws IOException { + public synchronized CompletableFuture stop() throws IOException { + if (isClosed) { + return CompletableFuture.completedFuture(null); + } server.stop(); + worker.shutdownAndAwaitTermination(); dao.close(); + isClosed = true; return CompletableFuture.completedFuture(null); } } diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/BaseEntryWithTimestamp.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/BaseEntryWithTimestamp.java new file mode 100644 index 000000000..596960051 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/BaseEntryWithTimestamp.java @@ -0,0 +1,8 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +public record BaseEntryWithTimestamp(D key, D value, long timestamp) implements EntryWithTimestamp { + @Override + public String toString() { + return "{" + key + ":" + value + ":" + timestamp + "}"; + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/ByteArraySegment.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/ByteArraySegment.java new file mode 100644 index 000000000..51e541e3c --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/ByteArraySegment.java @@ -0,0 +1,48 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import java.nio.ByteBuffer; + +/** + * Growable buffer with {@link ByteBuffer} and {@link MemorySegment} interface. + * + * @author incubos + */ +final class ByteArraySegment { + private byte[] array; + private MemorySegment segment; + + ByteArraySegment(final int capacity) { + this.array = new byte[capacity]; + this.segment = MemorySegment.ofArray(array); + } + + void withArray(final ArrayConsumer consumer) throws IOException { + consumer.process(array); + } + + MemorySegment segment() { + return segment; + } + + void ensureCapacity(final long size) { + if (size > Integer.MAX_VALUE) { + throw new IllegalArgumentException("Too big!"); + } + + final int capacity = (int) size; + if (array.length >= capacity) { + return; + } + + // Grow to the nearest bigger power of 2 + final int newSize = Integer.highestOneBit(capacity) << 1; + array = new byte[newSize]; + segment = MemorySegment.ofArray(array); + } + + interface ArrayConsumer { + void process(byte[] array) throws IOException; + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/Dao.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/Dao.java new file mode 100644 index 000000000..72aa6e406 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/Dao.java @@ -0,0 +1,87 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +import java.io.Closeable; +import java.io.IOException; +import java.util.Iterator; + +public interface Dao> extends Closeable { + /** + * Returns ordered iterator of entries with keys between from (inclusive) and to (exclusive). + * @param from lower bound of range (inclusive) + * @param to upper bound of range (exclusive) + * @return entries [from;to) + */ + Iterator get(D from, D to); + + /** + * Returns entry by key. Note: default implementation is far from optimal. + * @param key entry`s key + * @return entry + */ + default E get(D key) { + Iterator iterator = get(key, null); + if (!iterator.hasNext()) { + return null; + } + + E next = iterator.next(); + if (next.key().equals(key)) { + return next; + } + return null; + } + + /** + * Returns ordered iterator of all entries with keys from (inclusive). + * @param from lower bound of range (inclusive) + * @return entries with key >= from + */ + default Iterator allFrom(D from) { + return get(from, null); + } + + /** + * Returns ordered iterator of all entries with keys < to. + * @param to upper bound of range (exclusive) + * @return entries with key < to + */ + default Iterator allTo(D to) { + return get(null, to); + } + + /** + * Returns ordered iterator of all entries. + * @return all entries + */ + default Iterator all() { + return get(null, null); + } + + /** + * Inserts of replaces entry. + * @param entry element to upsert + */ + void upsert(E entry); + + /** + * Persists data (no-op by default). + */ + default void flush() throws IOException { + // Do nothing + } + + /** + * Compacts data (no-op by default). + */ + default void compact() throws IOException { + // Do nothing + } + + /* + * Releases Dao (calls flush by default). + */ + @Override + default void close() throws IOException { + flush(); + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/EntryWithTimestamp.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/EntryWithTimestamp.java new file mode 100644 index 000000000..479c6a676 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/EntryWithTimestamp.java @@ -0,0 +1,9 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +public interface EntryWithTimestamp { + D key(); + + D value(); + + long timestamp(); +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/MemTable.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/MemTable.java new file mode 100644 index 000000000..b5eaf9e6c --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/MemTable.java @@ -0,0 +1,47 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +import java.lang.foreign.MemorySegment; +import java.util.Iterator; +import java.util.NavigableMap; +import java.util.concurrent.ConcurrentSkipListMap; + +/** + * Memory table. + * + * @author incubos + */ +final class MemTable { + private final NavigableMap> map = + new ConcurrentSkipListMap<>( + MemorySegmentComparator.INSTANCE); + + boolean isEmpty() { + return map.isEmpty(); + } + + Iterator> get( + final MemorySegment from, + final MemorySegment to) { + if (from == null && to == null) { + // All + return map.values().iterator(); + } else if (from == null) { + // Head + return map.headMap(to).values().iterator(); + } else if (to == null) { + // Tail + return map.tailMap(from).values().iterator(); + } else { + // Slice + return map.subMap(from, to).values().iterator(); + } + } + + EntryWithTimestamp get(final MemorySegment key) { + return map.get(key); + } + + EntryWithTimestamp upsert(final EntryWithTimestamp entry) { + return map.put(entry.key(), entry); + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/MemorySegmentComparator.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/MemorySegmentComparator.java new file mode 100644 index 000000000..cd8f549a1 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/MemorySegmentComparator.java @@ -0,0 +1,89 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.ValueLayout; +import java.util.Comparator; + +/** + * Compares {@link MemorySegment}s. + * + * @author incubos + */ +final class MemorySegmentComparator implements Comparator { + static final Comparator INSTANCE = + new MemorySegmentComparator(); + + private MemorySegmentComparator() { + // Singleton + } + + @Override + public int compare( + final MemorySegment left, + final MemorySegment right) { + final long mismatch = left.mismatch(right); + if (mismatch == -1L) { + // No mismatch + return 0; + } + + if (mismatch == left.byteSize()) { + // left is prefix of right, so left is smaller + return -1; + } + + if (mismatch == right.byteSize()) { + // right is prefix of left, so left is greater + return 1; + } + + // Compare mismatched bytes as unsigned + return Byte.compareUnsigned( + left.getAtIndex( + ValueLayout.OfByte.JAVA_BYTE, + mismatch), + right.getAtIndex( + ValueLayout.OfByte.JAVA_BYTE, + mismatch)); + } + + static int compare( + final MemorySegment srcSegment, + final long srcFromOffset, + final long srcLength, + final MemorySegment dstSegment, + final long dstFromOffset, + final long dstLength) { + final long mismatch = + MemorySegment.mismatch( + srcSegment, + srcFromOffset, + srcFromOffset + srcLength, + dstSegment, + dstFromOffset, + dstFromOffset + dstLength); + if (mismatch == -1L) { + // No mismatch + return 0; + } + + if (mismatch == srcLength) { + // left is prefix of right, so left is smaller + return -1; + } + + if (mismatch == dstLength) { + // right is prefix of left, so left is greater + return 1; + } + + // Compare mismatched bytes as unsigned + return Byte.compareUnsigned( + srcSegment.getAtIndex( + ValueLayout.OfByte.JAVA_BYTE, + srcFromOffset + mismatch), + dstSegment.getAtIndex( + ValueLayout.OfByte.JAVA_BYTE, + dstFromOffset + mismatch)); + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/MergingEntryIterator.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/MergingEntryIterator.java new file mode 100644 index 000000000..db321c22b --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/MergingEntryIterator.java @@ -0,0 +1,70 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +import java.lang.foreign.MemorySegment; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.PriorityQueue; +import java.util.Queue; + +/** + * Merges entry {@link Iterator}s. + * + * @author incubos + */ +final class MergingEntryIterator implements Iterator> { + private final Queue iterators; + + MergingEntryIterator(final List iterators) { + assert iterators.stream().allMatch(WeightedPeekingEntryIterator::hasNext); + + this.iterators = new PriorityQueue<>(iterators); + } + + @Override + public boolean hasNext() { + return !iterators.isEmpty(); + } + + @Override + public EntryWithTimestamp next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + + final WeightedPeekingEntryIterator top = iterators.remove(); + final EntryWithTimestamp result = top.next(); + + if (top.hasNext()) { + // Not exhausted + iterators.add(top); + } + + // Remove older versions of the key + while (true) { + final WeightedPeekingEntryIterator iterator = iterators.peek(); + if (iterator == null) { + // Nothing left + break; + } + + // Skip entries with the same key + final EntryWithTimestamp entry = iterator.peek(); + if (MemorySegmentComparator.INSTANCE.compare(result.key(), entry.key()) != 0) { + // Reached another key + break; + } + + // Drop + iterators.remove(); + // Skip + iterator.next(); + if (iterator.hasNext()) { + // Not exhausted + iterators.add(iterator); + } + } + + return result; + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/ReferenceDao.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/ReferenceDao.java new file mode 100644 index 000000000..736d02560 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/ReferenceDao.java @@ -0,0 +1,288 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +import ru.vk.itmo.dao.Config; + +import java.io.IOException; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +/** + * Reference implementation of {@link Dao}. + * + * @author incubos + */ +public class ReferenceDao implements Dao> { + private final Config config; + private final Arena arena; + + private final ReadWriteLock lock = new ReentrantReadWriteLock(); + // Guarded by lock + private volatile TableSet tableSet; + + private final ExecutorService flusher = + Executors.newSingleThreadExecutor(r -> { + final Thread result = new Thread(r); + result.setName("flusher"); + return result; + }); + private final ExecutorService compactor = + Executors.newSingleThreadExecutor(r -> { + final Thread result = new Thread(r); + result.setName("compactor"); + return result; + }); + + private final AtomicBoolean closed = new AtomicBoolean(); + + public ReferenceDao(final Config config) throws IOException { + this.config = config; + this.arena = Arena.ofShared(); + + // First complete promotion of compacted SSTables + SSTables.promote( + config.basePath(), + 0, + 1); + + this.tableSet = + TableSet.from( + SSTables.discover( + arena, + config.basePath())); + } + + @Override + public Iterator> get( + final MemorySegment from, + final MemorySegment to) { + return tableSet.get( + from, + to); + } + + @Override + public EntryWithTimestamp get(final MemorySegment key) { + // Without lock, just snapshot of table set + return tableSet.get(key); + } + + @Override + public void upsert(final EntryWithTimestamp entry) { + final boolean autoFlush; + lock.readLock().lock(); + try { + if (tableSet.memTableSize.get() > config.flushThresholdBytes() + && tableSet.flushingTable != null) { + throw new IllegalStateException("Can't keep up with flushing!"); + } + + // Upsert + final EntryWithTimestamp previous = tableSet.upsert(entry); + + // Update size estimate + final long size = tableSet.memTableSize.addAndGet(sizeOf(entry) - sizeOf(previous)); + autoFlush = size > config.flushThresholdBytes(); + } finally { + lock.readLock().unlock(); + } + + if (autoFlush) { + initiateFlush(true); + } + } + + private static long sizeOf(final EntryWithTimestamp entry) { + if (entry == null) { + return 0L; + } + + if (entry.value() == null) { + return entry.key().byteSize(); + } + + return entry.key().byteSize() + entry.value().byteSize(); + } + + private void initiateFlush(final boolean auto) { + flusher.submit(() -> { + final TableSet currentTableSet; + lock.writeLock().lock(); + try { + if (this.tableSet.memTable.isEmpty()) { + // Nothing to flush + return; + } + + if (auto && this.tableSet.memTableSize.get() < config.flushThresholdBytes()) { + // Not enough data to flush + return; + } + + // Switch memTable to flushing + currentTableSet = this.tableSet.flushing(); + this.tableSet = currentTableSet; + } finally { + lock.writeLock().unlock(); + } + + // Write + final int sequence = currentTableSet.nextSequence(); + try { + new SSTableWriter() + .write( + config.basePath(), + sequence, + currentTableSet.flushingTable.get(null, null)); + } catch (IOException e) { + e.printStackTrace(); + Runtime.getRuntime().halt(-1); + return; + } + + // Open + final SSTable flushed; + try { + flushed = SSTables.open( + arena, + config.basePath(), + sequence); + } catch (IOException e) { + e.printStackTrace(); + Runtime.getRuntime().halt(-2); + return; + } + + // Switch + lock.writeLock().lock(); + try { + this.tableSet = this.tableSet.flushed(flushed); + } finally { + lock.writeLock().unlock(); + } + }).state(); + } + + @Override + public void flush() throws IOException { + initiateFlush(false); + } + + @Override + public void compact() throws IOException { + compactor.submit(() -> { + final TableSet currentTableSet; + lock.writeLock().lock(); + try { + currentTableSet = this.tableSet; + if (currentTableSet.ssTables.size() < 2) { + // Nothing to compact + return; + } + } finally { + lock.writeLock().unlock(); + } + + // Compact to 0 + try { + new SSTableWriter() + .write( + config.basePath(), + 0, + currentTableSet.allSSTableEntries()); + } catch (IOException e) { + e.printStackTrace(); + Runtime.getRuntime().halt(-3); + } + + // Open 0 + final SSTable compacted; + try { + compacted = + SSTables.open( + arena, + config.basePath(), + 0); + } catch (IOException e) { + e.printStackTrace(); + Runtime.getRuntime().halt(-4); + return; + } + + // Replace old SSTables with compacted one to + // keep serving requests + final Set replaced = new HashSet<>(currentTableSet.ssTables); + lock.writeLock().lock(); + try { + this.tableSet = + this.tableSet.compacted( + replaced, + compacted); + } finally { + lock.writeLock().unlock(); + } + + // Remove compacted SSTables starting from the oldest ones. + // If we crash, 0 contains all the data, and + // it will be promoted on reopen. + for (final SSTable ssTable : currentTableSet.ssTables.reversed()) { + try { + SSTables.remove( + config.basePath(), + ssTable.sequence); + } catch (IOException e) { + e.printStackTrace(); + Runtime.getRuntime().halt(-5); + } + } + + // Promote zero to one (possibly replacing) + try { + SSTables.promote( + config.basePath(), + 0, + 1); + } catch (IOException e) { + e.printStackTrace(); + Runtime.getRuntime().halt(-6); + } + + // Replace promoted SSTable + lock.writeLock().lock(); + try { + this.tableSet = + this.tableSet.compacted( + Collections.singleton(compacted), + compacted.withSequence(1)); + } finally { + lock.writeLock().unlock(); + } + }).state(); + } + + @Override + public void close() throws IOException { + if (closed.getAndSet(true)) { + // Already closed + return; + } + + // Maybe flush + flush(); + + // Stop all the threads + flusher.close(); + compactor.close(); + + // Close arena + arena.close(); + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/SSTable.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/SSTable.java new file mode 100644 index 000000000..a1f0b6d6f --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/SSTable.java @@ -0,0 +1,207 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.ValueLayout; +import java.util.Collections; +import java.util.Iterator; +import java.util.NoSuchElementException; + +/** + * Persistent SSTable in data file and index file. + * + * @author incubos + * @see SSTables + */ +final class SSTable { + final int sequence; + + private final MemorySegment index; + private final MemorySegment data; + private final long size; + + SSTable( + final int sequence, + final MemorySegment index, + final MemorySegment data) { + this.sequence = sequence; + this.index = index; + this.data = data; + this.size = index.byteSize() / Long.BYTES; + } + + SSTable withSequence(final int sequence) { + return new SSTable( + sequence, + index, + data); + } + + /** + * Returns index of the entry if found; otherwise, (-(insertion point) - 1). + * The insertion point is defined as the point at which the key would be inserted: + * the index of the first element greater than the key, + * or size if all keys are less than the specified key. + * Note that this guarantees that the return value will be >= 0 + * if and only if the key is found. + */ + private long entryBinarySearch(final MemorySegment key) { + long low = 0L; + long high = size - 1; + + while (low <= high) { + final long mid = (low + high) >>> 1; + final long midEntryOffset = entryOffset(mid); + final long midKeyLength = getLength(midEntryOffset); + final int compare = + MemorySegmentComparator.compare( + data, + midEntryOffset + Long.BYTES, // Position at key + midKeyLength, + key, + 0L, + key.byteSize()); + + if (compare < 0) { + low = mid + 1; + } else if (compare > 0) { + high = mid - 1; + } else { + return mid; + } + } + + return -(low + 1); + } + + private long entryOffset(final long entry) { + return index.get( + ValueLayout.OfLong.JAVA_LONG, + entry * Long.BYTES); + } + + private long getLength(final long offset) { + return data.get( + ValueLayout.OfLong.JAVA_LONG_UNALIGNED, + offset); + } + + Iterator> get( + final MemorySegment from, + final MemorySegment to) { + assert from == null || to == null || MemorySegmentComparator.INSTANCE.compare(from, to) <= 0; + + // Slice of SSTable in absolute offsets + final long fromOffset; + final long toOffset; + + // Left offset bound + if (from == null) { + // Start from the beginning + fromOffset = 0L; + } else { + final long fromEntry = entryBinarySearch(from); + if (fromEntry >= 0L) { + fromOffset = entryOffset(fromEntry); + } else if (-fromEntry - 1 == size) { + // No relevant data + return Collections.emptyIterator(); + } else { + // Greater but existing key found + fromOffset = entryOffset(-fromEntry - 1); + } + } + + // Right offset bound + if (to == null) { + // Up to the end + toOffset = data.byteSize(); + } else { + final long toEntry = entryBinarySearch(to); + if (toEntry >= 0L) { + toOffset = entryOffset(toEntry); + } else if (-toEntry - 1 == size) { + // Up to the end + toOffset = data.byteSize(); + } else { + // Greater but existing key found + toOffset = entryOffset(-toEntry - 1); + } + } + + return new SliceIterator(fromOffset, toOffset); + } + + EntryWithTimestamp get(final MemorySegment key) { + final long entry = entryBinarySearch(key); + if (entry < 0) { + return null; + } + + // Skip key (will reuse the argument) + long offset = entryOffset(entry); + offset += Long.BYTES + key.byteSize(); + // Extract value length + final long valueLength = getLength(offset); + if (valueLength == SSTables.TOMBSTONE_VALUE_LENGTH) { + // Tombstone encountered + offset += Long.BYTES; + return new BaseEntryWithTimestamp<>(key, null, getLength(offset)); + } else { + // Get value + offset += Long.BYTES; + final MemorySegment value = data.asSlice(offset, valueLength); + offset += valueLength; + return new BaseEntryWithTimestamp<>(key, value, getLength(offset)); + } + } + + private final class SliceIterator implements Iterator> { + private long offset; + private final long toOffset; + + private SliceIterator( + final long offset, + final long toOffset) { + this.offset = offset; + this.toOffset = toOffset; + } + + @Override + public boolean hasNext() { + return offset < toOffset; + } + + @Override + public EntryWithTimestamp next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + + // Read key length + final long keyLength = getLength(offset); + offset += Long.BYTES; + + // Read key + final MemorySegment key = data.asSlice(offset, keyLength); + offset += keyLength; + + // Read value length + final long valueLength = getLength(offset); + offset += Long.BYTES; + + // Read value + if (valueLength == SSTables.TOMBSTONE_VALUE_LENGTH) { + // Tombstone encountered + final long timestamp = getLength(offset); + offset += Long.BYTES; + return new BaseEntryWithTimestamp<>(key, null, timestamp); + } else { + final MemorySegment value = data.asSlice(offset, valueLength); + offset += valueLength; + final long timestamp = getLength(offset); + offset += Long.BYTES; + return new BaseEntryWithTimestamp<>(key, value, timestamp); + } + } + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/SSTableWriter.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/SSTableWriter.java new file mode 100644 index 000000000..f08137bb3 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/SSTableWriter.java @@ -0,0 +1,170 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +import java.io.BufferedOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.ValueLayout; +import java.nio.channels.FileChannel; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.Iterator; + +/** + * Writes {@link EntryWithTimestamp} {@link Iterator} to SSTable on disk. + * + *

Index file {@code .index} contains {@code long} offsets to entries in data file: + * {@code [offset0, offset1, ...]} + * + *

Data file {@code .data} contains serialized entries: + * {@code } + * + *

Tombstones are encoded as {@code valueLength} {@code -1} and no subsequent value. + * + * @author incubos + */ +final class SSTableWriter { + private static final int BUFFER_SIZE = 64 * 1024; + + // Reusable buffers to eliminate allocations. + // But excessive memory copying is still there :( + // Long cell + private final ByteArraySegment longBuffer = new ByteArraySegment(Long.BYTES); + // Growable blob cell + private final ByteArraySegment blobBuffer = new ByteArraySegment(512); + + void write( + final Path baseDir, + final int sequence, + final Iterator> entries) throws IOException { + // Write to temporary files + final Path tempIndexName = SSTables.tempIndexName(baseDir, sequence); + final Path tempDataName = SSTables.tempDataName(baseDir, sequence); + + // Delete temporary files to eliminate tails + Files.deleteIfExists(tempIndexName); + Files.deleteIfExists(tempDataName); + + // Iterate in a single pass! + // Will write through FileChannel despite extra memory copying and + // no buffering (which may be implemented later). + // Looking forward to MemorySegment facilities in FileChannel! + try (OutputStream index = + new BufferedOutputStream( + new FileOutputStream( + tempIndexName.toFile()), + BUFFER_SIZE); + OutputStream data = + new BufferedOutputStream( + new FileOutputStream( + tempDataName.toFile()), + BUFFER_SIZE)) { + long entryOffset = 0L; + + // Iterate and serialize + while (entries.hasNext()) { + // First write offset to the entry + writeLong(entryOffset, index); + + // Then write the entry + final EntryWithTimestamp entry = entries.next(); + entryOffset += writeEntry(entry, data); + } + } + + // Publish files atomically + // FIRST index, LAST data + final Path indexName = + SSTables.indexName( + baseDir, + sequence); + Files.move( + tempIndexName, + indexName, + StandardCopyOption.ATOMIC_MOVE, + StandardCopyOption.REPLACE_EXISTING); + final Path dataName = + SSTables.dataName( + baseDir, + sequence); + Files.move( + tempDataName, + dataName, + StandardCopyOption.ATOMIC_MOVE, + StandardCopyOption.REPLACE_EXISTING); + } + + private void writeLong( + final long value, + final OutputStream os) throws IOException { + longBuffer.segment().set( + ValueLayout.OfLong.JAVA_LONG_UNALIGNED, + 0, + value); + longBuffer.withArray(os::write); + } + + private void writeSegment( + final MemorySegment value, + final OutputStream os) throws IOException { + final long size = value.byteSize(); + blobBuffer.ensureCapacity(size); + MemorySegment.copy( + value, + 0L, + blobBuffer.segment(), + 0L, + size); + blobBuffer.withArray(array -> + os.write( + array, + 0, + (int) size)); + } + + /** + * Writes {@link EntryWithTimestamp} to {@link FileChannel}. + * + * @return written bytes + */ + private long writeEntry( + final EntryWithTimestamp entry, + final OutputStream os) throws IOException { + final MemorySegment key = entry.key(); + final MemorySegment value = entry.value(); + final long timestamp = entry.timestamp(); + long result = 0L; + + // Key size + writeLong(key.byteSize(), os); + result += Long.BYTES; + + // Key + writeSegment(key, os); + result += key.byteSize(); + + // Value size and possibly value + if (value == null) { + // Tombstone + writeLong(SSTables.TOMBSTONE_VALUE_LENGTH, os); + result += Long.BYTES; + + } else { + // Value length + writeLong(value.byteSize(), os); + result += Long.BYTES; + + // Value + writeSegment(value, os); + result += value.byteSize(); + } + + // Timestamp + writeLong(timestamp, os); + result += Long.BYTES; + + return result; + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/SSTables.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/SSTables.java new file mode 100644 index 000000000..a4e64b455 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/SSTables.java @@ -0,0 +1,162 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.nio.channels.FileChannel; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.nio.file.StandardOpenOption; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +/** + * Provides {@link SSTable} management facilities: dumping and discovery. + * + * @author incubos + */ +final class SSTables { + public static final String INDEX_SUFFIX = ".index"; + public static final String DATA_SUFFIX = ".data"; + public static final long TOMBSTONE_VALUE_LENGTH = -1L; + + private static final String TEMP_SUFFIX = ".tmp"; + + /** + * Can't instantiate. + */ + private SSTables() { + // Only static methods + } + + static Path indexName( + final Path baseDir, + final int sequence) { + return baseDir.resolve(sequence + INDEX_SUFFIX); + } + + static Path dataName( + final Path baseDir, + final int sequence) { + return baseDir.resolve(sequence + DATA_SUFFIX); + } + + static Path tempIndexName( + final Path baseDir, + final int sequence) { + return baseDir.resolve(sequence + INDEX_SUFFIX + TEMP_SUFFIX); + } + + static Path tempDataName( + final Path baseDir, + final int sequence) { + return baseDir.resolve(sequence + DATA_SUFFIX + TEMP_SUFFIX); + } + + /** + * Returns {@link List} of {@link SSTable}s from freshest to oldest. + */ + static List discover( + final Arena arena, + final Path baseDir) throws IOException { + if (!Files.exists(baseDir)) { + return Collections.emptyList(); + } + + final List result = new ArrayList<>(); + try (Stream files = Files.list(baseDir)) { + files.forEach(file -> { + final String fileName = file.getFileName().toString(); + if (!fileName.endsWith(DATA_SUFFIX)) { + // Skip non data + return; + } + + final int sequence = + // .data -> N + Integer.parseInt( + fileName.substring( + 0, + fileName.length() - DATA_SUFFIX.length())); + + try { + result.add(open(arena, baseDir, sequence)); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }); + } + + // Sort from freshest to oldest + result.sort((o1, o2) -> Integer.compare(o2.sequence, o1.sequence)); + + return Collections.unmodifiableList(result); + } + + static SSTable open( + final Arena arena, + final Path baseDir, + final int sequence) throws IOException { + final MemorySegment index = + mapReadOnly( + arena, + indexName(baseDir, sequence)); + final MemorySegment data = + mapReadOnly( + arena, + dataName(baseDir, sequence)); + + return new SSTable( + sequence, + index, + data); + } + + private static MemorySegment mapReadOnly( + final Arena arena, + final Path file) throws IOException { + try (FileChannel channel = + FileChannel.open( + file, + StandardOpenOption.READ)) { + return channel.map( + FileChannel.MapMode.READ_ONLY, + 0L, + Files.size(file), + arena); + } + } + + static void remove( + final Path baseDir, + final int sequence) throws IOException { + // First delete data file to make SSTable invisible + Files.delete(dataName(baseDir, sequence)); + Files.delete(indexName(baseDir, sequence)); + } + + static void promote( + final Path baseDir, + final int from, + final int to) throws IOException { + // Build to progress to the same outcome + if (Files.exists(indexName(baseDir, from))) { + Files.move( + indexName(baseDir, from), + indexName(baseDir, to), + StandardCopyOption.ATOMIC_MOVE, + StandardCopyOption.REPLACE_EXISTING); + } + if (Files.exists(dataName(baseDir, from))) { + Files.move( + dataName(baseDir, from), + dataName(baseDir, to), + StandardCopyOption.ATOMIC_MOVE, + StandardCopyOption.REPLACE_EXISTING); + } + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/TableSet.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/TableSet.java new file mode 100644 index 000000000..f3d536ed0 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/TableSet.java @@ -0,0 +1,199 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +import java.lang.foreign.MemorySegment; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Data set in various tables. + * + * @author incubos + */ +final class TableSet { + final MemTable memTable; + final AtomicLong memTableSize; + // null or read-only + final MemTable flushingTable; + // From freshest to oldest + final List ssTables; + + private TableSet( + final MemTable memTable, + final AtomicLong memTableSize, + final MemTable flushingTable, + final List ssTables) { + this.memTable = memTable; + this.memTableSize = memTableSize; + this.flushingTable = flushingTable; + this.ssTables = ssTables; + } + + static TableSet from(final List ssTables) { + return new TableSet( + new MemTable(), + new AtomicLong(), + null, + ssTables); + } + + int nextSequence() { + return ssTables.stream() + .mapToInt(t -> t.sequence) + .max() + .orElse(0) + 1; + } + + TableSet flushing() { + if (memTable.isEmpty()) { + throw new IllegalStateException("Nothing to flush"); + } + + if (flushingTable != null) { + throw new IllegalStateException("Already flushing"); + } + + return new TableSet( + new MemTable(), + new AtomicLong(), + memTable, + ssTables); + } + + TableSet flushed(final SSTable flushed) { + final List newSSTables = new ArrayList<>(ssTables.size() + 1); + newSSTables.add(flushed); + newSSTables.addAll(ssTables); + return new TableSet( + memTable, + memTableSize, + null, + newSSTables); + } + + TableSet compacted( + final Set replaced, + final SSTable with) { + final List newSsTables = new ArrayList<>(this.ssTables.size() + 1); + + // Keep not replaced SSTables + for (final SSTable ssTable : this.ssTables) { + if (!replaced.contains(ssTable)) { + newSsTables.add(ssTable); + } + } + + // Logically the oldest one + newSsTables.add(with); + + return new TableSet( + memTable, + memTableSize, + flushingTable, + newSsTables); + } + + Iterator> get( + final MemorySegment from, + final MemorySegment to) { + final List iterators = + new ArrayList<>(2 + ssTables.size()); + + // MemTable goes first + final Iterator> memTableIterator = + memTable.get(from, to); + if (memTableIterator.hasNext()) { + iterators.add( + new WeightedPeekingEntryIterator( + Integer.MIN_VALUE, + memTableIterator)); + } + + // Then goes flushing + if (flushingTable != null) { + final Iterator> flushingIterator = + flushingTable.get(from, to); + if (flushingIterator.hasNext()) { + iterators.add( + new WeightedPeekingEntryIterator( + Integer.MIN_VALUE + 1, + flushingIterator)); + } + } + + // Then go all the SSTables + for (int i = 0; i < ssTables.size(); i++) { + final SSTable ssTable = ssTables.get(i); + final Iterator> ssTableIterator = + ssTable.get(from, to); + if (ssTableIterator.hasNext()) { + iterators.add( + new WeightedPeekingEntryIterator( + i, + ssTableIterator)); + } + } + + return switch (iterators.size()) { + case 0 -> Collections.emptyIterator(); + case 1 -> iterators.get(0); + default -> new MergingEntryIterator(iterators); + }; + } + + EntryWithTimestamp get(final MemorySegment key) { + // Slightly optimized version not to pollute the heap + + // First check MemTable + EntryWithTimestamp result = memTable.get(key); + if (result != null) { + // Transform tombstone + return result; + } + + // Then check flushing + if (flushingTable != null) { + result = flushingTable.get(key); + if (result != null) { + // Transform tombstone + return result; + } + } + + // At last check SSTables from freshest to oldest + for (final SSTable ssTable : ssTables) { + result = ssTable.get(key); + if (result != null) { + // Transform tombstone + return result; + } + } + + // Nothing found + return null; + } + + EntryWithTimestamp upsert(final EntryWithTimestamp entry) { + return memTable.upsert(entry); + } + + Iterator> allSSTableEntries() { + final List iterators = + new ArrayList<>(ssTables.size()); + + for (int i = 0; i < ssTables.size(); i++) { + final SSTable ssTable = ssTables.get(i); + final Iterator> ssTableIterator = + ssTable.get(null, null); + iterators.add( + new WeightedPeekingEntryIterator( + i, + ssTableIterator)); + } + + return new MergingEntryIterator(iterators); + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/WeightedPeekingEntryIterator.java b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/WeightedPeekingEntryIterator.java new file mode 100644 index 000000000..a15d41fe5 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/dao/WeightedPeekingEntryIterator.java @@ -0,0 +1,65 @@ +package ru.vk.itmo.test.pavelemelyanov.dao; + +import java.lang.foreign.MemorySegment; +import java.util.Iterator; +import java.util.NoSuchElementException; + +/** + * Peeking {@link Iterator} wrapper. + * + * @author incubos + */ +final class WeightedPeekingEntryIterator + implements Iterator>, + Comparable { + private final int weight; + private final Iterator> delegate; + private EntryWithTimestamp next; + + WeightedPeekingEntryIterator( + final int weight, + final Iterator> delegate) { + this.weight = weight; + this.delegate = delegate; + this.next = delegate.hasNext() ? delegate.next() : null; + } + + @Override + public boolean hasNext() { + return next != null; + } + + @Override + public EntryWithTimestamp next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + + final EntryWithTimestamp result = next; + next = delegate.hasNext() ? delegate.next() : null; + return result; + } + + EntryWithTimestamp peek() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + + return next; + } + + @Override + public int compareTo(final WeightedPeekingEntryIterator other) { + // First compare keys + int result = + MemorySegmentComparator.INSTANCE.compare( + peek().key(), + other.peek().key()); + if (result != 0) { + return result; + } + + // Then compare weights if keys are equal + return Integer.compare(weight, other.weight); + } +} diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/report/stage5/report.md b/src/main/java/ru/vk/itmo/test/pavelemelyanov/report/stage5/report.md new file mode 100644 index 000000000..f0f122667 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/report/stage5/report.md @@ -0,0 +1,39 @@ +# Отчёт stage2 +Всвязи с тем, что ноутбук, на котором я делал первые лабы вышел из строя +(бесконечная загрузка). Протестировал на стационарном компьюетре с оооооочень плохими характеристиками (у меня он винду не тянет вообще никак) +Всего ядер 2, так как процессор слудующий: intel(r) core(tm) i3-6100t cpu +поэтому значения параметров в отчёте крайне маленькие +Кластер состоит из 3 нод +При увеличении количества соединений возникали проблемы с тестированием, так как компьютер не справлялся +# Анализ +Точка разладки достигается при 1000 rps на put и при 2к на get, поэтому буду тестировать на 700 rps put и 1500 get + +## Alloc PUT +Появилась аллокация ForkJoinWorkerThread.run, которая возникла, подозреваю при работе с CompletableFuture + +Не понимаю, почему нет аллокации на дэфолтный экзекутор. По идее он должен быть, ведь сам я его не создавал + +## Alloc GET +Аналогично, но с изменением в пропорциях + +## Lock PUT +ThreadPoolExecutor.runWorker занимает 73% +ThreadPoolExecutor.getTask - 8% +CompletableFuture$AsyncSupply.run 19.62% +SequentialScheduler$SchedulableTask.run - 45% +SelectorManager - 20% +Подозреваю, что такие значения из-за асинхронной работы +## Lock GET +Аналогично, но с изменением в пропорциях +## CPU PUT +SelectorManager занимает 5% (используется для управления соединениями клиента) +Появилась работа у воркеров с CompletableFuture, чего мы и добивались + +Работа с responseAsync клиента - 35%; в нем же 25% - работа СompletableFuture +## CPU GET +Аналогично, но с изменением в пропорциях +## Итог +Из-за CompletableFuture выросла трата ресуросв на работу с ними. Самыми показательными были LOCK фреймы. + +## Улучшения +- Идей нет \ No newline at end of file diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/script/lua/stage1/delete.lua b/src/main/java/ru/vk/itmo/test/pavelemelyanov/script/lua/stage1/delete.lua deleted file mode 100644 index d9a966809..000000000 --- a/src/main/java/ru/vk/itmo/test/pavelemelyanov/script/lua/stage1/delete.lua +++ /dev/null @@ -1,9 +0,0 @@ -id = 0 - -function request() - id = id + 1 - path = "/v0/entity?id=" .. id - headers = {} - headers["Host"] = "localhost:8080" - return wrk.format("DELETE", path, headers) -end diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/script/lua/stage1/get.lua b/src/main/java/ru/vk/itmo/test/pavelemelyanov/script/lua/stage1/get.lua index fe4b24635..d71c68d47 100644 --- a/src/main/java/ru/vk/itmo/test/pavelemelyanov/script/lua/stage1/get.lua +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/script/lua/stage1/get.lua @@ -1,9 +1,5 @@ -id = 0 - function request() - id = id + 1 + id = math.random(1, 1000) path = "/v0/entity?id=" .. id - headers = {} - headers["Host"] = "localhost:8080" - return wrk.format("GET", path, headers) + return wrk.format("GET", path, body) end diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/script/lua/stage1/put.lua b/src/main/java/ru/vk/itmo/test/pavelemelyanov/script/lua/stage1/put.lua index 75b48b642..f20740d29 100644 --- a/src/main/java/ru/vk/itmo/test/pavelemelyanov/script/lua/stage1/put.lua +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/script/lua/stage1/put.lua @@ -12,8 +12,7 @@ end function request() id = id + 1 path = "/v0/entity?id=" .. id - headers = {} - headers["Host"] = "localhost:8080" body = random_string() + headers = {} return wrk.format("PUT", path, headers, body) end diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/alloc-get.html b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/alloc-get.html new file mode 100644 index 000000000..04c1f23b9 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/alloc-get.html @@ -0,0 +1,2807 @@ + + + + + + + +

Allocation profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/alloc-put.html b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/alloc-put.html new file mode 100644 index 000000000..15ab6978c --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/alloc-put.html @@ -0,0 +1,2793 @@ + + + + + + + +

Allocation profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/cpu-get.html b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/cpu-get.html new file mode 100644 index 000000000..f41753205 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/cpu-get.html @@ -0,0 +1,4942 @@ + + + + + + + +

CPU profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/cpu-put.html b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/cpu-put.html new file mode 100644 index 000000000..2c00b1c4b --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/cpu-put.html @@ -0,0 +1,2932 @@ + + + + + + + +

CPU profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/lock-get.html b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/lock-get.html new file mode 100644 index 000000000..7460ee6be --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/lock-get.html @@ -0,0 +1,939 @@ + + + + + + + +

Lock profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/lock-put.html b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/lock-put.html new file mode 100644 index 000000000..3e8c5c5c7 --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/profiler/stage5/lock-put.html @@ -0,0 +1,779 @@ + + + + + + + +

Lock profile

+
  
+
Produced by async-profiler
+ +
+

+

Matched:

+ diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/wrk/stage5/get-1500rps-1t.txt b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/wrk/stage5/get-1500rps-1t.txt new file mode 100644 index 000000000..46b33985c --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/wrk/stage5/get-1500rps-1t.txt @@ -0,0 +1,104 @@ +Running 30s test @ http://localhost:8080 + 1 threads and 2 connections + Thread calibration: mean lat.: 1.709ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.68ms 0.95ms 17.23ms 91.13% + Req/Sec 1.58k 143.00 2.90k 78.11% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.53ms + 75.000% 1.87ms + 90.000% 2.32ms + 99.000% 5.71ms + 99.900% 10.74ms + 99.990% 16.59ms + 99.999% 17.25ms +100.000% 17.25ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.334 0.000000 1 1.00 + 0.979 0.100000 3000 1.11 + 1.143 0.200000 6007 1.25 + 1.286 0.300000 9009 1.43 + 1.409 0.400000 12015 1.67 + 1.528 0.500000 15014 2.00 + 1.589 0.550000 16508 2.22 + 1.651 0.600000 18001 2.50 + 1.715 0.650000 19493 2.86 + 1.786 0.700000 21009 3.33 + 1.865 0.750000 22494 4.00 + 1.911 0.775000 23255 4.44 + 1.958 0.800000 23991 5.00 + 2.018 0.825000 24748 5.71 + 2.091 0.850000 25515 6.67 + 2.181 0.875000 26244 8.00 + 2.241 0.887500 26613 8.89 + 2.319 0.900000 26988 10.00 + 2.411 0.912500 27362 11.43 + 2.547 0.925000 27739 13.33 + 2.713 0.937500 28111 16.00 + 2.813 0.943750 28299 17.78 + 2.931 0.950000 28486 20.00 + 3.059 0.956250 28675 22.86 + 3.241 0.962500 28861 26.67 + 3.477 0.968750 29049 32.00 + 3.645 0.971875 29141 35.56 + 3.857 0.975000 29235 40.00 + 4.067 0.978125 29329 45.71 + 4.403 0.981250 29422 53.33 + 4.731 0.984375 29516 64.00 + 4.955 0.985938 29563 71.11 + 5.199 0.987500 29610 80.00 + 5.523 0.989062 29657 91.43 + 5.967 0.990625 29703 106.67 + 6.415 0.992188 29752 128.00 + 6.619 0.992969 29774 142.22 + 6.931 0.993750 29798 160.00 + 7.255 0.994531 29821 182.86 + 7.659 0.995313 29844 213.33 + 8.279 0.996094 29867 256.00 + 8.647 0.996484 29879 284.44 + 8.895 0.996875 29891 320.00 + 9.111 0.997266 29903 365.71 + 9.359 0.997656 29914 426.67 + 9.655 0.998047 29926 512.00 + 9.815 0.998242 29932 568.89 + 9.975 0.998437 29938 640.00 + 10.151 0.998633 29944 731.43 + 10.463 0.998828 29949 853.33 + 10.855 0.999023 29955 1024.00 + 11.335 0.999121 29958 1137.78 + 11.703 0.999219 29961 1280.00 + 12.391 0.999316 29964 1462.86 + 13.295 0.999414 29967 1706.67 + 13.607 0.999512 29970 2048.00 + 13.791 0.999561 29971 2275.56 + 13.807 0.999609 29973 2560.00 + 13.951 0.999658 29974 2925.71 + 15.199 0.999707 29976 3413.33 + 15.607 0.999756 29977 4096.00 + 15.807 0.999780 29978 4551.11 + 15.959 0.999805 29979 5120.00 + 15.959 0.999829 29979 5851.43 + 16.327 0.999854 29980 6826.67 + 16.591 0.999878 29981 8192.00 + 16.591 0.999890 29981 9102.22 + 16.735 0.999902 29982 10240.00 + 16.735 0.999915 29982 11702.86 + 16.735 0.999927 29982 13653.33 + 17.071 0.999939 29983 16384.00 + 17.071 0.999945 29983 18204.44 + 17.071 0.999951 29983 20480.00 + 17.071 0.999957 29983 23405.71 + 17.071 0.999963 29983 27306.67 + 17.247 0.999969 29984 32768.00 + 17.247 1.000000 29984 inf +#[Mean = 1.683, StdDeviation = 0.945] +#[Max = 17.232, Total count = 29984] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 44996 requests in 30.00s, 5.54MB read + Socket errors: connect 0, read 26, write 0, timeout 0 +Requests/sec: 1499.86 +Transfer/sec: 189.00KB \ No newline at end of file diff --git a/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/wrk/stage5/put-700rps-1t.txt b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/wrk/stage5/put-700rps-1t.txt new file mode 100644 index 000000000..b4f49455b --- /dev/null +++ b/src/main/java/ru/vk/itmo/test/pavelemelyanov/statistic/wrk/stage5/put-700rps-1t.txt @@ -0,0 +1,98 @@ +Running 30s test @ http://localhost:8080 + 1 threads and 2 connections + Thread calibration: mean lat.: 1.991ms, rate sampling interval: 10ms + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.99ms 2.20ms 28.14ms 96.08% + Req/Sec 738.26 120.07 1.78k 80.66% + Latency Distribution (HdrHistogram - Recorded Latency) + 50.000% 1.60ms + 75.000% 2.05ms + 90.000% 2.71ms + 99.000% 14.85ms + 99.900% 23.15ms + 99.990% 27.69ms + 99.999% 28.16ms +100.000% 28.16ms + + Detailed Percentile spectrum: + Value Percentile TotalCount 1/(1-Percentile) + + 0.295 0.000000 1 1.00 + 0.877 0.100000 1400 1.11 + 1.130 0.200000 2806 1.25 + 1.302 0.300000 4204 1.43 + 1.451 0.400000 5604 1.67 + 1.603 0.500000 6997 2.00 + 1.687 0.550000 7701 2.22 + 1.767 0.600000 8402 2.50 + 1.851 0.650000 9101 2.86 + 1.944 0.700000 9800 3.33 + 2.051 0.750000 10499 4.00 + 2.119 0.775000 10849 4.44 + 2.195 0.800000 11197 5.00 + 2.285 0.825000 11548 5.71 + 2.399 0.850000 11899 6.67 + 2.533 0.875000 12243 8.00 + 2.615 0.887500 12419 8.89 + 2.715 0.900000 12592 10.00 + 2.847 0.912500 12768 11.43 + 3.037 0.925000 12942 13.33 + 3.251 0.937500 13118 16.00 + 3.391 0.943750 13205 17.78 + 3.607 0.950000 13292 20.00 + 3.897 0.956250 13379 22.86 + 4.347 0.962500 13467 26.67 + 5.247 0.968750 13554 32.00 + 5.739 0.971875 13598 35.56 + 6.483 0.975000 13642 40.00 + 7.575 0.978125 13685 45.71 + 8.927 0.981250 13729 53.33 + 10.575 0.984375 13774 64.00 + 11.487 0.985938 13795 71.11 + 12.807 0.987500 13817 80.00 + 13.927 0.989062 13838 91.43 + 15.455 0.990625 13860 106.67 + 16.911 0.992188 13882 128.00 + 17.519 0.992969 13894 142.22 + 18.047 0.993750 13904 160.00 + 18.735 0.994531 13915 182.86 + 19.663 0.995313 13926 213.33 + 20.159 0.996094 13937 256.00 + 20.447 0.996484 13942 284.44 + 20.879 0.996875 13948 320.00 + 21.103 0.997266 13953 365.71 + 21.519 0.997656 13959 426.67 + 21.807 0.998047 13964 512.00 + 21.983 0.998242 13967 568.89 + 22.111 0.998437 13970 640.00 + 22.223 0.998633 13972 731.43 + 22.735 0.998828 13975 853.33 + 23.295 0.999023 13978 1024.00 + 23.327 0.999121 13979 1137.78 + 23.839 0.999219 13981 1280.00 + 24.207 0.999316 13983 1462.86 + 24.207 0.999414 13983 1706.67 + 25.247 0.999512 13985 2048.00 + 25.247 0.999561 13985 2275.56 + 25.775 0.999609 13986 2560.00 + 26.751 0.999658 13987 2925.71 + 26.751 0.999707 13987 3413.33 + 26.799 0.999756 13988 4096.00 + 26.799 0.999780 13988 4551.11 + 27.087 0.999805 13989 5120.00 + 27.087 0.999829 13989 5851.43 + 27.087 0.999854 13989 6826.67 + 27.695 0.999878 13990 8192.00 + 27.695 0.999890 13990 9102.22 + 27.695 0.999902 13990 10240.00 + 27.695 0.999915 13990 11702.86 + 27.695 0.999927 13990 13653.33 + 28.159 0.999939 13991 16384.00 + 28.159 1.000000 13991 inf +#[Mean = 1.994, StdDeviation = 2.197] +#[Max = 28.144, Total count = 13991] +#[Buckets = 27, SubBuckets = 2048] +---------------------------------------------------------- + 20998 requests in 30.00s, 1.34MB read +Requests/sec: 699.92 +Transfer/sec: 45.81KB