Play Framework高延迟

时间:2013-02-11 15:42:00

标签: java performance hibernate struts2 playframework-2.0

我使用struts2创建了一个web应用程序,使用mysql创建了hibernate。我迁移到播放框架,所以现在我有两个应用程序实例,其中一个用struts2编写。我可以看到游戏的性能大幅提升,但是当我使用JMeter来模拟加载时,struts2版本的缩放比使用更低的延迟更好。为什么这样,这是否意味着坚持使用struts2更好? webapp(我从localhost测试,两个应用程序都有相同的代码,除了模板语言,struts2在tomcat7上运行,而在独立服务器上运行时运行)

         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

1 个答案:

答案 0 :(得分:0)

您需要根据应用程序的配置文件配置线程模型。更具体地说,您的应用程documentation建议采用以下配置:

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