简体   繁体   中英

Play Framework high latency

I created an web application using struts2, hibernate with mysql. I migrated to play framework so now I have two instance of the application one written in play the other with struts2. I can see a drastic performance boost with play, however when I use JMeter to simulate load the struts2 version scales alot better with lower latency than play. Why is this and does this mean its better to stick with struts2? The webapp(I am testing from localhost, both application have identical code except the template language, struts2 running on tomcat7 while play running on the build in standalone server)

         Struts 2 Version

    Start time      Tread Name              Label          time(ms)  Status     Bytes   Latency
1   10:24:49.854    videovixx struts2 1-6   HTTP Request     981     Success    9116    6
2   10:24:49.830    videovixx struts2 1-5   HTTP Request    1101     Success    9116    16
3   10:24:49.780    videovixx struts2 1-3   HTTP Request    1264     Success    9116    2
4   10:24:49.774    videovixx struts2 1-2   HTTP Request    1309     Success    9116    15
5   10:24:49.741    videovixx struts2 1-1   HTTP Request    1509     Success    9116    10
6   10:24:49.868    videovixx struts2 1-7   HTTP Request    1513     Success    9116    43
7   10:24:49.933    videovixx struts2 1-10  HTTP Request    1471     Success    9116    5
8   10:24:50.294    videovixx struts2 1-27  HTTP Request    1156     Success    9116    134
9   10:24:50.037    videovixx struts2 1-15  HTTP Request    1503     Success    9116    68
10  10:24:49.950    videovixx struts2 1-11  HTTP Request    1608     Success    9116    18

 Play Version
    Start time      Tread Name              Label        time(ms)  Status     Bytes   Latency
1   10:24:49.809    videovixx play 2-1  HTTP Request     881    Success     13016   881
2   10:24:49.803    videovixx play 2-2  HTTP Request    1562    Success     13016   1562
3   10:24:49.839    videovixx play 2-3  HTTP Request    2146    Success     13016   2146
4   10:24:49.920    videovixx play 2-7  HTTP Request    2065    Success     13016   2065
5   10:24:50.080    videovixx play 2-15 HTTP Request    1905    Success     13016   1905
6   10:24:50.242    videovixx play 2-23 HTTP Request    1743    Success     13016   1743
7   10:24:50.493    videovixx play 2-36 HTTP Request    1492    Success      13016  1492
8   10:24:50.570    videovixx play 2-39 HTTP Request    1619    Success      13016  1619
9   10:24:50.646    videovixx play 2-43 HTTP Request    1571    Success      13016  1571

  13016 2105

You need to configure the threading model according to the profile of your application. More specifically your application seems highly synchronous. The documentation suggests the following configuration :

play {
  akka {
    event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
    loglevel = WARNING
    actor {
      default-dispatcher = {
        fork-join-executor {
          parallelism-min = 300
          parallelism-max = 300
        }
      }
    }
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM