# About Using ElasticSearch WebServer?

**URL:** <https://discuss.elastic.co/t/about-using-elasticsearch-webserver/9337>\
**Category:** Elasticsearch\
**Created:** [October 12, 2012, 1:46pm UTC](https://discuss.elastic.co/t/about-using-elasticsearch-webserver/9337 "2012-10-12T13:46:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zkidkid](https://avatars.discourse-cdn.com/v4/letter/z/fbc32d/32.png) [@zkidkid](https://discuss.elastic.co/u/zkidkid)\
**Post date:** [October 12, 2012, 1:46pm UTC](https://discuss.elastic.co/t/about-using-elasticsearch-webserver/9337/1 "2012-10-12T13:46:00Z")

</div>

Hi All,

Currently, I have my own webserver (using embeed jetty )

My webserver listen and support jsonp to return search request.

In my webserver, I use java api to connect to elastic search & return json  
value.

Today, I have a stress test and I see that Jetty will go hang when connect  
go to 1500-2000 connection per second although the ES still ok.

I stress test ES and it is alright.

I think the main difference is jetty vs netty.

So I want to building from source and using ES exist http handler. Is it  
good ?

Or I just change my jetty to netty & get searching result from java api ?

Thanks.

P/S: I need 2000 request / second (4M record)

I could have 3 server ( 24 core, 32 Gb Ram).

--

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [October 12, 2012, 3:45pm UTC](https://discuss.elastic.co/t/about-using-elasticsearch-webserver/9337/2 "2012-10-12T15:45:04Z")

</div>

I think it's reasonable to try & do!  
simon

On Friday, October 12, 2012 3:46:00 PM UTC+2, kidkid wrote:

> Hi All,
> 
> Currently, I have my own webserver (using embeed jetty )
> 
> My webserver listen and support jsonp to return search request.
> 
> In my webserver, I use java api to connect to Elasticsearch & return json  
> value.
> 
> Today, I have a stress test and I see that Jetty will go hang when connect  
> go to 1500-2000 connection per second although the ES still ok.
> 
> I stress test ES and it is alright.
> 
> I think the main difference is jetty vs netty.
> 
> So I want to building from source and using ES exist http handler. Is it  
> good ?
> 
> Or I just change my jetty to netty & get searching result from java api ?
> 
> Thanks.
> 
> P/S: I need 2000 request / second (4M record)
> 
> I could have 3 server ( 24 core, 32 Gb Ram).

--

---

<div class="post-metadata">

**Author:** ![zkidkid](https://avatars.discourse-cdn.com/v4/letter/z/fbc32d/32.png) [@zkidkid](https://discuss.elastic.co/u/zkidkid)\
**Post date:** [October 14, 2012, 8:45am UTC](https://discuss.elastic.co/t/about-using-elasticsearch-webserver/9337/3 "2012-10-14T08:45:33Z")

</div>

Hi Simmonw,

What do you mean for reasonable to try & do ?  
Jetty ?

Or Netty inside ES ?

I just recheck and found that the last problem maybe because the jetty  
couldn't spawn new native thread.

Last time, I put ES & my webserver into same server ( 32 Gb Ram + 24 core).

In my case, I expect to handle 2k request per second. Each request, I would  
wait for response from ES ( avg 100 ms) So I think my thread need to have  
is:

2000\*(100 + 20)/1000 = 240 threads.

So in jetty server I need to set minimum threads to 250 and maximum threads  
to 300. Is it ok ?

I would try to inherit the NettyHttpRequest in ES to handle my request for  
testing purpose.

I just wonder which is best in my case.  
+ #1: Using Jetty to process business logic of ajax query  
+ #2: Extend NettyHttpRequest in ES to handle request & business  
logic.

Thanks.

On Friday, October 12, 2012 10:45:04 PM UTC+7, simonw wrote:

> I think it's reasonable to try & do!  
> simon
> 
> On Friday, October 12, 2012 3:46:00 PM UTC+2, kidkid wrote:
> 
> > Hi All,
> > 
> > Currently, I have my own webserver (using embeed jetty )
> > 
> > My webserver listen and support jsonp to return search request.
> > 
> > In my webserver, I use java api to connect to Elasticsearch & return  
> > json value.
> > 
> > Today, I have a stress test and I see that Jetty will go hang when  
> > connect go to 1500-2000 connection per second although the ES still ok.
> > 
> > I stress test ES and it is alright.
> > 
> > I think the main difference is jetty vs netty.
> > 
> > So I want to building from source and using ES exist http handler. Is it  
> > good ?
> > 
> > Or I just change my jetty to netty & get searching result from java api ?
> > 
> > Thanks.
> > 
> > P/S: I need 2000 request / second (4M record)
> > 
> > I could have 3 server ( 24 core, 32 Gb Ram).

--

---

<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:08am UTC](https://discuss.elastic.co/t/about-using-elasticsearch-webserver/9337/4 "2017-07-06T03:08:55Z")

</div>


