PyHP improvements

New features in PyHP this week on the SVN version

  • it is now possible to set sessions timeout with PyHPSessionTimeout config variable
  • The Result object from the Database Layer is now iterable and will work as performing multiple .fetch() calls
  • pyhp.status is now exposed to return a status code different from HTTP_OK (200)
  • pyhp.content_type is now exposed to permit serving images and files different from text/html

Also some performance tests has been performed on mod_pyhp in production mode and the results are here available:

Time taken for tests:   1.419409 seconds
Complete requests:      500
Failed requests:        0
Write errors:           0
Non-2xx responses:      500 (hello_world.pyhp returns 500 on last pyhp)
Total transferred:      1558000 bytes
HTML transferred:       1344000 bytes
Requests per second:    352.26 [#/sec] (mean)
Time per request:       2.839 [ms] (mean)
Time per request:       2.839 [ms] (mean, across all concurrent requests)
Transfer rate:          1071.57 [Kbytes/sec] received

The results reveal to be quite good compared to other popular web development tools like WEBrick, mod_python and mod_php. Still they have a bunch of space for improvement to reach the “standard” ~600req/sec that more mature solutions obtain. Probably .pyhp files caching might be implemented to increase a lot performances.

I will provide a complete comparations to the other major web tools as soon as I have some time to set up a concrete test suite.

Leave a Reply

Your email address will not be published. Required fields are marked *