I would highly recommend upgrading your version of Java.  1.7.0_04 is very
old.
(for example: 7u21 expired in July 18, 2013
<http://www.oracle.com/technetwork/java/javase/7u21-relnotes-1932873.html>)

I don't have access to OSX Lion (which is also very old)
But your code works as-is, with no issues on other systems (tested on OSX
10.10, Linux, and Windows 8, using Java 7u75)

$ ab -n 100000 -c 20 http://localhost:8080/
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests


Server Software:        Jetty(9.2.9.v20150224)
Server Hostname:        localhost
Server Port:            8080

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      20
Time taken for tests:   8.370 seconds
Complete requests:      100000
Failed requests:        0
Total transferred:      10000000 bytes
HTML transferred:       1200000 bytes
Requests per second:    11948.08 [#/sec] (mean)
Time per request:       1.674 [ms] (mean)
Time per request:       0.084 [ms] (mean, across all concurrent requests)
Transfer rate:          1166.80 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   0.4      1      11
Processing:     0    1   0.9      1      23
Waiting:        0    1   0.9      1      23
Total:          0    2   1.1      1      24

Percentage of the requests served within a certain time (ms)
  50%      1
  66%      2
  75%      2
  80%      2
  90%      2
  95%      2
  98%      4
  99%      6
 100%     24 (longest request)

$


--
Joakim Erdfelt <[email protected]>
webtide.com <http://www.webtide.com/> - intalio.com/jetty
Expert advice, services and support from from the Jetty & CometD experts
eclipse.org/jetty - cometd.org

On Wed, Mar 11, 2015 at 10:08 AM, Alexander Zagniotov <[email protected]>
wrote:

> Hello Team...
>
> I have created a simple example that embeds Jetty 9 and responds with
> "Hello World!" upon HTTP request. Please refer to the
> following Gist containing jetty embedding & handler code:
> https://gist.github.com/azagniotov/6c8cc6d390b4cba32eb5
>
> My problem is that it takes ~30 secs for Jetty to process 3rd (and N web
> request).
>
> Steps to produce the problem:
> =======================
> When I browse to http://localhost:8080 for the first time, I get the
> expected response "Hello World!". After a second or two, when I refresh
> using cmmd+r, I also get the expected response. When I refresh the page for
> the second time (again after a second or two using cmmd+r), the response is
> pending and it takes nearly 25-30 seconds to get back the expected response
> (I was inspecting Network tab in Chrome's Developer Tools). Please refer to
> the following Gist containing Jetty startup log and logs from the first 3
> requests after startup:
> https://gist.github.com/azagniotov/100ca501b892ab3db05e
>
> I can recreate this scenario every time upon Jetty startup and while jetty
> is running (2nd or 3rd refresh response takes 25-30 secs to render). I know
> that 30 secs is the default idle timeout for Jetty, I am not sure whether
> it is related. That said, I tried to lower the default idle time to 100
> milliseconds and I could not replicate this scenario anymore.
>
> Can you please advise?
>
> My env:
> = Jetty v9.2.9.v20150224
> = Java(TM) SE Runtime Environment (build 1.7.0_04-b21)
>    Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
> = Chrome v41.0.2272.89 (64-bit)
> = Mac OS X Lion 10.7.5 (11G63)
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to