# Question about persisten connections to REST port

**URL:** <https://discuss.elastic.co/t/question-about-persisten-connections-to-rest-port/37076>\
**Category:** Elasticsearch\
**Created:** [December 13, 2015, 11:00pm UTC](https://discuss.elastic.co/t/question-about-persisten-connections-to-rest-port/37076 "2015-12-13T23:00:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cterron](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cterron](https://discuss.elastic.co/u/cterron)\
**Post date:** [December 13, 2015, 11:00pm UTC](https://discuss.elastic.co/t/question-about-persisten-connections-to-rest-port/37076/1 "2015-12-13T23:00:32Z")

</div>

Hi

I'm running several tests against a Elasticsearch 2.1. I created five indexes with one shard each one and start to insert in http//IP:9200/\_bulk API point. I'm using a python client using the request module , inserting 100 docs each request. Well, system performs well (from the return JSON I see the took key about 90 100 ms). I hit the ctrl-c and start again the test. Drop the indexes and start to insert the same events ... well, after this, I see that the time to insert multiply by 10. With the same script and the same date.

I check the "hot threads" and see these stacktrace:

root@elasticnew:/etc/elasticsearch# curl -XGET '172.31.2.191:9200/\_nodes/hot\_threads?threads=3&type=wait'  
::: {Luchino Nefaria}{uH0reNQjSpKuvg2ux0FZvA}{172.31.2.191}{172.31.2.191:9300}  
Hot threads at 2015-12-13T22:41:16.744Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:

```
0.0% (0s out of 500ms) wait usage by thread 'elasticsearch[keepAlive/2.1.0]'
 10/10 snapshots sharing following 8 elements
   sun.misc.Unsafe.park(Native Method)
   java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
   java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
   java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:997)
   java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)
   java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)
   org.elasticsearch.bootstrap.Bootstrap$1.run(Bootstrap.java:68)
   java.lang.Thread.run(Thread.java:745)

```

root@elasticnew:/etc/elasticsearch#

I don't know why the second time the system slowdown .... :?

The script I'm using is [genloadindexes.py](https://github.com/cterron/elasticsearch-scripts/blob/master/benchmark/genloadindexes.py).  
I launch it with  
./genloadindexes.py [http://IP:9200/](http://IP:9200/) 1M.events 5

First time, each insert request is fine. But If I stop and start to insert the same data ... the system slows ...

---

<div class="post-metadata">

**Author:** ![cterron](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cterron](https://discuss.elastic.co/u/cterron)\
**Post date:** [December 14, 2015, 9:26am UTC](https://discuss.elastic.co/t/question-about-persisten-connections-to-rest-port/37076/2 "2015-12-14T09:26:31Z")

</div>

Well, the problem is that I create / delete the index with the **same name in my test**. Then, the system slow downs.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 14, 2015, 9:39am UTC](https://discuss.elastic.co/t/question-about-persisten-connections-to-rest-port/37076/3 "2015-12-14T09:39:18Z")

</div>

Known issue, see [https://github.com/elastic/elasticsearch/issues/15225](https://github.com/elastic/elasticsearch/issues/15225)

---

<div class="post-metadata">

**Author:** ![cterron](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cterron](https://discuss.elastic.co/u/cterron)\
**Post date:** [December 14, 2015, 9:56am UTC](https://discuss.elastic.co/t/question-about-persisten-connections-to-rest-port/37076/4 "2015-12-14T09:56:55Z")

</div>

Thanks for the reference Jörg

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:31pm UTC](https://discuss.elastic.co/t/question-about-persisten-connections-to-rest-port/37076/5 "2017-07-05T23:31:20Z")

</div>


