[jetty-dev] Jetty Newbie ( Urgent )

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jetty-dev] Jetty Newbie ( Urgent )

Rawat
Hi All,

I am a newbie to Jetty. Unfortunately even after spending few hours of reading starting Jetty tutorials i could not find answer to my this question :

-- What should i do ? Embed Jetty or use Normal webapp ?

I want to write a simple REST webservice. But i want it to support as much traffic simultaneous traffic as possible. So i imagine several hundred requests per second and each request being served by a new thread. ( I am coming from PHP background ). Is it possible in Embedded Jetty approach ? If yes, can i tune how many threads will serve my traffic ?

Thanks alot !

_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Jetty Newbie ( Urgent )

Jesse McConnell-5
> -- What should i do ? Embed Jetty or use Normal webapp ?

either will work

> I want to write a simple REST webservice. But i want it to support as much
> traffic simultaneous traffic as possible. So i imagine several hundred
> requests per second and each request being served by a new thread. ( I am
> coming from PHP background ).

jetty has easily served many 10's of thousands of requests per second
with sub second latency

 Is it possible in Embedded Jetty approach ? If
> yes, can i tune how many threads will serve my traffic ?

both are possible with either approach, a traditional webapp or
embedded jetty.  the key is in using either jetty-continuations or the
async servlets provided in servlet-api 3.0 in order to scale

there is little need for you to tune jetty at this point in your
experience...get your app working and react as needed for performance
improvements.  most of our clients don't have to tweak the default
settings at all

cheers,

jesse
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Jetty Newbie ( Urgent )

Rawat
Hi Jesse,

Thanks for your reply. So if i use Embedded Jetty and write a simple handler ( like HelloWorld.java example). Is this HelloWorld service requests automatically executed in multiple threads ? or just a single thread for every request, by default ? Do i not have to write any piece of code to spawn different threads for different requests for the HelloWorld webservice ?

Thanks



On Wed, Jun 20, 2012 at 10:34 PM, Jesse McConnell <[hidden email]> wrote:
> -- What should i do ? Embed Jetty or use Normal webapp ?

either will work

> I want to write a simple REST webservice. But i want it to support as much
> traffic simultaneous traffic as possible. So i imagine several hundred
> requests per second and each request being served by a new thread. ( I am
> coming from PHP background ).

jetty has easily served many 10's of thousands of requests per second
with sub second latency

 Is it possible in Embedded Jetty approach ? If
> yes, can i tune how many threads will serve my traffic ?

both are possible with either approach, a traditional webapp or
embedded jetty.  the key is in using either jetty-continuations or the
async servlets provided in servlet-api 3.0 in order to scale

there is little need for you to tune jetty at this point in your
experience...get your app working and react as needed for performance
improvements.  most of our clients don't have to tweak the default
settings at all

cheers,

jesse
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev


_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Jetty Newbie ( Urgent )

Jesse McConnell-5
I would recommend you look into servlets and go from there.  Typically
you will not have to worry about thread management in regards to
requests yourself with servlets, that is managed by the container.

Jetty uses java.nio under the covers for connection management and
scaling request counts, etc

cheers,
jesse

--
Jesse McConnell <[hidden email]>
www.webtide.com – Developer advice, services and support from the
Jetty & CometD experts.


On Wed, Jun 20, 2012 at 3:47 PM, Rawat <[hidden email]> wrote:

> Hi Jesse,
>
> Thanks for your reply. So if i use Embedded Jetty and write a simple handler
> ( like HelloWorld.java example). Is this HelloWorld service requests
> automatically executed in multiple threads ? or just a single thread for
> every request, by default ? Do i not have to write any piece of code to
> spawn different threads for different requests for the HelloWorld webservice
> ?
>
> Thanks
>
>
>
> On Wed, Jun 20, 2012 at 10:34 PM, Jesse McConnell <[hidden email]> wrote:
>>
>> > -- What should i do ? Embed Jetty or use Normal webapp ?
>>
>> either will work
>>
>> > I want to write a simple REST webservice. But i want it to support as
>> > much
>> > traffic simultaneous traffic as possible. So i imagine several hundred
>> > requests per second and each request being served by a new thread. ( I
>> > am
>> > coming from PHP background ).
>>
>> jetty has easily served many 10's of thousands of requests per second
>> with sub second latency
>>
>>  Is it possible in Embedded Jetty approach ? If
>> > yes, can i tune how many threads will serve my traffic ?
>>
>> both are possible with either approach, a traditional webapp or
>> embedded jetty.  the key is in using either jetty-continuations or the
>> async servlets provided in servlet-api 3.0 in order to scale
>>
>> there is little need for you to tune jetty at this point in your
>> experience...get your app working and react as needed for performance
>> improvements.  most of our clients don't have to tweak the default
>> settings at all
>>
>> cheers,
>>
>> jesse
>> _______________________________________________
>> jetty-dev mailing list
>> [hidden email]
>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>
>
>
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Jetty Newbie ( Urgent )

Rawat
Hey Jesse,

I am looking at the easiest servlet example i could found :-)

http://www.maths.tcd.ie/~dacurran/4ict12/assignment3/

But it does not use the servlet-api 3.0 that you were suggesting. Did you mean something else ? Or i am looking at right example ?





On Wed, Jun 20, 2012 at 10:54 PM, Jesse McConnell <[hidden email]> wrote:
I would recommend you look into servlets and go from there.  Typically
you will not have to worry about thread management in regards to
requests yourself with servlets, that is managed by the container.

Jetty uses java.nio under the covers for connection management and
scaling request counts, etc

cheers,
jesse

--
Jesse McConnell <[hidden email]>
www.webtide.com – Developer advice, services and support from the
Jetty & CometD experts.


On Wed, Jun 20, 2012 at 3:47 PM, Rawat <[hidden email]> wrote:
> Hi Jesse,
>
> Thanks for your reply. So if i use Embedded Jetty and write a simple handler
> ( like HelloWorld.java example). Is this HelloWorld service requests
> automatically executed in multiple threads ? or just a single thread for
> every request, by default ? Do i not have to write any piece of code to
> spawn different threads for different requests for the HelloWorld webservice
> ?
>
> Thanks
>
>
>
> On Wed, Jun 20, 2012 at 10:34 PM, Jesse McConnell <[hidden email]> wrote:
>>
>> > -- What should i do ? Embed Jetty or use Normal webapp ?
>>
>> either will work
>>
>> > I want to write a simple REST webservice. But i want it to support as
>> > much
>> > traffic simultaneous traffic as possible. So i imagine several hundred
>> > requests per second and each request being served by a new thread. ( I
>> > am
>> > coming from PHP background ).
>>
>> jetty has easily served many 10's of thousands of requests per second
>> with sub second latency
>>
>>  Is it possible in Embedded Jetty approach ? If
>> > yes, can i tune how many threads will serve my traffic ?
>>
>> both are possible with either approach, a traditional webapp or
>> embedded jetty.  the key is in using either jetty-continuations or the
>> async servlets provided in servlet-api 3.0 in order to scale
>>
>> there is little need for you to tune jetty at this point in your
>> experience...get your app working and react as needed for performance
>> improvements.  most of our clients don't have to tweak the default
>> settings at all
>>
>> cheers,
>>
>> jesse
>> _______________________________________________
>> jetty-dev mailing list
>> [hidden email]
>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>
>
>
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev


_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev