jersey
  1. jersey
  2. JERSEY-2002

Jersey 2.x has less than 10x performance compared to 1.7.1

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.4
    • Component/s: core
    • Labels:
      None
    • Environment:

      Ubuntu 12.04 java 1.70_25

      Description

      Old configuration:
      "com.sun.jersey" % "jersey-core" % "1.17.1",
      "com.sun.jersey" % "jersey-server" % "1.17.1",
      "com.sun.jersey" % "jersey-grizzly2" % "1.17.1"

      New configuration:
      "org.glassfish.jersey.containers" % "jersey-container-grizzly2-http" % "2.0",
      "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.0"

      For following rest resource

      package org.bench.rest                                                                                                                 
                                                                                                                                                      
      import javax.ws.rs.GET                                                                                                                          
      import javax.ws.rs.Path                                                                                                                         
                                                                                                                                                      
      @Path("/ping")                                                                                                                                  
      class PingPong {                                                                                                                                
                                                                                                                                                      
        @GET                                                                                                                                          
        def pong = "pong"                                                                                                                             
                                                                                                                                                      
      }
      

      Server is created using the usual ServerFactory method and benchmarked using wrk.
      Benchmarked using two machines one serving resources other running wrk.
      Processor i3, memory 4g

      1.7.1 performance:

      % ./wrk -t12 -c256 -d30s http://169.254.10.190:9999/ping
      Running 30s test @ http://169.254.10.190:9999/ping
        12 threads and 256 connections
        Thread Stats   Avg      Stdev     Max   ± Stdev
          Latency     3.44ms    6.64ms 283.34ms   95.08%
          Req/Sec     6.62k     1.22k   15.00k    74.44%
        2253249 requests in 30.00s, 266.62MB read
      Requests/sec:  75114.77
      Transfer/sec:      8.89MB 
      

      2.x performance:

      % ./wrk -t12 -c256 -d30s http://169.254.10.190:9999/ping
      Running 30s test @ http://169.254.10.190:9999/ping
        12 threads and 256 connections
        Thread Stats   Avg      Stdev     Max   ± Stdev
          Latency    45.09ms   14.37ms 153.63ms   78.27%
          Req/Sec   490.59     96.81   735.00     76.91%
        172721 requests in 30.00s, 17.30MB read
      Requests/sec:   5757.37
      Transfer/sec:    590.67KB 
      

        Issue Links

          Activity

          Hide
          Matt Hauck added a comment -

          Okay, actually, I think most of the badness is in the spring3 module. I realized shortly after I commented here that I was running my tomcat server w/ jprofiler enabled. =P

          However, the reason I turned on jprofiler was because the performance was really quite bad with the spring3 module in place. Using my own spring integration has helped out much actually, and on 2.6 I'm getting pretty good numbers down in the teens and low tens of milliseconds.

          Good news. =)

          Show
          Matt Hauck added a comment - Okay, actually, I think most of the badness is in the spring3 module. I realized shortly after I commented here that I was running my tomcat server w/ jprofiler enabled. =P However, the reason I turned on jprofiler was because the performance was really quite bad with the spring3 module in place. Using my own spring integration has helped out much actually, and on 2.6 I'm getting pretty good numbers down in the teens and low tens of milliseconds. Good news. =)
          Hide
          message added a comment - - edited

          Jakub Podlesak can you please rerun benchmark once again with latest versions? 1.18.1 vs 2.10.1

          Show
          message added a comment - - edited Jakub Podlesak can you please rerun benchmark once again with latest versions? 1.18.1 vs 2.10.1
          Hide
          Michael Osipov added a comment -

          Matt Hauck, please share your Spring module improvements!

          Show
          Michael Osipov added a comment - Matt Hauck , please share your Spring module improvements!
          Hide
          Jakub Podlesak added a comment -

          Matt, i totally missed your earlier comments on Spring. Could you please file a separate issue to track this?
          It would be great if you could share your code improvements. Would you be willing to contribute your fix to the Jersey project?

          Show
          Jakub Podlesak added a comment - Matt, i totally missed your earlier comments on Spring. Could you please file a separate issue to track this? It would be great if you could share your code improvements. Would you be willing to contribute your fix to the Jersey project?
          Hide
          Matt Hauck added a comment -
          Show
          Matt Hauck added a comment - ok. filed: https://java.net/jira/browse/JERSEY-2578

            People

            • Assignee:
              Jakub Podlesak
              Reporter:
              kul
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 22 hours
                3d 22h