Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] It takes ~30 secs for Jetty 9 to process 3rd (and N web request)

Joakim... 
I appreciate your response & time you have taken to look into this. 
Updating to Java v1.7.0_76 from v1.7.0_04 made the current scenario behave as expected (ie.: no mysterious delays)

Regards

On Wed, Mar 11, 2015 at 2:12 PM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
I would highly recommend upgrading your version of Java.  1.7.0_04 is very old.

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 <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Wed, Mar 11, 2015 at 10:08 AM, Alexander Zagniotov <azagniotov@xxxxxxxxx> 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
jetty-users@xxxxxxxxxxx
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
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users



--
Sincerely,
Alexander Zagniotov

LinkedIn: http://linkedin.com/in/AlexanderZagniotov
Twitter: http://twitter.com/AlexZagniotov
Blog: https://medium.com/@AlexZagniotov
About.Me: http://about.me/AlexZagniotov

Sent from my Mac Computer Hardware Pro

Back to the top