# ElasticSearch web application too slow

**URL:** <https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211>\
**Category:** Elasticsearch\
**Created:** [June 25, 2012, 9:14am UTC](https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211 "2012-06-25T09:14:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harsh](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@Harsh](https://discuss.elastic.co/u/Harsh)\
**Post date:** [June 25, 2012, 9:14am UTC](https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211/1 "2012-06-25T09:14:32Z")

</div>

Hello,  
I have developed a small sample web application implementing the search  
feature of elasticsearch. The index which is searched upon is only 60 kb.  
When I run the application it takes 30 seconds to display the search  
results. Can anyone suggest a way to improve the performance? Any help in  
this matter would be appreciated.

Thank you

---

<div class="post-metadata">

**Author:** ![jagdeep](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jagdeep](https://discuss.elastic.co/u/jagdeep)\
**Post date:** [June 25, 2012, 9:55am UTC](https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211/2 "2012-06-25T09:55:51Z")

</div>

Please post your configuration details and query.

On Jun 25, 2:14 pm, Harsh [harsh.chhatw...@gmail.com](mailto:harsh.chhatw...@gmail.com) wrote:

> Hello,  
> I have developed a small sample web application implementing the search  
> feature of elasticsearch. The index which is searched upon is only 60 kb.  
> When I run the application it takes 30 seconds to display the search  
> results. Can anyone suggest a way to improve the performance? Any help in  
> this matter would be appreciated.
> 
> Thank you

---

<div class="post-metadata">

**Author:** ![Harsh](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@Harsh](https://discuss.elastic.co/u/Harsh)\
**Post date:** [June 25, 2012, 10:57am UTC](https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211/3 "2012-06-25T10:57:39Z")

</div>

Well using a logger I figured out that the execution waits at the following  
statement for 30 seconds

client.admin().cluster().prepareHealth().setWaitForYellowStatus()  
.execute().actionGet();

Also it seems that this is because of the "setWaitForYellowStatus()". Any  
suggestions on how to work on it now as in to avoid this wait of 30  
seconds??

Thank you

On Mon, Jun 25, 2012 at 3:25 PM, jagdeep [reach.jagdeep@gmail.com](mailto:reach.jagdeep@gmail.com) wrote:

> Please post your configuration details and query.
> 
> On Jun 25, 2:14 pm, Harsh [harsh.chhatw...@gmail.com](mailto:harsh.chhatw...@gmail.com) wrote:
> 
> > Hello,  
> > I have developed a small sample web application implementing the search  
> > feature of elasticsearch. The index which is searched upon is only 60 kb.  
> > When I run the application it takes 30 seconds to display the search  
> > results. Can anyone suggest a way to improve the performance? Any help in  
> > this matter would be appreciated.
> > 
> > Thank you

--  
Harsh Chhatwani  
3rd year student  
M.Sc(Hons.)Maths with B.E(Hons.)Computer Science  
BITS Pilani  
Rajasthan(333031)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 25, 2012, 11:53am UTC](https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211/4 "2012-06-25T11:53:50Z")

</div>

Are you sure your client actually connects to the cluster? It probably  
doesn't, thats why it doesn't get to the yellow status.

On Mon, Jun 25, 2012 at 12:57 PM, Harsh Chhatwani \<[harsh.chhatwani@gmail.com](mailto:harsh.chhatwani@gmail.com)

> wrote:

> Well using a logger I figured out that the execution waits at the  
> following statement for 30 seconds
> 
> client.admin().cluster().prepareHealth().setWaitForYellowStatus()  
> .execute().actionGet();
> 
> Also it seems that this is because of the "setWaitForYellowStatus()". Any  
> suggestions on how to work on it now as in to avoid this wait of 30  
> seconds??
> 
> Thank you
> 
> On Mon, Jun 25, 2012 at 3:25 PM, jagdeep [reach.jagdeep@gmail.com](mailto:reach.jagdeep@gmail.com) wrote:
> 
> > Please post your configuration details and query.
> > 
> > On Jun 25, 2:14 pm, Harsh [harsh.chhatw...@gmail.com](mailto:harsh.chhatw...@gmail.com) wrote:
> > 
> > > Hello,  
> > > I have developed a small sample web application implementing the search  
> > > feature of elasticsearch. The index which is searched upon is only 60  
> > > kb.  
> > > When I run the application it takes 30 seconds to display the search  
> > > results. Can anyone suggest a way to improve the performance? Any help  
> > > in  
> > > this matter would be appreciated.
> > > 
> > > Thank you
> 
> --  
> Harsh Chhatwani  
> 3rd year student  
> M.Sc(Hons.)Maths with B.E(Hons.)Computer Science  
> BITS Pilani  
> Rajasthan(333031)

---

<div class="post-metadata">

**Author:** ![Harsh](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@Harsh](https://discuss.elastic.co/u/Harsh)\
**Post date:** [June 25, 2012, 12:21pm UTC](https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211/5 "2012-06-25T12:21:33Z")

</div>

Well the problem is solved, I just changed the timeout value to 1 second  
and it gives the result immediately, it was previously set to 30 seconds.

On Mon, Jun 25, 2012 at 5:23 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Are you sure your client actually connects to the cluster? It probably  
> doesn't, thats why it doesn't get to the yellow status.
> 
> On Mon, Jun 25, 2012 at 12:57 PM, Harsh Chhatwani \<  
> [harsh.chhatwani@gmail.com](mailto:harsh.chhatwani@gmail.com)\> wrote:
> 
> > Well using a logger I figured out that the execution waits at the  
> > following statement for 30 seconds
> > 
> > client.admin().cluster().prepareHealth().setWaitForYellowStatus()  
> > .execute().actionGet();
> > 
> > Also it seems that this is because of the "setWaitForYellowStatus()". Any  
> > suggestions on how to work on it now as in to avoid this wait of 30  
> > seconds??
> > 
> > Thank you
> > 
> > On Mon, Jun 25, 2012 at 3:25 PM, jagdeep [reach.jagdeep@gmail.com](mailto:reach.jagdeep@gmail.com) wrote:
> > 
> > > Please post your configuration details and query.
> > > 
> > > On Jun 25, 2:14 pm, Harsh [harsh.chhatw...@gmail.com](mailto:harsh.chhatw...@gmail.com) wrote:
> > > 
> > > > Hello,  
> > > > I have developed a small sample web application implementing the search  
> > > > feature of elasticsearch. The index which is searched upon is only 60  
> > > > kb.  
> > > > When I run the application it takes 30 seconds to display the search  
> > > > results. Can anyone suggest a way to improve the performance? Any help  
> > > > in  
> > > > this matter would be appreciated.
> > > > 
> > > > Thank you
> > 
> > --  
> > Harsh Chhatwani  
> > 3rd year student  
> > M.Sc(Hons.)Maths with B.E(Hons.)Computer Science  
> > BITS Pilani  
> > Rajasthan(333031)

--  
Harsh Chhatwani  
3rd year student  
M.Sc(Hons.)Maths with B.E(Hons.)Computer Science  
BITS Pilani  
Rajasthan(333031)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 25, 2012, 12:43pm UTC](https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211/6 "2012-06-25T12:43:55Z")

</div>

Thats the wrong way to solve the problem, in general, you don't need to  
check on each request for yellow status, the search response will include  
what worked and what not. And if the cluster is not in yellow status,  
something is wrong.

On Mon, Jun 25, 2012 at 2:21 PM, Harsh Chhatwani  
[harsh.chhatwani@gmail.com](mailto:harsh.chhatwani@gmail.com)wrote:

> Well the problem is solved, I just changed the timeout value to 1 second  
> and it gives the result immediately, it was previously set to 30 seconds.
> 
> On Mon, Jun 25, 2012 at 5:23 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > Are you sure your client actually connects to the cluster? It probably  
> > doesn't, thats why it doesn't get to the yellow status.
> > 
> > On Mon, Jun 25, 2012 at 12:57 PM, Harsh Chhatwani \<  
> > [harsh.chhatwani@gmail.com](mailto:harsh.chhatwani@gmail.com)\> wrote:
> > 
> > > Well using a logger I figured out that the execution waits at the  
> > > following statement for 30 seconds
> > > 
> > > client.admin().cluster().prepareHealth().setWaitForYellowStatus()  
> > > .execute().actionGet();
> > > 
> > > Also it seems that this is because of the "setWaitForYellowStatus()".  
> > > Any suggestions on how to work on it now as in to avoid this wait of 30  
> > > seconds??
> > > 
> > > Thank you
> > > 
> > > On Mon, Jun 25, 2012 at 3:25 PM, jagdeep [reach.jagdeep@gmail.com](mailto:reach.jagdeep@gmail.com)wrote:
> > > 
> > > > Please post your configuration details and query.
> > > > 
> > > > On Jun 25, 2:14 pm, Harsh [harsh.chhatw...@gmail.com](mailto:harsh.chhatw...@gmail.com) wrote:
> > > > 
> > > > > Hello,  
> > > > > I have developed a small sample web application implementing the  
> > > > > search  
> > > > > feature of elasticsearch. The index which is searched upon is only 60  
> > > > > kb.  
> > > > > When I run the application it takes 30 seconds to display the search  
> > > > > results. Can anyone suggest a way to improve the performance? Any  
> > > > > help in  
> > > > > this matter would be appreciated.
> > > > > 
> > > > > Thank you
> > > 
> > > --  
> > > Harsh Chhatwani  
> > > 3rd year student  
> > > M.Sc(Hons.)Maths with B.E(Hons.)Computer Science  
> > > BITS Pilani  
> > > Rajasthan(333031)
> 
> --  
> Harsh Chhatwani  
> 3rd year student  
> M.Sc(Hons.)Maths with B.E(Hons.)Computer Science  
> BITS Pilani  
> Rajasthan(333031)

---

<div class="post-metadata">

**Author:** ![Harsh](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@Harsh](https://discuss.elastic.co/u/Harsh)\
**Post date:** [June 25, 2012, 2:31pm UTC](https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211/7 "2012-06-25T14:31:04Z")

</div>

Correct me if I am wrong. So you mean I should not change the time out  
value right?  
Well that will again lead to the application to wait for 30 seconds before  
it can go further to the creation of queryBuilder object later followed by  
search response.

How do you suggest to work on it?

Thank you

On Mon, Jun 25, 2012 at 6:13 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Thats the wrong way to solve the problem, in general, you don't need to  
> check on each request for yellow status, the search response will include  
> what worked and what not. And if the cluster is not in yellow status,  
> something is wrong.
> 
> On Mon, Jun 25, 2012 at 2:21 PM, Harsh Chhatwani \<  
> [harsh.chhatwani@gmail.com](mailto:harsh.chhatwani@gmail.com)\> wrote:
> 
> > Well the problem is solved, I just changed the timeout value to 1 second  
> > and it gives the result immediately, it was previously set to 30 seconds.
> > 
> > On Mon, Jun 25, 2012 at 5:23 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > 
> > > Are you sure your client actually connects to the cluster? It probably  
> > > doesn't, thats why it doesn't get to the yellow status.
> > > 
> > > On Mon, Jun 25, 2012 at 12:57 PM, Harsh Chhatwani \<  
> > > [harsh.chhatwani@gmail.com](mailto:harsh.chhatwani@gmail.com)\> wrote:
> > > 
> > > > Well using a logger I figured out that the execution waits at the  
> > > > following statement for 30 seconds
> > > > 
> > > > client.admin().cluster().prepareHealth().setWaitForYellowStatus()  
> > > > .execute().actionGet();
> > > > 
> > > > Also it seems that this is because of the "setWaitForYellowStatus()".  
> > > > Any suggestions on how to work on it now as in to avoid this wait of 30  
> > > > seconds??
> > > > 
> > > > Thank you
> > > > 
> > > > On Mon, Jun 25, 2012 at 3:25 PM, jagdeep [reach.jagdeep@gmail.com](mailto:reach.jagdeep@gmail.com)wrote:
> > > > 
> > > > > Please post your configuration details and query.
> > > > > 
> > > > > On Jun 25, 2:14 pm, Harsh [harsh.chhatw...@gmail.com](mailto:harsh.chhatw...@gmail.com) wrote:
> > > > > 
> > > > > > Hello,  
> > > > > > I have developed a small sample web application implementing the  
> > > > > > search  
> > > > > > feature of elasticsearch. The index which is searched upon is only  
> > > > > > 60 kb.  
> > > > > > When I run the application it takes 30 seconds to display the search  
> > > > > > results. Can anyone suggest a way to improve the performance? Any  
> > > > > > help in  
> > > > > > this matter would be appreciated.
> > > > > > 
> > > > > > Thank you
> > > > 
> > > > --  
> > > > Harsh Chhatwani  
> > > > 3rd year student  
> > > > M.Sc(Hons.)Maths with B.E(Hons.)Computer Science  
> > > > BITS Pilani  
> > > > Rajasthan(333031)
> > 
> > --  
> > Harsh Chhatwani  
> > 3rd year student  
> > M.Sc(Hons.)Maths with B.E(Hons.)Computer Science  
> > BITS Pilani  
> > Rajasthan(333031)

--  
Harsh Chhatwani  
3rd year student  
M.Sc(Hons.)Maths with B.E(Hons.)Computer Science  
BITS Pilani  
Rajasthan(333031)

---

<div class="post-metadata">

**Author:** ![Harsh](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@Harsh](https://discuss.elastic.co/u/Harsh)\
**Post date:** [June 26, 2012, 6:35am UTC](https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211/8 "2012-06-26T06:35:56Z")

</div>

Hello,

I checked the logs and you're right, the client is unable to connect to the  
cluster. Can you please suggest how to solve that?

Thankyou

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 26, 2012, 6:48am UTC](https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211/9 "2012-06-26T06:48:11Z")

</div>

Check your setup.  
Curl to [http://yournode:9200/](http://yournode:9200/) from your webapp server.

Check firewall rules on your nodes (9200-9299/9300-9399).

David 😉  
Twitter : @dadoonet / @elasticsearchfr

Le 26 juin 2012 à 08:35, Harsh Chhatwani [harsh.chhatwani@gmail.com](mailto:harsh.chhatwani@gmail.com) a écrit :

> Hello,
> 
> I checked the logs and you're right, the client is unable to connect to the cluster. Can you please suggest how to solve that?
> 
> Thankyou

---

<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 6, 2017, 3:22am UTC](https://discuss.elastic.co/t/elasticsearch-web-application-too-slow/8211/10 "2017-07-06T03:22:33Z")

</div>


