[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-06 Thread Daniel Guryca
OK thanks for a hint ... so where can I set session lifetime in Lift ?
Setting session lifetime to 2-3 seconds should make it rock.

Daniel

On Wed, May 6, 2009 at 12:46 AM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Tue, May 5, 2009 at 3:23 PM, Daniel Guryca dun...@gmail.com wrote:

 Thank you for your benchmarking description.

 I have just tested it too.

 My results are something around 330 req/s which is superior to previous
 results. Great !

 The only problem I have encountered is that after something around 2000
 requests the whole application stalls and locks and do not respond anymore.
 It seems like some ugly dead lock or something similar.


 Daniel,

 Each request is creating a new session.  The sessions consume a certain
 amount of RAM.  Depending on the heap size for your application, you may be
 running out of memory.  A sure sign of this is a Java process running at
 100% CPU on a multi-core box (using 100% of 1 core).  This indicates that
 the JVM is thrashing about trying to release memory.

 Having 2,000 or 5,000 open sessions is not a common thing for a public
 facing app.  In practice, you'll see something more like 100-200 active
 sessions, but lots of pages served to each of those sessions.

 Thanks,

 David



 I have tried it with postgres instead of derby with similar dead-lock
 result.

 Daniel

 On Mon, May 4, 2009 at 11:16 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Daniel,

 I did a little measurement of Lift and did some tuning.  On my Core 920
 machine with 12GB of RAM running Ubuntu 9.04 and the JDK 1.6.0_13 in 64 bit
 mode with Tomcat 6.0.18 (I ran into some bugs in Jetty while measuring with
 ab).  My baseline running (both locally and across the network)

 ab -c 10 -n 2 http://yak.local:8080/user_mgt/login

 I was seeing about 1,500 pages/second.  I used YourKit to do some
 profiling and improved performance on my box to about 2,200 pages/second.
 Here are the steps I went through.  I created a new project:

 d...@yak:~/benchmark$ mvn archetype:create -U
 -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic
 -DarchetypeVersion=1.1-SNAPSHOT -DremoteRepositories=
 http://scala-tools.org/repo-snapshots   -DgroupId=com.liftcode
 -DartifactId=benchmark

 I cd'ed into benchmark and typed mvn clean install  I copied the
 target/benchmark-1.0-SNAPSHOT directory into Tomcat's webapps directory
 and renamed the directory ROOT.  I did export
 JAVA_OPTS=-Drun.mode=production to make sure Lift runs in production
 mode.  I started Tomcat with ./bin/startup.sh

 Then I ran:

 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login

 I did this and discarded the results because this will warm up the
 HotSpot compiler.  At the end of this run, the JVM should have optimized
 most of the Lift-related classes.  Next, I re-ran the command:
 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login
 This is ApacheBench, Version 2.3 $Revision: 655654 $
 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 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 Completed 12000 requests
 Completed 14000 requests
 Completed 16000 requests
 Completed 18000 requests
 Completed 2 requests
 Finished 2 requests


 Server Software:Apache-Coyote/1.1
 Server Hostname:localhost
 Server Port:8080

 Document Path:  /user_mgt/login
 Document Length:3768 bytes

 Concurrency Level:  10
 Time taken for tests:   9.156 seconds
 Complete requests:  2
 Failed requests:0
 Write errors:   0
 Total transferred:  8362 bytes
 HTML transferred:   7536 bytes
 Requests per second:2184.33 [#/sec] (mean)
 Time per request:   4.578 [ms] (mean)
 Time per request:   0.458 [ms] (mean, across all concurrent requests)
 Transfer rate:  8918.62 [Kbytes/sec] received

 Connection Times (ms)
   min  mean[+/-sd] median   max
 Connect:01   0.9  0   8
 Processing: 14  18.5  3 788
 Waiting:04  18.4  2 788
 Total:  15  18.5  3 788
 WARNING: The median and mean for the initial connection time are not
 within a normal deviation
 These results are probably not that reliable.

 Percentage of the requests served within a certain time (ms)
   50%  3
   66%  4
   75%  4
   80%  5
   90%  6
   95%  8
   98% 11
   99% 16
  100%788 (longest request)
 d...@yak:~/tmp$

 I also ran the command remotely over a gigabit LAN:
 d...@horse:~$ ab -c 10 -n 2 http://yak.local:8080/user_mgt/login
 This is ApacheBench, Version 2.0.40-dev $Revision: 1.146 $ apache-2.0
 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
 

[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-06 Thread David Pollak
On Wed, May 6, 2009 at 12:11 AM, Daniel Guryca dun...@gmail.com wrote:

 OK thanks for a hint ... so where can I set session lifetime in Lift ?
 Setting session lifetime to 2-3 seconds should make it rock.


Actually, this is done in your web container, not in Lift.

However, most web containers have a low priority background task to clear
unused sessions, so setting it to 2-3 seconds does not guarantee that the
sessions will be cleared in 2 or 3 seconds.

I'd suggest running your test with more memory (e.g., 1GB heap size) to
allow for the churn to happen naturally rather than putting a lot of
pressure on the session mechanism.  Alternatively, you could keep using the
same JSESSIONID cookie and that would address the issue.




 Daniel


 On Wed, May 6, 2009 at 12:46 AM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Tue, May 5, 2009 at 3:23 PM, Daniel Guryca dun...@gmail.com wrote:

 Thank you for your benchmarking description.

 I have just tested it too.

 My results are something around 330 req/s which is superior to previous
 results. Great !

 The only problem I have encountered is that after something around 2000
 requests the whole application stalls and locks and do not respond anymore.
 It seems like some ugly dead lock or something similar.


 Daniel,

 Each request is creating a new session.  The sessions consume a certain
 amount of RAM.  Depending on the heap size for your application, you may be
 running out of memory.  A sure sign of this is a Java process running at
 100% CPU on a multi-core box (using 100% of 1 core).  This indicates that
 the JVM is thrashing about trying to release memory.

 Having 2,000 or 5,000 open sessions is not a common thing for a public
 facing app.  In practice, you'll see something more like 100-200 active
 sessions, but lots of pages served to each of those sessions.

 Thanks,

 David



 I have tried it with postgres instead of derby with similar dead-lock
 result.

 Daniel

 On Mon, May 4, 2009 at 11:16 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Daniel,

 I did a little measurement of Lift and did some tuning.  On my Core 920
 machine with 12GB of RAM running Ubuntu 9.04 and the JDK 1.6.0_13 in 64 bit
 mode with Tomcat 6.0.18 (I ran into some bugs in Jetty while measuring with
 ab).  My baseline running (both locally and across the network)

 ab -c 10 -n 2 http://yak.local:8080/user_mgt/login

 I was seeing about 1,500 pages/second.  I used YourKit to do some
 profiling and improved performance on my box to about 2,200 pages/second.
 Here are the steps I went through.  I created a new project:

 d...@yak:~/benchmark$ mvn archetype:create -U
 -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic
 -DarchetypeVersion=1.1-SNAPSHOT -DremoteRepositories=
 http://scala-tools.org/repo-snapshots   -DgroupId=com.liftcode
 -DartifactId=benchmark

 I cd'ed into benchmark and typed mvn clean install  I copied the
 target/benchmark-1.0-SNAPSHOT directory into Tomcat's webapps directory
 and renamed the directory ROOT.  I did export
 JAVA_OPTS=-Drun.mode=production to make sure Lift runs in production
 mode.  I started Tomcat with ./bin/startup.sh

 Then I ran:

 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login

 I did this and discarded the results because this will warm up the
 HotSpot compiler.  At the end of this run, the JVM should have optimized
 most of the Lift-related classes.  Next, I re-ran the command:
 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login
 This is ApacheBench, Version 2.3 $Revision: 655654 $
 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 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 Completed 12000 requests
 Completed 14000 requests
 Completed 16000 requests
 Completed 18000 requests
 Completed 2 requests
 Finished 2 requests


 Server Software:Apache-Coyote/1.1
 Server Hostname:localhost
 Server Port:8080

 Document Path:  /user_mgt/login
 Document Length:3768 bytes

 Concurrency Level:  10
 Time taken for tests:   9.156 seconds
 Complete requests:  2
 Failed requests:0
 Write errors:   0
 Total transferred:  8362 bytes
 HTML transferred:   7536 bytes
 Requests per second:2184.33 [#/sec] (mean)
 Time per request:   4.578 [ms] (mean)
 Time per request:   0.458 [ms] (mean, across all concurrent
 requests)
 Transfer rate:  8918.62 [Kbytes/sec] received

 Connection Times (ms)
   min  mean[+/-sd] median   max
 Connect:01   0.9  0   8
 Processing: 14  18.5  3 788
 Waiting:04  18.4  2 788
 Total:  15  18.5  3 788
 WARNING: The median and mean for 

[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-05 Thread Daniel Guryca
Thank you for your benchmarking description.

I have just tested it too.

My results are something around 330 req/s which is superior to previous
results. Great !

The only problem I have encountered is that after something around 2000
requests the whole application stalls and locks and do not respond anymore.
It seems like some ugly dead lock or something similar.
I have tried it with postgres instead of derby with similar dead-lock
result.

Daniel

On Mon, May 4, 2009 at 11:16 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 Daniel,

 I did a little measurement of Lift and did some tuning.  On my Core 920
 machine with 12GB of RAM running Ubuntu 9.04 and the JDK 1.6.0_13 in 64 bit
 mode with Tomcat 6.0.18 (I ran into some bugs in Jetty while measuring with
 ab).  My baseline running (both locally and across the network)

 ab -c 10 -n 2 http://yak.local:8080/user_mgt/login

 I was seeing about 1,500 pages/second.  I used YourKit to do some profiling
 and improved performance on my box to about 2,200 pages/second.  Here are
 the steps I went through.  I created a new project:

 d...@yak:~/benchmark$ mvn archetype:create -U
 -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic
 -DarchetypeVersion=1.1-SNAPSHOT -DremoteRepositories=
 http://scala-tools.org/repo-snapshots   -DgroupId=com.liftcode
 -DartifactId=benchmark

 I cd'ed into benchmark and typed mvn clean install  I copied the
 target/benchmark-1.0-SNAPSHOT directory into Tomcat's webapps directory
 and renamed the directory ROOT.  I did export
 JAVA_OPTS=-Drun.mode=production to make sure Lift runs in production
 mode.  I started Tomcat with ./bin/startup.sh

 Then I ran:

 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login

 I did this and discarded the results because this will warm up the
 HotSpot compiler.  At the end of this run, the JVM should have optimized
 most of the Lift-related classes.  Next, I re-ran the command:
 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login
 This is ApacheBench, Version 2.3 $Revision: 655654 $
 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 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 Completed 12000 requests
 Completed 14000 requests
 Completed 16000 requests
 Completed 18000 requests
 Completed 2 requests
 Finished 2 requests


 Server Software:Apache-Coyote/1.1
 Server Hostname:localhost
 Server Port:8080

 Document Path:  /user_mgt/login
 Document Length:3768 bytes

 Concurrency Level:  10
 Time taken for tests:   9.156 seconds
 Complete requests:  2
 Failed requests:0
 Write errors:   0
 Total transferred:  8362 bytes
 HTML transferred:   7536 bytes
 Requests per second:2184.33 [#/sec] (mean)
 Time per request:   4.578 [ms] (mean)
 Time per request:   0.458 [ms] (mean, across all concurrent requests)
 Transfer rate:  8918.62 [Kbytes/sec] received

 Connection Times (ms)
   min  mean[+/-sd] median   max
 Connect:01   0.9  0   8
 Processing: 14  18.5  3 788
 Waiting:04  18.4  2 788
 Total:  15  18.5  3 788
 WARNING: The median and mean for the initial connection time are not within
 a normal deviation
 These results are probably not that reliable.

 Percentage of the requests served within a certain time (ms)
   50%  3
   66%  4
   75%  4
   80%  5
   90%  6
   95%  8
   98% 11
   99% 16
  100%788 (longest request)
 d...@yak:~/tmp$

 I also ran the command remotely over a gigabit LAN:
 d...@horse:~$ ab -c 10 -n 2 http://yak.local:8080/user_mgt/login
 This is ApacheBench, Version 2.0.40-dev $Revision: 1.146 $ apache-2.0
 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
 Copyright 2006 The Apache Software Foundation, http://www.apache.org/

 Benchmarking yak.local (be patient)
 Completed 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 Completed 12000 requests
 Completed 14000 requests
 Completed 16000 requests
 Completed 18000 requests
 Finished 2 requests


 Server Software:Apache-Coyote/1.1
 Server Hostname:yak.local
 Server Port:8080

 Document Path:  /user_mgt/login
 Document Length:3768 bytes

 Concurrency Level:  10
 Time taken for tests:   10.305721 seconds
 Complete requests:  2
 Failed requests:0
 Write errors:   0
 Total transferred:  8362 bytes
 HTML transferred:   7536 bytes
 Requests per second:1940.67 [#/sec] (mean)
 Time per request:   5.153 [ms] (mean)
 Time per request:   

[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-05 Thread David Pollak
On Tue, May 5, 2009 at 3:23 PM, Daniel Guryca dun...@gmail.com wrote:

 Thank you for your benchmarking description.

 I have just tested it too.

 My results are something around 330 req/s which is superior to previous
 results. Great !

 The only problem I have encountered is that after something around 2000
 requests the whole application stalls and locks and do not respond anymore.
 It seems like some ugly dead lock or something similar.


Daniel,

Each request is creating a new session.  The sessions consume a certain
amount of RAM.  Depending on the heap size for your application, you may be
running out of memory.  A sure sign of this is a Java process running at
100% CPU on a multi-core box (using 100% of 1 core).  This indicates that
the JVM is thrashing about trying to release memory.

Having 2,000 or 5,000 open sessions is not a common thing for a public
facing app.  In practice, you'll see something more like 100-200 active
sessions, but lots of pages served to each of those sessions.

Thanks,

David



 I have tried it with postgres instead of derby with similar dead-lock
 result.

 Daniel

 On Mon, May 4, 2009 at 11:16 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Daniel,

 I did a little measurement of Lift and did some tuning.  On my Core 920
 machine with 12GB of RAM running Ubuntu 9.04 and the JDK 1.6.0_13 in 64 bit
 mode with Tomcat 6.0.18 (I ran into some bugs in Jetty while measuring with
 ab).  My baseline running (both locally and across the network)

 ab -c 10 -n 2 http://yak.local:8080/user_mgt/login

 I was seeing about 1,500 pages/second.  I used YourKit to do some
 profiling and improved performance on my box to about 2,200 pages/second.
 Here are the steps I went through.  I created a new project:

 d...@yak:~/benchmark$ mvn archetype:create -U
 -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic
 -DarchetypeVersion=1.1-SNAPSHOT -DremoteRepositories=
 http://scala-tools.org/repo-snapshots   -DgroupId=com.liftcode
 -DartifactId=benchmark

 I cd'ed into benchmark and typed mvn clean install  I copied the
 target/benchmark-1.0-SNAPSHOT directory into Tomcat's webapps directory
 and renamed the directory ROOT.  I did export
 JAVA_OPTS=-Drun.mode=production to make sure Lift runs in production
 mode.  I started Tomcat with ./bin/startup.sh

 Then I ran:

 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login

 I did this and discarded the results because this will warm up the
 HotSpot compiler.  At the end of this run, the JVM should have optimized
 most of the Lift-related classes.  Next, I re-ran the command:
 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login
 This is ApacheBench, Version 2.3 $Revision: 655654 $
 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 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 Completed 12000 requests
 Completed 14000 requests
 Completed 16000 requests
 Completed 18000 requests
 Completed 2 requests
 Finished 2 requests


 Server Software:Apache-Coyote/1.1
 Server Hostname:localhost
 Server Port:8080

 Document Path:  /user_mgt/login
 Document Length:3768 bytes

 Concurrency Level:  10
 Time taken for tests:   9.156 seconds
 Complete requests:  2
 Failed requests:0
 Write errors:   0
 Total transferred:  8362 bytes
 HTML transferred:   7536 bytes
 Requests per second:2184.33 [#/sec] (mean)
 Time per request:   4.578 [ms] (mean)
 Time per request:   0.458 [ms] (mean, across all concurrent requests)
 Transfer rate:  8918.62 [Kbytes/sec] received

 Connection Times (ms)
   min  mean[+/-sd] median   max
 Connect:01   0.9  0   8
 Processing: 14  18.5  3 788
 Waiting:04  18.4  2 788
 Total:  15  18.5  3 788
 WARNING: The median and mean for the initial connection time are not
 within a normal deviation
 These results are probably not that reliable.

 Percentage of the requests served within a certain time (ms)
   50%  3
   66%  4
   75%  4
   80%  5
   90%  6
   95%  8
   98% 11
   99% 16
  100%788 (longest request)
 d...@yak:~/tmp$

 I also ran the command remotely over a gigabit LAN:
 d...@horse:~$ ab -c 10 -n 2 http://yak.local:8080/user_mgt/login
 This is ApacheBench, Version 2.0.40-dev $Revision: 1.146 $ apache-2.0
 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
 Copyright 2006 The Apache Software Foundation, http://www.apache.org/

 Benchmarking yak.local (be patient)
 Completed 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 

[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-04 Thread Daniel Guryca
Thank you Dave.
I'll be waiting for your complete benchmark ...

Daniel

On Mon, May 4, 2009 at 5:23 AM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Sun, May 3, 2009 at 4:11 PM, Daniel Guryca dun...@gmail.com wrote:

 I have just tried mvn -Drun.mode=production jetty:run  ... but sadly still
 getting same performance.


 I ran a simple test (the same command line as you) on my 2.67 Ghz Core i7
 machine and saw 600 pages per second.  Granted, my machine's faster, but not
 10x.

 I'll spend some time putting together a complete benchmark tomorrow so we
 can share the same executable and hopefully see the same results.




 Daniel


 On Sun, May 3, 2009 at 3:31 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Sun, May 3, 2009 at 6:18 AM, Daniel Guryca dun...@gmail.com wrote:

 Hi David,

 Thank you for your reply.

 How and where can I set production vs development mode in lift ?


 Set the run.mode system property to production  I do that with
 -Drun.mode=production when I start Jetty, but you may do it differently.

 Also, In the basic app, there's an RDBMS request for the User object on
 each page load and if you've got Derby configured, that's going to slow
 things down.




 Thank you again.
 Daniel

 On Sun, May 3, 2009 at 3:12 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Are you running Lift in production or development mode?
 I typically see 300 pages/second to 800 pages/second when I do
 benchmarks on dual core opteron machines.

 I'll look into this, but you should be seeing north of 300 pages per
 second with simple pages in Lift.


 On Sat, May 2, 2009 at 1:32 PM, Dunsun dun...@gmail.com wrote:


 Hi,

 I'm very new to lift and scala.

 I have made some Grails intranet applications but sadly Grails or
 better say GSP rendering part which is completely written in Groovy is
 a very slow beast (even in comparison with Rails or Django).

 For my future big project (heavy loaded site) I need something much
 faster.

 So I have made some quick and dirty Lift benchmarks using ApacheBench
 + Tomcat, GlassFish (from netbeans) and even Jetty.
 My machine - AMD X2 @ 2500Mhz, 4 GB RAM

 LIFT BASIC SAMPLE:
 ab -c 10 -n 3000
 http://localhost:8080/liftbasic-1.0-SNAPSHOT/user_mgt/login
 50 req/s

 LIFT BLANK SAMPLE:
 ab -c 10 -n 3000 http://localhost:8080/liftblank-1.0/
 120 req/s

 Obtained numbers were similar for all 3 servers.

 Using Stripes and rendering similar simple pages I'm getting much much
 higher scores (600 req/s).
 Using Grails I'm getting little worse results but I would say it is
 same league.
 I would expect much better performance from Lift which is written in
 scala.

 Why am I getting these low numbers ?
 Am I doing something wrong ?
 Any suggestion is very welcome.

 regards
 Daniel





 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp








 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp








 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-04 Thread marius d.

Dave if you're doing benchmarks can you try using the template caching
mechanism ? .. and try to see the differences ?

Br's,
Marius

On May 4, 6:23 am, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Sun, May 3, 2009 at 4:11 PM, Daniel Guryca dun...@gmail.com wrote:
  I have just tried mvn -Drun.mode=production jetty:run  ... but sadly still
  getting same performance.

 I ran a simple test (the same command line as you) on my 2.67 Ghz Core i7
 machine and saw 600 pages per second.  Granted, my machine's faster, but not
 10x.

 I'll spend some time putting together a complete benchmark tomorrow so we
 can share the same executable and hopefully see the same results.





  Daniel

  On Sun, May 3, 2009 at 3:31 PM, David Pollak 
  feeder.of.the.be...@gmail.com wrote:

  On Sun, May 3, 2009 at 6:18 AM, Daniel Guryca dun...@gmail.com wrote:

  Hi David,

  Thank you for your reply.

  How and where can I set production vs development mode in lift ?

  Set the run.mode system property to production  I do that with
  -Drun.mode=production when I start Jetty, but you may do it differently.

  Also, In the basic app, there's an RDBMS request for the User object on
  each page load and if you've got Derby configured, that's going to slow
  things down.

  Thank you again.
  Daniel

  On Sun, May 3, 2009 at 3:12 PM, David Pollak 
  feeder.of.the.be...@gmail.com wrote:

  Are you running Lift in production or development mode?
  I typically see 300 pages/second to 800 pages/second when I do
  benchmarks on dual core opteron machines.

  I'll look into this, but you should be seeing north of 300 pages per
  second with simple pages in Lift.

  On Sat, May 2, 2009 at 1:32 PM, Dunsun dun...@gmail.com wrote:

  Hi,

  I'm very new to lift and scala.

  I have made some Grails intranet applications but sadly Grails or
  better say GSP rendering part which is completely written in Groovy is
  a very slow beast (even in comparison with Rails or Django).

  For my future big project (heavy loaded site) I need something much
  faster.

  So I have made some quick and dirty Lift benchmarks using ApacheBench
  + Tomcat, GlassFish (from netbeans) and even Jetty.
  My machine - AMD X2 @ 2500Mhz, 4 GB RAM

  LIFT BASIC SAMPLE:
  ab -c 10 -n 3000
 http://localhost:8080/liftbasic-1.0-SNAPSHOT/user_mgt/login
  50 req/s

  LIFT BLANK SAMPLE:
  ab -c 10 -n 3000http://localhost:8080/liftblank-1.0/
  120 req/s

  Obtained numbers were similar for all 3 servers.

  Using Stripes and rendering similar simple pages I'm getting much much
  higher scores (600 req/s).
  Using Grails I'm getting little worse results but I would say it is
  same league.
  I would expect much better performance from Lift which is written in
  scala.

  Why am I getting these low numbers ?
  Am I doing something wrong ?
  Any suggestion is very welcome.

  regards
  Daniel

  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp

  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-04 Thread David Pollak
Daniel,

I did a little measurement of Lift and did some tuning.  On my Core 920
machine with 12GB of RAM running Ubuntu 9.04 and the JDK 1.6.0_13 in 64 bit
mode with Tomcat 6.0.18 (I ran into some bugs in Jetty while measuring with
ab).  My baseline running (both locally and across the network)

ab -c 10 -n 2 http://yak.local:8080/user_mgt/login

I was seeing about 1,500 pages/second.  I used YourKit to do some profiling
and improved performance on my box to about 2,200 pages/second.  Here are
the steps I went through.  I created a new project:

d...@yak:~/benchmark$ mvn archetype:create -U
-DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic
-DarchetypeVersion=1.1-SNAPSHOT -DremoteRepositories=
http://scala-tools.org/repo-snapshots   -DgroupId=com.liftcode
-DartifactId=benchmark

I cd'ed into benchmark and typed mvn clean install  I copied the
target/benchmark-1.0-SNAPSHOT directory into Tomcat's webapps directory
and renamed the directory ROOT.  I did export
JAVA_OPTS=-Drun.mode=production to make sure Lift runs in production
mode.  I started Tomcat with ./bin/startup.sh

Then I ran:

d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login

I did this and discarded the results because this will warm up the HotSpot
compiler.  At the end of this run, the JVM should have optimized most of the
Lift-related classes.  Next, I re-ran the command:
d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login
This is ApacheBench, Version 2.3 $Revision: 655654 $
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 2000 requests
Completed 4000 requests
Completed 6000 requests
Completed 8000 requests
Completed 1 requests
Completed 12000 requests
Completed 14000 requests
Completed 16000 requests
Completed 18000 requests
Completed 2 requests
Finished 2 requests


Server Software:Apache-Coyote/1.1
Server Hostname:localhost
Server Port:8080

Document Path:  /user_mgt/login
Document Length:3768 bytes

Concurrency Level:  10
Time taken for tests:   9.156 seconds
Complete requests:  2
Failed requests:0
Write errors:   0
Total transferred:  8362 bytes
HTML transferred:   7536 bytes
Requests per second:2184.33 [#/sec] (mean)
Time per request:   4.578 [ms] (mean)
Time per request:   0.458 [ms] (mean, across all concurrent requests)
Transfer rate:  8918.62 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:01   0.9  0   8
Processing: 14  18.5  3 788
Waiting:04  18.4  2 788
Total:  15  18.5  3 788
WARNING: The median and mean for the initial connection time are not within
a normal deviation
These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%  3
  66%  4
  75%  4
  80%  5
  90%  6
  95%  8
  98% 11
  99% 16
 100%788 (longest request)
d...@yak:~/tmp$

I also ran the command remotely over a gigabit LAN:
d...@horse:~$ ab -c 10 -n 2 http://yak.local:8080/user_mgt/login
This is ApacheBench, Version 2.0.40-dev $Revision: 1.146 $ apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking yak.local (be patient)
Completed 2000 requests
Completed 4000 requests
Completed 6000 requests
Completed 8000 requests
Completed 1 requests
Completed 12000 requests
Completed 14000 requests
Completed 16000 requests
Completed 18000 requests
Finished 2 requests


Server Software:Apache-Coyote/1.1
Server Hostname:yak.local
Server Port:8080

Document Path:  /user_mgt/login
Document Length:3768 bytes

Concurrency Level:  10
Time taken for tests:   10.305721 seconds
Complete requests:  2
Failed requests:0
Write errors:   0
Total transferred:  8362 bytes
HTML transferred:   7536 bytes
Requests per second:1940.67 [#/sec] (mean)
Time per request:   5.153 [ms] (mean)
Time per request:   0.515 [ms] (mean, across all concurrent requests)
Transfer rate:  7923.75 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.6  0   4
Processing: 14  25.9  3 840
Waiting:13  25.6  2 816
Total:  14  25.9  3 840

Percentage of the requests served within a certain time (ms)
  50%  3
  66%  4
  75%  4
  80%  4
  90%  6
  95%  8
  98% 11
  99% 17
 100%840 (longest request)


I'm currently setting up a test machine with a 2 core AMD processor, 1GB of
RAM and Ubuntu.  I'll 

[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-04 Thread Derek Chen-Becker
Just to throw in another data point, I ran the tests on my AMD Phenom X2 720
(3 cores, 6GB of RAM):

I generated the archetype exactly as you have it here.

Ran mvn -Drun.mode=production -Djetty.port=9090 jetty:run

Output from Apache Bench:

$ ab -c 10 -n 2 http://192.168.2.254:9090/user_mgt/login
This is ApacheBench, Version 2.3 $Revision: 655654 $
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.2.254 (be patient)
Completed 2000 requests
Completed 4000 requests
Completed 6000 requests
Completed 8000 requests
Completed 1 requests
Completed 12000 requests
Completed 14000 requests
Completed 16000 requests
Completed 18000 requests
Completed 2 requests
Finished 2 requests


Server Software:Jetty(6.1.16)
Server Hostname:192.168.2.254
Server Port:9090

Document Path:  /user_mgt/login
Document Length:3635 bytes

Concurrency Level:  10
Time taken for tests:   37.110 seconds
Complete requests:  2
Failed requests:10191
   (Connect: 0, Receive: 0, Length: 10191, Exceptions: 0)
Write errors:   0
Total transferred:  79276096 bytes
HTML transferred:   72626584 bytes
Requests per second:538.94 [#/sec] (mean)
Time per request:   18.555 [ms] (mean)
Time per request:   1.855 [ms] (mean, across all concurrent requests)
Transfer rate:  2086.18 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.0  0   1
Processing: 1   18  40.8 111428
Waiting:1   18  39.9 111414
Total:  1   19  40.8 111428

Percentage of the requests served within a certain time (ms)
  50% 11
  66% 16
  75% 20
  80% 23
  90% 36
  95% 54
  98% 78
  99%100
 100%   1428 (longest request)


On Mon, May 4, 2009 at 3:16 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:

 Daniel,

 I did a little measurement of Lift and did some tuning.  On my Core 920
 machine with 12GB of RAM running Ubuntu 9.04 and the JDK 1.6.0_13 in 64 bit
 mode with Tomcat 6.0.18 (I ran into some bugs in Jetty while measuring with
 ab).  My baseline running (both locally and across the network)

 ab -c 10 -n 2 http://yak.local:8080/user_mgt/login

 I was seeing about 1,500 pages/second.  I used YourKit to do some profiling
 and improved performance on my box to about 2,200 pages/second.  Here are
 the steps I went through.  I created a new project:

 d...@yak:~/benchmark$ mvn archetype:create -U
 -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic
 -DarchetypeVersion=1.1-SNAPSHOT -DremoteRepositories=
 http://scala-tools.org/repo-snapshots   -DgroupId=com.liftcode
 -DartifactId=benchmark

 I cd'ed into benchmark and typed mvn clean install  I copied the
 target/benchmark-1.0-SNAPSHOT directory into Tomcat's webapps directory
 and renamed the directory ROOT.  I did export
 JAVA_OPTS=-Drun.mode=production to make sure Lift runs in production
 mode.  I started Tomcat with ./bin/startup.sh

 Then I ran:

 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login

 I did this and discarded the results because this will warm up the
 HotSpot compiler.  At the end of this run, the JVM should have optimized
 most of the Lift-related classes.  Next, I re-ran the command:
 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login
 This is ApacheBench, Version 2.3 $Revision: 655654 $
 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 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 Completed 12000 requests
 Completed 14000 requests
 Completed 16000 requests
 Completed 18000 requests
 Completed 2 requests
 Finished 2 requests


 Server Software:Apache-Coyote/1.1
 Server Hostname:localhost
 Server Port:8080

 Document Path:  /user_mgt/login
 Document Length:3768 bytes

 Concurrency Level:  10
 Time taken for tests:   9.156 seconds
 Complete requests:  2
 Failed requests:0
 Write errors:   0
 Total transferred:  8362 bytes
 HTML transferred:   7536 bytes
 Requests per second:2184.33 [#/sec] (mean)
 Time per request:   4.578 [ms] (mean)
 Time per request:   0.458 [ms] (mean, across all concurrent requests)
 Transfer rate:  8918.62 [Kbytes/sec] received

 Connection Times (ms)
   min  mean[+/-sd] median   max
 Connect:01   0.9  0   8
 Processing: 14  18.5  3 788
 Waiting:04  18.4  2 788
 Total:  15  18.5  3 788
 WARNING: The median and mean for the initial connection time are not 

[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-04 Thread David Pollak
Derek,
Please note that about half of the requests failed in Jetty.  Jetty does not
seem to be explicitly closing the NIO sockets leading to an out of IO
descriptor problem... that's why I used Tomcat.

Thanks,

David

On Mon, May 4, 2009 at 2:47 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 Just to throw in another data point, I ran the tests on my AMD Phenom X2
 720 (3 cores, 6GB of RAM):

 I generated the archetype exactly as you have it here.

 Ran mvn -Drun.mode=production -Djetty.port=9090 jetty:run

 Output from Apache Bench:

 $ ab -c 10 -n 2 http://192.168.2.254:9090/user_mgt/login
 This is ApacheBench, Version 2.3 $Revision: 655654 $
 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
 Licensed to The Apache Software Foundation, http://www.apache.org/

 Benchmarking 192.168.2.254 (be patient)
 Completed 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 Completed 12000 requests
 Completed 14000 requests
 Completed 16000 requests
 Completed 18000 requests
 Completed 2 requests
 Finished 2 requests


 Server Software:Jetty(6.1.16)
 Server Hostname:192.168.2.254
 Server Port:9090

 Document Path:  /user_mgt/login
 Document Length:3635 bytes

 Concurrency Level:  10
 Time taken for tests:   37.110 seconds
 Complete requests:  2
 Failed requests:10191
(Connect: 0, Receive: 0, Length: 10191, Exceptions: 0)
 Write errors:   0
 Total transferred:  79276096 bytes
 HTML transferred:   72626584 bytes
 Requests per second:538.94 [#/sec] (mean)
 Time per request:   18.555 [ms] (mean)
 Time per request:   1.855 [ms] (mean, across all concurrent requests)
 Transfer rate:  2086.18 [Kbytes/sec] received

 Connection Times (ms)
   min  mean[+/-sd] median   max
 Connect:00   0.0  0   1
 Processing: 1   18  40.8 111428
 Waiting:1   18  39.9 111414
 Total:  1   19  40.8 111428

 Percentage of the requests served within a certain time (ms)
   50% 11
   66% 16
   75% 20
   80% 23
   90% 36
   95% 54
   98% 78
   99%100
  100%   1428 (longest request)


 On Mon, May 4, 2009 at 3:16 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Daniel,

 I did a little measurement of Lift and did some tuning.  On my Core 920
 machine with 12GB of RAM running Ubuntu 9.04 and the JDK 1.6.0_13 in 64 bit
 mode with Tomcat 6.0.18 (I ran into some bugs in Jetty while measuring with
 ab).  My baseline running (both locally and across the network)

 ab -c 10 -n 2 http://yak.local:8080/user_mgt/login

 I was seeing about 1,500 pages/second.  I used YourKit to do some
 profiling and improved performance on my box to about 2,200 pages/second.
 Here are the steps I went through.  I created a new project:

 d...@yak:~/benchmark$ mvn archetype:create -U
 -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic
 -DarchetypeVersion=1.1-SNAPSHOT -DremoteRepositories=
 http://scala-tools.org/repo-snapshots   -DgroupId=com.liftcode
 -DartifactId=benchmark

 I cd'ed into benchmark and typed mvn clean install  I copied the
 target/benchmark-1.0-SNAPSHOT directory into Tomcat's webapps directory
 and renamed the directory ROOT.  I did export
 JAVA_OPTS=-Drun.mode=production to make sure Lift runs in production
 mode.  I started Tomcat with ./bin/startup.sh

 Then I ran:

 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login

 I did this and discarded the results because this will warm up the
 HotSpot compiler.  At the end of this run, the JVM should have optimized
 most of the Lift-related classes.  Next, I re-ran the command:
 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login
 This is ApacheBench, Version 2.3 $Revision: 655654 $
 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 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 Completed 12000 requests
 Completed 14000 requests
 Completed 16000 requests
 Completed 18000 requests
 Completed 2 requests
 Finished 2 requests


 Server Software:Apache-Coyote/1.1
 Server Hostname:localhost
 Server Port:8080

 Document Path:  /user_mgt/login
 Document Length:3768 bytes

 Concurrency Level:  10
 Time taken for tests:   9.156 seconds
 Complete requests:  2
 Failed requests:0
 Write errors:   0
 Total transferred:  8362 bytes
 HTML transferred:   7536 bytes
 Requests per second:2184.33 [#/sec] (mean)
 Time per request:   4.578 [ms] (mean)
 Time per request:   0.458 [ms] (mean, across all concurrent requests)
 Transfer rate: 

[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-04 Thread Derek Chen-Becker
Yeah, I just noticed that on my jetty console. Bummer.

On Mon, May 4, 2009 at 3:59 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:

 Derek,
 Please note that about half of the requests failed in Jetty.  Jetty does
 not seem to be explicitly closing the NIO sockets leading to an out of IO
 descriptor problem... that's why I used Tomcat.

 Thanks,

 David


 On Mon, May 4, 2009 at 2:47 PM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 Just to throw in another data point, I ran the tests on my AMD Phenom X2
 720 (3 cores, 6GB of RAM):

 I generated the archetype exactly as you have it here.

 Ran mvn -Drun.mode=production -Djetty.port=9090 jetty:run

 Output from Apache Bench:

 $ ab -c 10 -n 2 http://192.168.2.254:9090/user_mgt/login
 This is ApacheBench, Version 2.3 $Revision: 655654 $
 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
 Licensed to The Apache Software Foundation, http://www.apache.org/

 Benchmarking 192.168.2.254 (be patient)
 Completed 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 Completed 12000 requests
 Completed 14000 requests
 Completed 16000 requests
 Completed 18000 requests
 Completed 2 requests
 Finished 2 requests


 Server Software:Jetty(6.1.16)
 Server Hostname:192.168.2.254
 Server Port:9090

 Document Path:  /user_mgt/login
 Document Length:3635 bytes

 Concurrency Level:  10
 Time taken for tests:   37.110 seconds
 Complete requests:  2
 Failed requests:10191
(Connect: 0, Receive: 0, Length: 10191, Exceptions: 0)
 Write errors:   0
 Total transferred:  79276096 bytes
 HTML transferred:   72626584 bytes
 Requests per second:538.94 [#/sec] (mean)
 Time per request:   18.555 [ms] (mean)
 Time per request:   1.855 [ms] (mean, across all concurrent requests)
 Transfer rate:  2086.18 [Kbytes/sec] received

 Connection Times (ms)
   min  mean[+/-sd] median   max
 Connect:00   0.0  0   1
 Processing: 1   18  40.8 111428
 Waiting:1   18  39.9 111414
 Total:  1   19  40.8 111428

 Percentage of the requests served within a certain time (ms)
   50% 11
   66% 16
   75% 20
   80% 23
   90% 36
   95% 54
   98% 78
   99%100
  100%   1428 (longest request)


  On Mon, May 4, 2009 at 3:16 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

  Daniel,

 I did a little measurement of Lift and did some tuning.  On my Core 920
 machine with 12GB of RAM running Ubuntu 9.04 and the JDK 1.6.0_13 in 64 bit
 mode with Tomcat 6.0.18 (I ran into some bugs in Jetty while measuring with
 ab).  My baseline running (both locally and across the network)

 ab -c 10 -n 2 http://yak.local:8080/user_mgt/login

 I was seeing about 1,500 pages/second.  I used YourKit to do some
 profiling and improved performance on my box to about 2,200 pages/second.
 Here are the steps I went through.  I created a new project:

 d...@yak:~/benchmark$ mvn archetype:create -U
 -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic
 -DarchetypeVersion=1.1-SNAPSHOT -DremoteRepositories=
 http://scala-tools.org/repo-snapshots   -DgroupId=com.liftcode
 -DartifactId=benchmark

 I cd'ed into benchmark and typed mvn clean install  I copied the
 target/benchmark-1.0-SNAPSHOT directory into Tomcat's webapps directory
 and renamed the directory ROOT.  I did export
 JAVA_OPTS=-Drun.mode=production to make sure Lift runs in production
 mode.  I started Tomcat with ./bin/startup.sh

 Then I ran:

 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login

 I did this and discarded the results because this will warm up the
 HotSpot compiler.  At the end of this run, the JVM should have optimized
 most of the Lift-related classes.  Next, I re-ran the command:
 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login
 This is ApacheBench, Version 2.3 $Revision: 655654 $
 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 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 Completed 12000 requests
 Completed 14000 requests
 Completed 16000 requests
 Completed 18000 requests
 Completed 2 requests
 Finished 2 requests


 Server Software:Apache-Coyote/1.1
 Server Hostname:localhost
 Server Port:8080

 Document Path:  /user_mgt/login
 Document Length:3768 bytes

 Concurrency Level:  10
 Time taken for tests:   9.156 seconds
 Complete requests:  2
 Failed requests:0
 Write errors:   0
 Total transferred:  8362 bytes
 HTML transferred:   7536 bytes
 Requests per second:2184.33 

[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-04 Thread David Pollak
On my AMD box (AMD Athlon(tm) 64 X2 Dual Core Processor 3800+) with about
800MB of RAM (part of the RAM is used for the video controller), I started
Tomcat with:

export JAVA_OPTS=-Drun.mode=production -server -Xmx650M 

and here are the results:

d...@testomatic:~/apache-tomcat-6.0.18$ ab -c 10 -n 2
http://localhost:8080/user_mgt/login
This is ApacheBench, Version 2.3 $Revision: 655654 $
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 2000 requests
Completed 4000 requests
Completed 6000 requests
Completed 8000 requests
Completed 1 requests
Completed 12000 requests
Completed 14000 requests
Completed 16000 requests
Completed 18000 requests
Completed 2 requests
Finished 2 requests


Server Software:Apache-Coyote/1.1
Server Hostname:localhost
Server Port:8080

Document Path:  /user_mgt/login
Document Length:3768 bytes

Concurrency Level:  10
Time taken for tests:   54.032 seconds
Complete requests:  2
Failed requests:0
Write errors:   0
Total transferred:  8362 bytes
HTML transferred:   7536 bytes
Requests per second:370.15 [#/sec] (mean)
Time per request:   27.016 [ms] (mean)
Time per request:   2.702 [ms] (mean, across all concurrent requests)
Transfer rate:  1511.33 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   1.4  0  35
Processing: 2   27  42.5  9 974
Waiting:0   25  40.6  8 974
Total:  2   27  42.5 10 974

Percentage of the requests served within a certain time (ms)
  50% 10
  66% 23
  75% 35
  80% 44
  90% 72
  95% 97
  98%132
  99%156
 100%974 (longest request)

So, on a box similar to yours, I'm seeing about 6x better performance.

Thanks,

David

On Mon, May 4, 2009 at 2:16 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:

 Daniel,

 I did a little measurement of Lift and did some tuning.  On my Core 920
 machine with 12GB of RAM running Ubuntu 9.04 and the JDK 1.6.0_13 in 64 bit
 mode with Tomcat 6.0.18 (I ran into some bugs in Jetty while measuring with
 ab).  My baseline running (both locally and across the network)

 ab -c 10 -n 2 http://yak.local:8080/user_mgt/login

 I was seeing about 1,500 pages/second.  I used YourKit to do some profiling
 and improved performance on my box to about 2,200 pages/second.  Here are
 the steps I went through.  I created a new project:

 d...@yak:~/benchmark$ mvn archetype:create -U
 -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic
 -DarchetypeVersion=1.1-SNAPSHOT -DremoteRepositories=
 http://scala-tools.org/repo-snapshots   -DgroupId=com.liftcode
 -DartifactId=benchmark

 I cd'ed into benchmark and typed mvn clean install  I copied the
 target/benchmark-1.0-SNAPSHOT directory into Tomcat's webapps directory
 and renamed the directory ROOT.  I did export
 JAVA_OPTS=-Drun.mode=production to make sure Lift runs in production
 mode.  I started Tomcat with ./bin/startup.sh

 Then I ran:

 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login

 I did this and discarded the results because this will warm up the
 HotSpot compiler.  At the end of this run, the JVM should have optimized
 most of the Lift-related classes.  Next, I re-ran the command:
 d...@yak:~/tmp$ ab -c 10 -n 2 http://localhost:8080/user_mgt/login
 This is ApacheBench, Version 2.3 $Revision: 655654 $
 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 2000 requests
 Completed 4000 requests
 Completed 6000 requests
 Completed 8000 requests
 Completed 1 requests
 Completed 12000 requests
 Completed 14000 requests
 Completed 16000 requests
 Completed 18000 requests
 Completed 2 requests
 Finished 2 requests


 Server Software:Apache-Coyote/1.1
 Server Hostname:localhost
 Server Port:8080

 Document Path:  /user_mgt/login
 Document Length:3768 bytes

 Concurrency Level:  10
 Time taken for tests:   9.156 seconds
 Complete requests:  2
 Failed requests:0
 Write errors:   0
 Total transferred:  8362 bytes
 HTML transferred:   7536 bytes
 Requests per second:2184.33 [#/sec] (mean)
 Time per request:   4.578 [ms] (mean)
 Time per request:   0.458 [ms] (mean, across all concurrent requests)
 Transfer rate:  8918.62 [Kbytes/sec] received

 Connection Times (ms)
   min  mean[+/-sd] median   max
 Connect:01   0.9  0   8
 Processing: 14  18.5  3 788
 Waiting:04  18.4  2 788
 Total:  15  18.5  3 788
 WARNING: 

[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-03 Thread David Pollak
Are you running Lift in production or development mode?
I typically see 300 pages/second to 800 pages/second when I do benchmarks on
dual core opteron machines.

I'll look into this, but you should be seeing north of 300 pages per second
with simple pages in Lift.

On Sat, May 2, 2009 at 1:32 PM, Dunsun dun...@gmail.com wrote:


 Hi,

 I'm very new to lift and scala.

 I have made some Grails intranet applications but sadly Grails or
 better say GSP rendering part which is completely written in Groovy is
 a very slow beast (even in comparison with Rails or Django).

 For my future big project (heavy loaded site) I need something much
 faster.

 So I have made some quick and dirty Lift benchmarks using ApacheBench
 + Tomcat, GlassFish (from netbeans) and even Jetty.
 My machine - AMD X2 @ 2500Mhz, 4 GB RAM

 LIFT BASIC SAMPLE:
 ab -c 10 -n 3000
 http://localhost:8080/liftbasic-1.0-SNAPSHOT/user_mgt/login
 50 req/s

 LIFT BLANK SAMPLE:
 ab -c 10 -n 3000 http://localhost:8080/liftblank-1.0/
 120 req/s

 Obtained numbers were similar for all 3 servers.

 Using Stripes and rendering similar simple pages I'm getting much much
 higher scores (600 req/s).
 Using Grails I'm getting little worse results but I would say it is
 same league.
 I would expect much better performance from Lift which is written in
 scala.

 Why am I getting these low numbers ?
 Am I doing something wrong ?
 Any suggestion is very welcome.

 regards
 Daniel

 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-03 Thread Daniel Guryca
Anybody ?

I have spent more then month testing various frameworks.
Just found lift and spent the whole Friday by learning scala. I liked it.

Time is not my friend ... I just have to choose the right language +
framework combo for my 3 other colleges and our coming project.

Any comment is welcome.

Thank you
Daniel

On Sat, May 2, 2009 at 10:32 PM, Dunsun dun...@gmail.com wrote:

 Hi,

 I'm very new to lift and scala.

 I have made some Grails intranet applications but sadly Grails or
 better say GSP rendering part which is completely written in Groovy is
 a very slow beast (even in comparison with Rails or Django).

 For my future big project (heavy loaded site) I need something much
 faster.

 So I have made some quick and dirty Lift benchmarks using ApacheBench
 + Tomcat, GlassFish (from netbeans) and even Jetty.
 My machine - AMD X2 @ 2500Mhz, 4 GB RAM

 LIFT BASIC SAMPLE:
 ab -c 10 -n 3000
 http://localhost:8080/liftbasic-1.0-SNAPSHOT/user_mgt/login
 50 req/s

 LIFT BLANK SAMPLE:
 ab -c 10 -n 3000 http://localhost:8080/liftblank-1.0/
 120 req/s

 Obtained numbers were similar for all 3 servers.

 Using Stripes and rendering similar simple pages I'm getting much much
 higher scores (600 req/s).
 Using Grails I'm getting little worse results but I would say it is
 same league.
 I would expect much better performance from Lift which is written in
 scala.

 Why am I getting these low numbers ?
 Am I doing something wrong ?
 Any suggestion is very welcome.

 regards
 Daniel

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-03 Thread Daniel Guryca
Hi David,

Thank you for your reply.

How and where can I set production vs development mode in lift ?

Thank you again.
Daniel

On Sun, May 3, 2009 at 3:12 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:

 Are you running Lift in production or development mode?
 I typically see 300 pages/second to 800 pages/second when I do benchmarks
 on dual core opteron machines.

 I'll look into this, but you should be seeing north of 300 pages per second
 with simple pages in Lift.


 On Sat, May 2, 2009 at 1:32 PM, Dunsun dun...@gmail.com wrote:


 Hi,

 I'm very new to lift and scala.

 I have made some Grails intranet applications but sadly Grails or
 better say GSP rendering part which is completely written in Groovy is
 a very slow beast (even in comparison with Rails or Django).

 For my future big project (heavy loaded site) I need something much
 faster.

 So I have made some quick and dirty Lift benchmarks using ApacheBench
 + Tomcat, GlassFish (from netbeans) and even Jetty.
 My machine - AMD X2 @ 2500Mhz, 4 GB RAM

 LIFT BASIC SAMPLE:
 ab -c 10 -n 3000
 http://localhost:8080/liftbasic-1.0-SNAPSHOT/user_mgt/login
 50 req/s

 LIFT BLANK SAMPLE:
 ab -c 10 -n 3000 http://localhost:8080/liftblank-1.0/
 120 req/s

 Obtained numbers were similar for all 3 servers.

 Using Stripes and rendering similar simple pages I'm getting much much
 higher scores (600 req/s).
 Using Grails I'm getting little worse results but I would say it is
 same league.
 I would expect much better performance from Lift which is written in
 scala.

 Why am I getting these low numbers ?
 Am I doing something wrong ?
 Any suggestion is very welcome.

 regards
 Daniel





 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-03 Thread David Pollak
On Sun, May 3, 2009 at 6:18 AM, Daniel Guryca dun...@gmail.com wrote:

 Hi David,

 Thank you for your reply.

 How and where can I set production vs development mode in lift ?


Set the run.mode system property to production  I do that with
-Drun.mode=production when I start Jetty, but you may do it differently.

Also, In the basic app, there's an RDBMS request for the User object on each
page load and if you've got Derby configured, that's going to slow things
down.




 Thank you again.
 Daniel

 On Sun, May 3, 2009 at 3:12 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Are you running Lift in production or development mode?
 I typically see 300 pages/second to 800 pages/second when I do benchmarks
 on dual core opteron machines.

 I'll look into this, but you should be seeing north of 300 pages per
 second with simple pages in Lift.


 On Sat, May 2, 2009 at 1:32 PM, Dunsun dun...@gmail.com wrote:


 Hi,

 I'm very new to lift and scala.

 I have made some Grails intranet applications but sadly Grails or
 better say GSP rendering part which is completely written in Groovy is
 a very slow beast (even in comparison with Rails or Django).

 For my future big project (heavy loaded site) I need something much
 faster.

 So I have made some quick and dirty Lift benchmarks using ApacheBench
 + Tomcat, GlassFish (from netbeans) and even Jetty.
 My machine - AMD X2 @ 2500Mhz, 4 GB RAM

 LIFT BASIC SAMPLE:
 ab -c 10 -n 3000
 http://localhost:8080/liftbasic-1.0-SNAPSHOT/user_mgt/login
 50 req/s

 LIFT BLANK SAMPLE:
 ab -c 10 -n 3000 http://localhost:8080/liftblank-1.0/
 120 req/s

 Obtained numbers were similar for all 3 servers.

 Using Stripes and rendering similar simple pages I'm getting much much
 higher scores (600 req/s).
 Using Grails I'm getting little worse results but I would say it is
 same league.
 I would expect much better performance from Lift which is written in
 scala.

 Why am I getting these low numbers ?
 Am I doing something wrong ?
 Any suggestion is very welcome.

 regards
 Daniel





 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp




 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-03 Thread Bryan.

Hi Daniel,

You can pass the following to mvn:  -Drun.mode=production.

--Bryan

On May 3, 9:18 am, Daniel Guryca dun...@gmail.com wrote:
 Hi David,

 Thank you for your reply.

 How and where can I set production vs development mode in lift ?

 Thank you again.
 Daniel

 On Sun, May 3, 2009 at 3:12 PM, David Pollak
 feeder.of.the.be...@gmail.comwrote:

  Are you running Lift in production or development mode?
  I typically see 300 pages/second to 800 pages/second when I do benchmarks
  on dual core opteron machines.

  I'll look into this, but you should be seeing north of 300 pages per second
  with simple pages in Lift.

  On Sat, May 2, 2009 at 1:32 PM, Dunsun dun...@gmail.com wrote:

  Hi,

  I'm very new to lift and scala.

  I have made some Grails intranet applications but sadly Grails or
  better say GSP rendering part which is completely written in Groovy is
  a very slow beast (even in comparison with Rails or Django).

  For my future big project (heavy loaded site) I need something much
  faster.

  So I have made some quick and dirty Lift benchmarks using ApacheBench
  + Tomcat, GlassFish (from netbeans) and even Jetty.
  My machine - AMD X2 @ 2500Mhz, 4 GB RAM

  LIFT BASIC SAMPLE:
  ab -c 10 -n 3000
 http://localhost:8080/liftbasic-1.0-SNAPSHOT/user_mgt/login
  50 req/s

  LIFT BLANK SAMPLE:
  ab -c 10 -n 3000http://localhost:8080/liftblank-1.0/
  120 req/s

  Obtained numbers were similar for all 3 servers.

  Using Stripes and rendering similar simple pages I'm getting much much
  higher scores (600 req/s).
  Using Grails I'm getting little worse results but I would say it is
  same league.
  I would expect much better performance from Lift which is written in
  scala.

  Why am I getting these low numbers ?
  Am I doing something wrong ?
  Any suggestion is very welcome.

  regards
  Daniel

  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-03 Thread Daniel Guryca
Hey ..  I'm not saying that you anwered my questione slowly ! I'm very
impressed that you are dealing with mailing list even on your free time on
weekend !

I just wanted to clear up why I'm in hurry.

regards
Daniel

On Sun, May 3, 2009 at 3:34 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Sun, May 3, 2009 at 6:17 AM, Daniel Guryca dun...@gmail.com wrote:

 Anybody ?


 New user posts to this list are moderated (it cuts down on spam).  There
 are three of use who moderate the list, but a posting on Saturday night may
 not get moderated for 12 hours.

 Also, while we do intend to be responsive to user requests, expect that
 turn-around for answers, especially to non-trivial questions, may not be in
 2 or 3 hours.  In this case, a 9 hour delay in answering on a weekend
 strikes me as fast not slow.

 Thanks,

 David



 I have spent more then month testing various frameworks.
 Just found lift and spent the whole Friday by learning scala. I liked it.

 Time is not my friend ... I just have to choose the right language +
 framework combo for my 3 other colleges and our coming project.

 Any comment is welcome.

 Thank you
 Daniel


 On Sat, May 2, 2009 at 10:32 PM, Dunsun dun...@gmail.com wrote:

 Hi,

 I'm very new to lift and scala.

 I have made some Grails intranet applications but sadly Grails or
 better say GSP rendering part which is completely written in Groovy is
 a very slow beast (even in comparison with Rails or Django).

 For my future big project (heavy loaded site) I need something much
 faster.

 So I have made some quick and dirty Lift benchmarks using ApacheBench
 + Tomcat, GlassFish (from netbeans) and even Jetty.
 My machine - AMD X2 @ 2500Mhz, 4 GB RAM

 LIFT BASIC SAMPLE:
 ab -c 10 -n 3000
 http://localhost:8080/liftbasic-1.0-SNAPSHOT/user_mgt/login
 50 req/s

 LIFT BLANK SAMPLE:
 ab -c 10 -n 3000 http://localhost:8080/liftblank-1.0/
 120 req/s

 Obtained numbers were similar for all 3 servers.

 Using Stripes and rendering similar simple pages I'm getting much much
 higher scores (600 req/s).
 Using Grails I'm getting little worse results but I would say it is
 same league.
 I would expect much better performance from Lift which is written in
 scala.

 Why am I getting these low numbers ?
 Am I doing something wrong ?
 Any suggestion is very welcome.

 regards
 Daniel







 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Sample applications are somewhat slow - is Lift slow ?

2009-05-03 Thread David Pollak
On Sun, May 3, 2009 at 4:11 PM, Daniel Guryca dun...@gmail.com wrote:

 I have just tried mvn -Drun.mode=production jetty:run  ... but sadly still
 getting same performance.


I ran a simple test (the same command line as you) on my 2.67 Ghz Core i7
machine and saw 600 pages per second.  Granted, my machine's faster, but not
10x.

I'll spend some time putting together a complete benchmark tomorrow so we
can share the same executable and hopefully see the same results.




 Daniel


 On Sun, May 3, 2009 at 3:31 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Sun, May 3, 2009 at 6:18 AM, Daniel Guryca dun...@gmail.com wrote:

 Hi David,

 Thank you for your reply.

 How and where can I set production vs development mode in lift ?


 Set the run.mode system property to production  I do that with
 -Drun.mode=production when I start Jetty, but you may do it differently.

 Also, In the basic app, there's an RDBMS request for the User object on
 each page load and if you've got Derby configured, that's going to slow
 things down.




 Thank you again.
 Daniel

 On Sun, May 3, 2009 at 3:12 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Are you running Lift in production or development mode?
 I typically see 300 pages/second to 800 pages/second when I do
 benchmarks on dual core opteron machines.

 I'll look into this, but you should be seeing north of 300 pages per
 second with simple pages in Lift.


 On Sat, May 2, 2009 at 1:32 PM, Dunsun dun...@gmail.com wrote:


 Hi,

 I'm very new to lift and scala.

 I have made some Grails intranet applications but sadly Grails or
 better say GSP rendering part which is completely written in Groovy is
 a very slow beast (even in comparison with Rails or Django).

 For my future big project (heavy loaded site) I need something much
 faster.

 So I have made some quick and dirty Lift benchmarks using ApacheBench
 + Tomcat, GlassFish (from netbeans) and even Jetty.
 My machine - AMD X2 @ 2500Mhz, 4 GB RAM

 LIFT BASIC SAMPLE:
 ab -c 10 -n 3000
 http://localhost:8080/liftbasic-1.0-SNAPSHOT/user_mgt/login
 50 req/s

 LIFT BLANK SAMPLE:
 ab -c 10 -n 3000 http://localhost:8080/liftblank-1.0/
 120 req/s

 Obtained numbers were similar for all 3 servers.

 Using Stripes and rendering similar simple pages I'm getting much much
 higher scores (600 req/s).
 Using Grails I'm getting little worse results but I would say it is
 same league.
 I would expect much better performance from Lift which is written in
 scala.

 Why am I getting these low numbers ?
 Am I doing something wrong ?
 Any suggestion is very welcome.

 regards
 Daniel





 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp








 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp




 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---