Thank you for jumping in.
Per a suggestion from one of our sysadmins, I added a variant that uses wait_for_active_shards: 0 and I changed the delete command to use the persisted client. I'm also doing 30s runs now to get more meaningful timings.
Here are the results for 5.6.16.
Docker command:
docker run --rm -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "bootstrap.memory_lock=true" -e "xpack.security.enabled=false" --ulimit "memlock=-1:-1" -e ES_JAVA_OPTS="-Xms4g -Xmx4g" docker.elastic.co/elasticsearch/elasticsearch:5.6.16
Results of three runs
First:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 1.965 (± 0.0%) i/s - 59.000 in 30.475732s
20 indices wait:0 2.452 (± 0.0%) i/s - 74.000 in 30.352599s
Comparison:
20 indices wait:0: 2.5 i/s
create 20 indices: 2.0 i/s - 1.25x slower
Second:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 2.205 (± 0.0%) i/s - 66.000 in 30.036526s
20 indices wait:0 2.393 (± 0.0%) i/s - 72.000 in 30.230190s
Comparison:
20 indices wait:0: 2.4 i/s
create 20 indices: 2.2 i/s - 1.09x slower
Third:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 2.228 (± 0.0%) i/s - 67.000 in 30.178549s
20 indices wait:0 2.540 (± 0.0%) i/s - 76.000 in 30.111070s
Comparison:
20 indices wait:0: 2.5 i/s
create 20 indices: 2.2 i/s - 1.14x slower
Looking across runs both variations can create and delete 20 indices about 2 - 2.5 times a second and it stays fast for all three runs.
Here's 6.8.8
First run:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 1.018 (± 0.0%) i/s - 31.000 in 30.506013s
20 indices wait:0 1.489 (± 0.0%) i/s - 45.000 in 30.441973s
Comparison:
20 indices wait:0: 1.5 i/s
create 20 indices: 1.0 i/s - 1.46x slower
Second run:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 0.979 (± 0.0%) i/s - 30.000 in 30.788137s
20 indices wait:0 1.271 (± 0.0%) i/s - 39.000 in 30.784245s
Comparison:
20 indices wait:0: 1.3 i/s
create 20 indices: 1.0 i/s - 1.30x slower
Third run:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 0.874 (± 0.0%) i/s - 27.000 in 31.014928s
20 indices wait:0 1.046 (± 0.0%) i/s - 32.000 in 30.689844s
Comparison:
20 indices wait:0: 1.0 i/s
create 20 indices: 0.9 i/s - 1.20x slower
Each run is slightly slower than the last. On our internal test cluster we see this drag out to where each individual create request eventually takes over 1 second. We've worked around this by restarting our cluster every night, but it still means the first CI run of our test suite on any given day takes around 25 minutes and the last is closer to 40 depending on how many times we push.
Here's 7.6.2
First run:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 0.657 (± 0.0%) i/s - 20.000 in 30.473934s
20 indices wait:0 0.916 (± 0.0%) i/s - 28.000 in 30.594544s
Comparison:
20 indices wait:0: 0.9 i/s
create 20 indices: 0.7 i/s - 1.39x slower
Second:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 0.685 (± 0.0%) i/s - 21.000 in 30.717306s
20 indices wait:0 0.888 (± 0.0%) i/s - 27.000 in 30.419167s
Comparison:
20 indices wait:0: 0.9 i/s
create 20 indices: 0.7 i/s - 1.30x slower
Third:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 0.667 (± 0.0%) i/s - 20.000 in 30.033112s
20 indices wait:0 0.831 (± 0.0%) i/s - 25.000 in 30.114476s
Comparison:
20 indices wait:0: 0.8 i/s
create 20 indices: 0.7 i/s - 1.25x slower
Here the slowdown is less pronounced vs 6.8.8, but I wonder if that's because it creates so many fewer indices over time. When I restart the docker image and run it five times in a row instead of 3 I get
First:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 0.668 (± 0.0%) i/s - 20.000 in 30.046556s
20 indices wait:0 0.925 (± 0.0%) i/s - 28.000 in 30.337861s
Comparison:
20 indices wait:0: 0.9 i/s
create 20 indices: 0.7 i/s - 1.38x slower
Second:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 0.709 (± 0.0%) i/s - 22.000 in 31.067696s
20 indices wait:0 0.909 (± 0.0%) i/s - 28.000 in 30.863562s
Comparison:
20 indices wait:0: 0.9 i/s
create 20 indices: 0.7 i/s - 1.28x slower
Third:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 0.680 (± 0.0%) i/s - 21.000 in 30.910941s
20 indices wait:0 0.869 (± 0.0%) i/s - 27.000 in 31.095478s
Comparison:
20 indices wait:0: 0.9 i/s
create 20 indices: 0.7 i/s - 1.28x slower
Fourth:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 0.638 (± 0.0%) i/s - 20.000 in 31.436337s
20 indices wait:0 0.790 (± 0.0%) i/s - 24.000 in 30.394412s
Comparison:
20 indices wait:0: 0.8 i/s
create 20 indices: 0.6 i/s - 1.24x slower
Fifth:
Warming up --------------------------------------
create 20 indices 1.000 i/100ms
20 indices wait:0 1.000 i/100ms
Calculating -------------------------------------
create 20 indices 0.605 (± 0.0%) i/s - 19.000 in 31.411018s
20 indices wait:0 0.707 (± 0.0%) i/s - 22.000 in 31.182337s
Comparison:
20 indices wait:0: 0.7 i/s
create 20 indices: 0.6 i/s - 1.17x slower