william_os4y (william_os4y) wrote,

Release 0.6 of Fast Asynchronous Python Wsgi Server

This new Fapws3 release fixes several bugs and bring the new "timers" feature.

As you can see in the sample, timers allow you to execute a recurrent tasks with a predefined frequency.
I'm using it in the sample to show you the performance impact it can has on a commit.
This is just a sample and I know that this will not fit every cases.

I'm currently working on a real "defer" where you can as Fapws3 to execute a tasks asynchronously from the rest of the application.
Current tests I'm doing are really promising, but wait and see ;-). Maybe for the next release.

I inform you that Fapws3 users' community is increasing and I frequently receive positive feedbacks, questions, ... .
Those questions are mainly coming from the lack of documentation regarding Fapws3.
Thus, I would request help from you for 2 main items.

People interested to provide some help have to contact me by email.

1. Documentation
To allow those people to better step-in Fapws3, I request help from you to improve the documentation of Fapws3.
This can be generic docs, howtos, trips, ...

To be pragmatic, send me your texts (html format) in text files, I'll add them on the website.
If the requests are too frequents, I will check to implement a wiki (but this is for later).

2. Tests script
I have the idea to implement a script that will perform some tests and send results on our website (www.fapws.org). Every people interested could be execute the tests and share the results with us, on our website.

The idea is to have a system like some linux distributions are doing: collecting some specific informations and share them by sending it to a webserver.
I plan to send them via an http POST request.

Basically, I'm thinking about a script that will use the "ApacheBenchamrk" tool and will test some basic features of Fapws3: return a list object, return an iterable object and return a file (you have then in the famous hello_world.py sample).
Thus the script will return data like " Req/sec, Concurrency Level, Time taken for tests, Complete requests, Failed requests:, Write errors:, Requests per second, Transfer rate"
More over the script must collect some critical info about the context of the machine: cpu model, libev_flag, kernel (uname -a), fapws3 version, libev version, python version.

This will gives an idea of the performance on different systems.
This will show on which system Fapws3 can runs.

To provide some ideas, I'm thinking about something like:

LOG="bench_`date +%Y%m%d%H%M%S`.log"
nice -n 20 ab -n100000 -c10 >> $LOG
nice -n 20 ab -n50000 -c10 >> $LOG
nice -n 20 ab -n50000 -c10 >> $LOG
#Parse $LOG
#Collect machine data
#send them to www.fapws.org

The server script will be something like:

# -*- coding: utf-8 -*-

import fapws._evwsgi as evwsgi
from fapws import base
from fapws.contrib import views
import os
import platform

def hello(environ, start_response):
    global switch
    start_response('200 OK', [('Content-Type','text/html')])
    return ["hello world!!"]

staticlong=views.Staticfile("long.txt") #this is the long test residing in hello_world's sample

def iteration(environ, start_response):
    global switch
    start_response('200 OK', [('Content-Type','text/html')])
    yield "hello"
    yield " "
    yield "world!!"

def getenv(environ, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    env['LIBEV_FLAGS']=os.environ.get('LIBEV_FLAGS','') #best would be to catch the default too
    #other parameters still to implement
    return [str(env)]

def start():
    evwsgi.start("", "8080")
    evwsgi.wsgi_cb(("/hello", hello))
    evwsgi.wsgi_cb(("/iterhello", iteration))
    evwsgi.wsgi_cb(("/long", staticlong))
    evwsgi.wsgi_cb(("/getenv", getenv))


if __name__=="__main__":

For sure, on the server side, a Fapws3 script must be written to collect all the feedbacks, store then in a small DB (preferable sqlite) and also present them into nice tables, and, maybe, some charts.

Tags: fapws3

  • Bux fixe in Fapws3

    First of all Fapws3 is not dead :-). I read some people saying that the project is no more updated and thus, should be dead. This is not true !!!…

  • Fapws3-11 is out

    Despite what said in February, I decide to release a new version of Fapws3 for Python-2.x. Indeed, thanks to several testors (Blacknoir, Wigunawan)…

  • Fapws3-0.10 is out

    Despite lot of progress on the python3 branch, I propose a new release of Fapws3 for python2.x. Indeed, since 1 year (date of the last stable…

Comments for this post were disabled by the author