Radim Kolář
Radim Kolář

Reputation: 433

why is lift framework so slow?

I am learning Lift framework. I used project template from git://github.com/lift/lift_25_sbt.git and started server with container:start sbt command.

This template application displays just simple menu. If i use ab from apache to measure performance, its pretty bad. I am missing something fundamental to improve performance?

C:\Program Files\Apache Software Foundation\httpd-2.0.64\Apache2\bin>ab -n 30 -c
 10 http://127.0.0.1:8080/
Benchmarking 127.0.0.1 (be patient).....done

Server Software:        Jetty(8.1.7.v20120910)
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /
Document Length:        2877 bytes

Concurrency Level:      10
Time taken for tests:   8.15625 seconds
Complete requests:      30
Failed requests:        0
Write errors:           0
Total transferred:      96275 bytes
HTML transferred:       86310 bytes
Requests per second:    3.74 [#/sec] (mean)
Time per request:       2671.875 [ms] (mean)
Time per request:       267.188 [ms] (mean, across all concurrent requests)
Transfer rate:          11.73 [Kbytes/sec] received

Upvotes: 2

Views: 620

Answers (2)

VasiliNovikov
VasiliNovikov

Reputation: 10286

  • as mentioned earlier, you should run Lift in production mode. This is the main key to get good performance. All templates are cached this way, and other optimizations apply.
  • if you want to measure something not abstract and theoretical, then you should give the JVM time to "warm up", apply it's JIT optimizations. So, you should apply ~thousand requests first and totally ignore them (must be a couple of seconds). After that, measure the real performance of an already-started server
  • there are some slight JVM optimizations, altrough they seem more like a hack to me, and give a boost not more than around 20%
  • other small hacks include serving static content with nginx, starting the application in a dedicated server instead of Simple Build Tool and such.

Upvotes: 1

Arg
Arg

Reputation: 1916

Are you running it in production mode? I found i had like 30 rps in devel, but over 250 in production mode. ( https://www.assembla.com/spaces/liftweb/wiki/Run_Modes )

Upvotes: 2

Related Questions