People asked about the Goal. My goal is:

- preserve as much as possible of web2py syntax that we love
- much faster
- simpler code base (so far less than 300 lines of code in a single file)
- move more logic to apps and js libs
- web2py's goal was to make it simple to build complex web apps. web3py 
goal is the same but show that we learned from our mistakes (some, not all).

Some benchmarks on my laptop below. Real apps are likely to be slower 
because the actions may do more computation but this shows that the 
overhead of processing a simple template, a sessions, and performing a DB 
transaction, are about 1ms or less. Details depend on the architecture.

$ python3 web3py.py applications --workers 4

## bencharking a memoized API

$ ab -n 4000 -c 4 http://127.0.0.1:8000/todo/uuid
This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 400 requests
Completed 800 requests
Completed 1200 requests
Completed 1600 requests
Completed 2000 requests
Completed 2400 requests
Completed 2800 requests
Completed 3200 requests
Completed 3600 requests
Completed 4000 requests
Finished 4000 requests


Server Software:        gunicorn/19.9.0
Server Hostname:        127.0.0.1
Server Port:            8000

Document Path:          /todo/uuid
Document Length:        36 bytes

Concurrency Level:      4
Time taken for tests:   2.149 seconds
Complete requests:      4000
Failed requests:        0
Total transferred:      784000 bytes
HTML transferred:       144000 bytes
Requests per second:    1861.48 [#/sec] (mean)
Time per request:       2.149 [ms] (mean)
Time per request:       0.537 [ms] (mean, across all concurrent requests)
Transfer rate:          356.30 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   4.8      0     303
Processing:     1    2   8.3      2     305
Waiting:        1    1   6.8      1     304
Total:          1    2   9.6      2     305

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      2
  75%      2
  80%      2
  90%      3
  95%      3
  98%      4
  99%      4
 100%    305 (longest request)

## bencharking a page with a simple template and session counter

$ ab -n 4000 -c 4 http://127.0.0.1:8000/todo/index
This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 400 requests
Completed 800 requests
Completed 1200 requests
Completed 1600 requests
Completed 2000 requests
Completed 2400 requests
Completed 2800 requests
Completed 3200 requests
Completed 3600 requests
Completed 4000 requests
Finished 4000 requests


Server Software:        gunicorn/19.9.0
Server Hostname:        127.0.0.1
Server Port:            8000

Document Path:          /todo/index
Document Length:        828 bytes

Concurrency Level:      4
Time taken for tests:   4.448 seconds
Complete requests:      4000
Failed requests:        0
Total transferred:      4864636 bytes
HTML transferred:       3312000 bytes
Requests per second:    899.23 [#/sec] (mean)
Time per request:       4.448 [ms] (mean)
Time per request:       1.112 [ms] (mean, across all concurrent requests)
Transfer rate:          1067.98 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     2    4   2.3      3      47
Waiting:        2    4   2.1      3      46
Total:          2    4   2.3      4      47

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      5
  80%      5
  90%      7
  95%      8
  98%     12
  99%     14
 100%     47 (longest request)

## bencharking a GET api that accesses pydal + sqlite

$ ab -n 4000 -c 4 http://127.0.0.1:8000/todo/api
This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 400 requests
Completed 800 requests
Completed 1200 requests
Completed 1600 requests
Completed 2000 requests
Completed 2400 requests
Completed 2800 requests
Completed 3200 requests
Completed 3600 requests
Completed 4000 requests
Finished 4000 requests


Server Software:        gunicorn/19.9.0
Server Hostname:        127.0.0.1
Server Port:            8000

Document Path:          /todo/api
Document Length:        324 bytes

Concurrency Level:      4
Time taken for tests:   3.349 seconds
Complete requests:      4000
Failed requests:        0
Total transferred:      1940000 bytes
HTML transferred:       1296000 bytes
Requests per second:    1194.23 [#/sec] (mean)
Time per request:       3.349 [ms] (mean)
Time per request:       0.837 [ms] (mean, across all concurrent requests)
Transfer rate:          565.63 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:     1    3  16.8      2     534
Waiting:        1    3  14.5      2     533
Total:          1    3  16.8      3     534

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

## bencharking a static page

$ ab -n 4000 -c 4 http://127.0.0.1:8000/todo/static/hello.txt
This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 400 requests
Completed 800 requests
Completed 1200 requests
Completed 1600 requests
Completed 2000 requests
Completed 2400 requests
Completed 2800 requests
Completed 3200 requests
Completed 3600 requests
Completed 4000 requests
Finished 4000 requests


Server Software:        gunicorn/19.9.0
Server Hostname:        127.0.0.1
Server Port:            8000

Document Path:          /todo/static/hello.txt
Document Length:        12 bytes

Concurrency Level:      4
Time taken for tests:   3.347 seconds
Complete requests:      4000
Failed requests:        0
Total transferred:      964000 bytes
HTML transferred:       48000 bytes
Requests per second:    1194.97 [#/sec] (mean)
Time per request:       3.347 [ms] (mean)
Time per request:       0.837 [ms] (mean, across all concurrent requests)
Transfer rate:          281.24 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     1    3   2.3      2      53
Waiting:        1    3   1.9      2      47
Total:          1    3   2.3      3      53

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

Massimo

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to