<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>William&apos;s journal</title>
  <link>http://william-os4y.livejournal.com/</link>
  <description>William&apos;s journal - LiveJournal.com</description>
  <lastBuildDate>Sat, 14 Apr 2012 11:00:42 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>william_os4y</lj:journal>
  <lj:journalid>9136354</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/8880.html</guid>
  <pubDate>Sat, 14 Apr 2012 11:00:42 GMT</pubDate>
  <title>Fapws3-11 is out</title>
  <link>http://william-os4y.livejournal.com/8880.html</link>
  <description>Despite what said in February, I decide to release a new version of Fapws3 for Python-2.x. &lt;br /&gt;&lt;br /&gt;Indeed, thanks to several testors (Blacknoir, Wigunawan) Fapws3 was crashing on some systems. &lt;br /&gt;This was a nasty bug to solve, because I can&apos;t reproduce it on my machines. &lt;br /&gt;Since it&apos;s sounds ok now, I&apos;ve decided to still release a last :-) version for those willing to use it on Python-2.x lower than 2.7 (included). &lt;br /&gt;&lt;br /&gt;Pypi: &lt;a href=&apos;http://pypi.python.org/pypi/fapws3/0.11.dev&apos; rel=&apos;nofollow&apos;&gt;http://pypi.python.org/pypi/fapws3/0.11.dev&lt;/a&gt;&lt;br /&gt;TGZ: &lt;a href=&apos;https://github.com/william-os4y/fapws3/tarball/v0.11&apos; rel=&apos;nofollow&apos;&gt;https://github.com/william-os4y/fapws3/tarball/v0.11&lt;/a&gt;&lt;br /&gt;Github: &lt;a href=&apos;https://github.com/william-os4y/fapws3/tags&apos; rel=&apos;nofollow&apos;&gt;https://github.com/william-os4y/fapws3/tags&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you permit me, I&apos;m using this communication email to also share the status of the current development&apos;s branch: python3. &lt;br /&gt;Indeed, since February, I&apos;ve still progressed, and one of the main added feature concern the possibility to upload files into a temporary file (no more in memory). &lt;br /&gt;This close the issue of small system (low memory) having to deal with big uploads (bigger than the available memory). &lt;br /&gt;&lt;br /&gt;I&apos;m now focusing on testings and documentation. &lt;br /&gt;Indeed, by reading the comments, here and there, on internet about Fapws3, some people are complaining about the poor documentation. I thought that the (big) list of samples would be enough, but ... sounds clear it&apos;s not clear as a real documentation. &lt;br /&gt;This is a task on the list since a long time that I have to tackle. So, I&apos;ll do it for the Python3 release. &lt;br /&gt;As said by Python developers, this Python3 code is perfectly running on Python2.7. &lt;br /&gt;But the good news is that it has passed all tests on a NetBSD system having python2.6 :-). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All that said, I thanks all contributors having proposed interesting code, patches, tests results, recommendations, ... &lt;br /&gt;(cfr README)</description>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/8622.html</guid>
  <pubDate>Sun, 12 Feb 2012 11:41:33 GMT</pubDate>
  <title>Fapws3-0.10 is out</title>
  <link>http://william-os4y.livejournal.com/8622.html</link>
  <description>Despite lot of progress on the python3 branch, I propose a new release&lt;br /&gt;of Fapws3 for python2.x.&lt;br /&gt;&lt;br /&gt;Indeed, since 1 year (date of the last stable release), lot of new&lt;br /&gt;features have been added into Fapws :-).&lt;br /&gt;And several are coming from, you, the community !!! Thus, I first&lt;br /&gt;thank all contributors (code, tests, ...).&lt;br /&gt;This is a great achievement.&lt;br /&gt;More specifically, I will thank Stiletto, Liu Qishuai and Keith for&lt;br /&gt;their active contributions.&lt;br /&gt;&lt;br /&gt;To make it short, this release comes with the following new features:&lt;br /&gt;- support of tuple for callback output.&lt;br /&gt;- support of socket. Thanks to this, Fapws3 is serving webpages via a&lt;br /&gt;socket instead of a port.&lt;br /&gt;- better support for OSX&lt;br /&gt;&lt;br /&gt;You can download the tarfile from the github website:&lt;br /&gt;&lt;a href=&apos;https://github.com/william-os4y/fapws3&apos; rel=&apos;nofollow&apos;&gt;https://github.com/william-os4y/fapws3&lt;/a&gt;&lt;br /&gt;Or directly via the following link:&lt;br /&gt;&lt;a href=&apos;https://github.com/william-os4y/fapws3/tarball/v0.10&apos; rel=&apos;nofollow&apos;&gt;https://github.com/william-os4y/fapws3/tarball/v0.10&lt;/a&gt;&lt;br /&gt;Pypi users can grab it there too: pip install fapws3&lt;br /&gt;&lt;br /&gt;As said in the &lt;a href=&quot;http://groups.google.com/group/fapws&quot; rel=&quot;nofollow&quot;&gt;mailinglist&lt;/a&gt;, the python3 version of Fapws3 is nearly&lt;br /&gt;out (this release will be backward compatible with python2.7).&lt;br /&gt;Thus I plan to have 2 parallel branches so that there is a need for&lt;br /&gt;python2.5 or 2.6.&lt;br /&gt;This will change in the following months, but currently Fapws3 for&lt;br /&gt;python2.x is in the master branch.</description>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/8436.html</guid>
  <pubDate>Sat, 26 Mar 2011 10:41:20 GMT</pubDate>
  <title>Python tests used to compare different OSes. </title>
  <link>http://william-os4y.livejournal.com/8436.html</link>
  <description>A bit like Jaime has did with Ruby (&lt;a href=&apos;http://linbsd.org/&apos; rel=&apos;nofollow&apos;&gt;http://linbsd.org/&lt;/a&gt;), I&apos;ve used the python test&apos;s scripts to compare different OSes. &lt;br /&gt;&lt;br /&gt;All OSes are installed on the same machine (each is own partition) with default install parameters. All Hardware elements remains the same during the tests. The machine is a 4 years old PC running AMD CPU 2.4GHZ with 2GB Ram. &lt;br /&gt;&lt;br /&gt;Tests were made with the latest Python2 release: 2.7.1. &lt;br /&gt;&lt;br /&gt;To avoid binary packages glitches, I&apos;ve downloaded and compiled Python myself on each OSes by executing the standard ./configure; make. Compiler, ... are the default one proposed by each OSes. &lt;br /&gt;&lt;br /&gt;To get the time spent on each test, I&apos;ve just add 1 line in the regretest.py script provided within the python tar file:&lt;br /&gt;line 581:     print test_times&lt;br /&gt;In other words, at the end of the tests, this print a list of tuple: (time spent, test name). &lt;br /&gt;&lt;br /&gt;I&apos;ve tested it with &lt;a href=&quot;http://www.netbsd.org&quot; rel=&quot;nofollow&quot;&gt;NetBSD-5.1&lt;/a&gt;, &lt;a href=&quot;http://www.freebsd.org&quot; rel=&quot;nofollow&quot;&gt;FreeBSD 8.2&lt;/a&gt;, &lt;a href=&quot;http://www.ubuntu.com&quot; rel=&quot;nofollow&quot;&gt;Ubuntu 10.10&lt;/a&gt; and &lt;a href=&quot;http://www.archlinux.org&quot; rel=&quot;nofollow&quot;&gt;Archlinux&lt;/a&gt;. The Archlinux system has been fully updated just before the tests, I&apos;ll thus call it Arch 03/2011. &lt;br /&gt;&lt;br /&gt;To be detailed, the command used after compilation was:&lt;br /&gt;./python -Wd -3 -E -tt Lib/test/regrtest.py -ucpu&lt;br /&gt;&lt;br /&gt;(This is was you will execute if you perfrom a &quot;make test&quot;). I&apos;ve just focussed the tests on CPU set of tests. &lt;br /&gt;&lt;br /&gt;The global results are:&lt;br /&gt;------------------------&lt;br /&gt;&lt;br /&gt;Netbsd 5.1  wins  64&lt;br /&gt;FreeBSD 8.2  wins  14&lt;br /&gt;Ubuntu 10.10  wins  84&lt;br /&gt;Arch 03/2011  wins  196&lt;br /&gt;&lt;br /&gt;But having 2 results very close to each other does not really means that 1 OS is significantly better than the others. To take this into account, I&apos;ve introduced the tolerance principle. This means that every OSes having a result very close (x percent) to the best result will also win the test. &lt;br /&gt;&lt;br /&gt;If we accept a tolerance of 5%, the results are:&lt;br /&gt;Netbsd 5.1  wins  97&lt;br /&gt;FreeBSD 8.2  wins  34&lt;br /&gt;Ubuntu 10.10  wins  145&lt;br /&gt;Arch 03/2011  wins  245&lt;br /&gt;&lt;br /&gt;If we accept a tolerance of 10%, the results are:&lt;br /&gt;Netbsd 5.1  wins  136&lt;br /&gt;FreeBSD 8.2  wins  54&lt;br /&gt;Ubuntu 10.10  wins  186&lt;br /&gt;Arch 03/2011  wins  275&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The detailed results are:&lt;br /&gt;----------------------------------&lt;br /&gt;(Livejournal does not allow me to post the full reports, because they are too long. I, thus, post a subset of them. PLease contact me (william _dot os4y at_ gmail dot_ com)if you want the full one by email). &lt;br /&gt;&lt;br /&gt;With tolerance 0: &lt;br /&gt;=============&lt;br /&gt;&lt;pre&gt;test_abc
	Netbsd 5.1:	0.06109,	delta =   0.00%
	FreeBSD 8.2:	0.06670,	delta =   9.18%
	Ubuntu 10.10:	0.06814,	delta =  11.54%
	Arch 03/2011:	0.08548,	delta =  39.92%
winner is:  Netbsd 5.1

test_abstract_numbers
	Netbsd 5.1:	0.00120,	delta =   0.16%
	FreeBSD 8.2:	0.00256,	delta = 114.16%
	Ubuntu 10.10:	0.00140,	delta =  17.51%
	Arch 03/2011:	0.00119,	delta =   0.00%
winner is:  Arch 03/2011

test_aepack
	Netbsd 5.1:	NA
	FreeBSD 8.2:	NA
	Ubuntu 10.10:	NA
	Arch 03/2011:	NA
no winners

test_aifc
	Netbsd 5.1:	1.49062,	delta =  28.61%
	FreeBSD 8.2:	1.17668,	delta =   1.52%
	Ubuntu 10.10:	1.19231,	delta =   2.87%
	Arch 03/2011:	1.15902,	delta =   0.00%
winner is:  Arch 03/2011

test_al
	Netbsd 5.1:	NA
	FreeBSD 8.2:	NA
	Ubuntu 10.10:	NA
	Arch 03/2011:	NA
no winners

test_anydbm
	Netbsd 5.1:	0.00736,	delta =   0.00%
	FreeBSD 8.2:	0.01428,	delta =  94.00%
	Ubuntu 10.10:	1.17291,	delta = 15838.95%
	Arch 03/2011:	0.03939,	delta = 435.24%
winner is:  Netbsd 5.1

...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;- With 5% tolerance: &lt;br /&gt;================&lt;br /&gt;&lt;pre&gt;test_abc
	Netbsd 5.1:	0.06109,	delta =   0.00%
	FreeBSD 8.2:	0.06670,	delta =   9.18%
	Ubuntu 10.10:	0.06814,	delta =  11.54%
	Arch 03/2011:	0.08548,	delta =  39.92%
winner is:  Netbsd 5.1

test_abstract_numbers
	Netbsd 5.1:	0.00120,	delta =   0.16%
	FreeBSD 8.2:	0.00256,	delta = 114.16%
	Ubuntu 10.10:	0.00140,	delta =  17.51%
	Arch 03/2011:	0.00119,	delta =   0.00%
winners are:  Netbsd 5.1, Arch 03/2011

test_aepack
	Netbsd 5.1:	NA
	FreeBSD 8.2:	NA
	Ubuntu 10.10:	NA
	Arch 03/2011:	NA
no winners

test_aifc
	Netbsd 5.1:	1.49062,	delta =  28.61%
	FreeBSD 8.2:	1.17668,	delta =   1.52%
	Ubuntu 10.10:	1.19231,	delta =   2.87%
	Arch 03/2011:	1.15902,	delta =   0.00%
winners are:  FreeBSD 8.2, Ubuntu 10.10, Arch 03/2011

test_al
	Netbsd 5.1:	NA
	FreeBSD 8.2:	NA
	Ubuntu 10.10:	NA
	Arch 03/2011:	NA
no winners

test_anydbm
	Netbsd 5.1:	0.00736,	delta =   0.00%
	FreeBSD 8.2:	0.01428,	delta =  94.00%
	Ubuntu 10.10:	1.17291,	delta = 15838.95%
	Arch 03/2011:	0.03939,	delta = 435.24%
winner is:  Netbsd 5.1

...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;- With 10% tolrerance: &lt;br /&gt;==================&lt;br /&gt;&lt;pre&gt;test_abc
	Netbsd 5.1:	0.06109,	delta =   0.00%
	FreeBSD 8.2:	0.06670,	delta =   9.18%
	Ubuntu 10.10:	0.06814,	delta =  11.54%
	Arch 03/2011:	0.08548,	delta =  39.92%
winners are:  Netbsd 5.1, FreeBSD 8.2

test_abstract_numbers
	Netbsd 5.1:	0.00120,	delta =   0.16%
	FreeBSD 8.2:	0.00256,	delta = 114.16%
	Ubuntu 10.10:	0.00140,	delta =  17.51%
	Arch 03/2011:	0.00119,	delta =   0.00%
winners are:  Netbsd 5.1, Arch 03/2011

test_aepack
	Netbsd 5.1:	NA
	FreeBSD 8.2:	NA
	Ubuntu 10.10:	NA
	Arch 03/2011:	NA
no winners

test_aifc
	Netbsd 5.1:	1.49062,	delta =  28.61%
	FreeBSD 8.2:	1.17668,	delta =   1.52%
	Ubuntu 10.10:	1.19231,	delta =   2.87%
	Arch 03/2011:	1.15902,	delta =   0.00%
winners are:  FreeBSD 8.2, Ubuntu 10.10, Arch 03/2011

test_al
	Netbsd 5.1:	NA
	FreeBSD 8.2:	NA
	Ubuntu 10.10:	NA
	Arch 03/2011:	NA
no winners

test_anydbm
	Netbsd 5.1:	0.00736,	delta =   0.00%
	FreeBSD 8.2:	0.01428,	delta =  94.00%
	Ubuntu 10.10:	1.17291,	delta = 15838.95%
	Arch 03/2011:	0.03939,	delta = 435.24%
winner is:  Netbsd 5.1

...
&lt;/pre&gt;</description>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/7972.html</guid>
  <pubDate>Sat, 22 Jan 2011 17:17:27 GMT</pubDate>
  <title>Release of FAPWS3-0.9</title>
  <link>http://william-os4y.livejournal.com/7972.html</link>
  <description>I&apos;m really happy to announce a new release of Fapws3: 0.9.&lt;br /&gt;&lt;br /&gt;This release contains several fixes and some interesting new features:&lt;br /&gt;- Avoid a crash in case you forget the &quot;return&quot; command in your callback method&lt;br /&gt;- a better django adaptor (look in the samples)&lt;br /&gt;- a session object which allow you to associate a python object&lt;br /&gt;(typically a dictionary) to a session ID&lt;br /&gt;- a cookie parser (in base.py)&lt;br /&gt;- better management of connections broken by the client&lt;br /&gt;- a new multipart object allowing you to better manage uploads&lt;br /&gt;- a new Html form generator: SimpleForm&lt;br /&gt;&lt;br /&gt;Several contributions from lot of people. I  would specifically thanks:&lt;br /&gt;- Vincent for the contribution of SimpleForm and Session object&lt;br /&gt;- Maxim for the Django adapter&lt;br /&gt;- Shigin for the broken/slow connections&lt;br /&gt;- Satori for the coding layout/organisation&lt;br /&gt;- ... and several other persons.&lt;br /&gt;&lt;br /&gt;I also use this email to present the last performance test&apos;s results&lt;br /&gt;I&apos;ve made to compare Fapws3 and Cherokee+uwsgi.&lt;br /&gt;Both a really close, but Fapws3 eats much less memory. Fapws3 is&lt;br /&gt;amongst the best :-)&lt;br /&gt;&lt;br /&gt;Such memory impact was the key element for alarm system on which I&apos;ve&lt;br /&gt;contributed (funny project).&lt;br /&gt;&lt;br /&gt;Lot of work since the last release, but lot of fun and very good collaborations.&lt;br /&gt;Thanks all for that.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For the next release I would like to improve the algorithm of the file upload.&lt;br /&gt;Currently Fapws3 load the whole file before giving back the hand to&lt;br /&gt;the python callback and the multipart object.&lt;br /&gt;To optimise memory foot print, it should directly use the selected multipart object.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;william&lt;br /&gt;&lt;br /&gt;github: &lt;a href=&apos;https://github.com/william-os4y/fapws3/&apos; rel=&apos;nofollow&apos;&gt;https://github.com/william-os4y/fapws3/&lt;/a&gt;&lt;br /&gt;website: &lt;a href=&apos;http://www.fapws.org/&apos; rel=&apos;nofollow&apos;&gt;http://www.fapws.org/&lt;/a&gt;&lt;br /&gt;PyPI: &lt;a href=&apos;http://pypi.python.org/pypi/fapws3/0.9.dev&apos; rel=&apos;nofollow&apos;&gt;http://pypi.python.org/pypi/fapws3/0.9.dev&lt;/a&gt;</description>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/7769.html</guid>
  <pubDate>Mon, 22 Nov 2010 21:30:29 GMT</pubDate>
  <link>http://william-os4y.livejournal.com/7769.html</link>
  <description>I&apos;m happy to announce the release of Fapws-0.8.1.&lt;br /&gt;This release fix several fixes: datetime: setup.py, ...&lt;br /&gt;&lt;br /&gt;On the other hand I&apos;m really happy to see more and more positive&lt;br /&gt;feedbacks about Fapws  ;-).&lt;br /&gt;&lt;br /&gt;Just to point one, I would mention a public website:&lt;br /&gt;www.hannut-chapter.be running Fapws-0.8 since 60 days today ;-)&lt;br /&gt;Moreover, this site is directly connected to Internet (no proxy).&lt;br /&gt;Since 60 days, no issues, no memory leaks !!!!&lt;br /&gt;It runs on a very cheap shared server with few HW resources.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Visit us on www.fapws.org&lt;br /&gt;download: &lt;a href=&apos;https://github.com/william-os4y/fapws3/&apos; rel=&apos;nofollow&apos;&gt;https://github.com/william-os4y/fapws3/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;William</description>
  <lj:security>public</lj:security>
  <lj:reply-count>7</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/7609.html</guid>
  <pubDate>Tue, 27 Jul 2010 08:27:46 GMT</pubDate>
  <title>Release 0.6 of Fast Asynchronous Python Wsgi Server</title>
  <link>http://william-os4y.livejournal.com/7609.html</link>
  <description>This new Fapws3 release fixes several bugs and bring the new &amp;quot;timers&amp;quot; feature.&lt;br /&gt;&lt;a href=&apos;http://github.com/william-os4y/fapws3&apos; rel=&apos;nofollow&apos;&gt;http://github.com/william-os4y/fapws3&lt;/a&gt;&lt;br /&gt;&lt;a href=&apos;http://pypi.python.org/pypi/fapws3/&apos; rel=&apos;nofollow&apos;&gt;http://pypi.python.org/pypi/fapws3/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As you can see in the sample, timers allow you to execute a recurrent tasks with a predefined frequency.&lt;br /&gt;I&apos;m using it in the sample to show you the performance impact it can has on a commit.&lt;br /&gt;This is just a sample and I know that this will not fit every cases.&lt;br /&gt;&lt;br /&gt;I&apos;m currently working on a real &amp;quot;defer&amp;quot; where you can as Fapws3 to execute a tasks asynchronously from the rest of the application.&lt;br /&gt;Current tests I&apos;m doing are really promising, but wait and see ;-). Maybe for the next release.&lt;br /&gt;&lt;br /&gt;I inform you that Fapws3 users&apos; community is increasing and I frequently receive positive feedbacks, questions, ... .&lt;br /&gt;Those questions are mainly coming from the lack of documentation regarding Fapws3.&lt;br /&gt;Thus, I would request help from you for 2 main items.&lt;br /&gt;&lt;br /&gt;People interested to provide some help have to contact me by email.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;1. Documentation&lt;br /&gt;------------------------------&lt;br /&gt;To allow those people to better step-in Fapws3, I request help from you to improve the documentation of Fapws3.&lt;br /&gt;This can be generic docs, howtos, trips, ...&lt;br /&gt;&lt;br /&gt;To be pragmatic, send me your texts (html format) in text files, I&apos;ll add them on the website.&lt;br /&gt;If the requests are too frequents, I will check to implement a wiki (but this is for later).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Tests script&lt;br /&gt;------------------------&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;I plan to send them via an http POST request. &lt;br /&gt;&lt;br /&gt;Basically, I&apos;m thinking about a script that will use the &amp;quot;ApacheBenchamrk&amp;quot; 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).&lt;br /&gt;Thus the script will return data like &amp;quot; Req/sec, Concurrency Level, Time taken for tests, Complete requests, Failed requests:, Write errors:, Requests per second, Transfer rate&amp;quot;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;This will gives an idea of the performance on different systems.&lt;br /&gt;This will show on which system Fapws3 can runs.&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To provide some ideas, I&apos;m thinking about something like:&lt;br /&gt;&lt;pre&gt;

LOG=&amp;quot;bench_`date +%Y%m%d%H%M%S`.log&amp;quot;
nice -n 20 ab -n100000 -c10 http://127.0.0.1:8080/hello &amp;gt;&amp;gt; $LOG
nice -n 20 ab -n50000 -c10 http://127.0.0.1:8080/long &amp;gt;&amp;gt; $LOG
nice -n 20 ab -n50000 -c10 http://127.0.0.1:8080/iteration &amp;gt;&amp;gt; $LOG
#Parse $LOG
#Collect machine data
#send them to www.fapws.org
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The server script will be something like:&lt;br /&gt;&lt;pre&gt;

# -*- 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(&apos;200 OK&apos;, [(&apos;Content-Type&apos;,&apos;text/html&apos;)])
    switch=1
    evwsgi.trigger_idle()
    return [&amp;quot;hello world!!&amp;quot;]

staticlong=views.Staticfile(&amp;quot;long.txt&amp;quot;) #this is the long test residing in hello_world&apos;s sample

def iteration(environ, start_response):
    global switch
    start_response(&apos;200 OK&apos;, [(&apos;Content-Type&apos;,&apos;text/html&apos;)])
    yield &amp;quot;hello&amp;quot;
    yield &amp;quot; &amp;quot;
    yield &amp;quot;world!!&amp;quot;

def getenv(environ, start_response):
    start_response(&apos;200 OK&apos;, [(&apos;Content-Type&apos;,&apos;text/html&apos;)])
    env={}
    env[&apos;LIBEV_FLAGS&apos;]=os.environ.get(&apos;LIBEV_FLAGS&apos;,&apos;&apos;) #best would be to catch the default too
    env[&apos;libev&apos;]=evwsgi.libev_version()
    env[&apos;python&apos;]=platform.python_version()
    env[&apos;uname&apos;]=platform.uname()
    #other parameters still to implement
    return [str(env)]
   

def start():
    evwsgi.start(&amp;quot;0.0.0.0&amp;quot;, &amp;quot;8080&amp;quot;)
    evwsgi.set_base_module(base)
   
    evwsgi.wsgi_cb((&amp;quot;/hello&amp;quot;, hello))
    evwsgi.wsgi_cb((&amp;quot;/iterhello&amp;quot;, iteration))
    evwsgi.wsgi_cb((&amp;quot;/long&amp;quot;, staticlong))
    evwsgi.wsgi_cb((&amp;quot;/getenv&amp;quot;, getenv))

    evwsgi.set_debug(0)   
    evwsgi.run()
   

if __name__==&amp;quot;__main__&amp;quot;:
    start()
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;W.</description>
  <category>fapws3</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/7342.html</guid>
  <pubDate>Tue, 25 May 2010 16:12:45 GMT</pubDate>
  <title>Release 0.5 of Fast Asynchronous Python Wsgi Server</title>
  <link>http://william-os4y.livejournal.com/7342.html</link>
  <description>I&apos;m pleased to announce the release of Fapws3-0.5.&lt;br /&gt;This release fix several big fixes mainly for the iterator objects.&lt;br /&gt;&lt;br /&gt;Please note that, to better match the wsgi recommendations, the method &quot;evwsgi.start&quot; requires now 2 strings.&lt;br /&gt;Thanks to adapt your existing Fapws server accordingly.&lt;br /&gt;&lt;br /&gt;I would also report you some user&apos;s feedbacks:&lt;br /&gt;- Fapws, and thus libev, have been compiled on AIX 5.3&lt;br /&gt;- Fapws is serving (without any frontend like pound, nginx, lighttd, ... ) a django website since +40 days without any interruptions. This website has +- 40 registred users logging and logout every days; and about 200 anonymous visitors per day.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Amongst others, thanks to Marc and Tamas for their contributions&lt;br /&gt;&lt;br /&gt;For further details, I recommend you our website: &lt;a href=&apos;http://www.fapws.org&apos; rel=&apos;nofollow&apos;&gt;http://www.fapws.org&lt;/a&gt; and our github page: &lt;a href=&apos;http://github.com/william-os4y/fapws3&apos; rel=&apos;nofollow&apos;&gt;http://github.com/william-os4y/fapws3&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Download: &lt;a href=&apos;http://github.com/william-os4y/fapws3/downloads&apos; rel=&apos;nofollow&apos;&gt;http://github.com/william-os4y/fapws3/downloads&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Have fun&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;William</description>
  <lj:security>public</lj:security>
  <lj:reply-count>4</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/6918.html</guid>
  <pubDate>Thu, 05 Nov 2009 15:37:52 GMT</pubDate>
  <title>Non blocking connections</title>
  <link>http://william-os4y.livejournal.com/6918.html</link>
  <description>By testing my Fapws3 webserver on different type of systems, I&apos;ve discovered a strange behaviour of the Linux kernels. &lt;br /&gt;&lt;br /&gt;Indeed on Linux, despite my dfferent tests, I&apos;ve never had the &quot;EAGAIN&quot; error. On the opposite, on OpenBSD 4.6 I receive a lot of those errors during the write process. &lt;br /&gt;&lt;br /&gt;OpenBSD is reporting that this error pop&apos;s-up because the resource is not available. Within a non-blocking context this sounds logic. Indeed, the resource can still be busy with the previous write when we try to send the new one. &lt;br /&gt;&lt;br /&gt;Now the valid question is why we don&apos;t have such behaviour on the linux kernel ?&lt;br /&gt;&lt;br /&gt;I must deeper investigate, but if someone has a explanation, I&apos;m interested.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;William&lt;br /&gt;&lt;a href=&apos;http://github.com/william-os4y/&apos; rel=&apos;nofollow&apos;&gt;http://github.com/william-os4y/&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ps:&lt;br /&gt;I&apos;ve used OpenBSD-4.6&lt;br /&gt;Linux-2.6.31 from Archlinux and Ubuntu</description>
  <lj:security>public</lj:security>
  <lj:reply-count>10</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/6686.html</guid>
  <pubDate>Fri, 17 Jul 2009 08:08:53 GMT</pubDate>
  <title>Release of Fapws3-0.3 (Fast asynchronous python wsgi server)</title>
  <link>http://william-os4y.livejournal.com/6686.html</link>
  <description>I&apos;m happy to announce the release of Fapws3-0.3. &lt;br /&gt;&lt;br /&gt;This release does not bring new features, but fix several bugs. &lt;br /&gt;&lt;br /&gt;Let&apos;s have fun with that peace of code ;-)&lt;br /&gt;&lt;br /&gt;You can get it from my GitHub repository: &lt;a href=&apos;http://github.com/william-os4y/fapws3/&apos; rel=&apos;nofollow&apos;&gt;http://github.com/william-os4y/fapws3/&lt;/a&gt;&lt;br /&gt;Or directly via the following link: &lt;a href=&apos;http://github.com/william-os4y/fapws3/tarball/v0.3.1&apos; rel=&apos;nofollow&apos;&gt;http://github.com/william-os4y/fapws3/tarball/v0.3.1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For discussions, ideas, ... feel free to join the mailinglist: &lt;a href=&apos;http://groups.google.com/group/fapws&apos; rel=&apos;nofollow&apos;&gt;http://groups.google.com/group/fapws&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I&apos;ve tested it with Python 2.4, 2.5, 2.6 with libev-3.6 on linux and freebsd machines (with and without pound). &lt;br /&gt;&lt;br /&gt;I&apos;m using it for production websites native or with Django. Contributions to have Fapws  running with other wsgi framework are welcome. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;William</description>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/6485.html</guid>
  <pubDate>Wed, 25 Feb 2009 20:29:22 GMT</pubDate>
  <title>FAPWS-0.2 (WSGI server based on libev)</title>
  <link>http://william-os4y.livejournal.com/6485.html</link>
  <description>I&apos;m really happy to announce the release of FAPWS3-0.2 a WSGI webserver based on libev. &lt;br /&gt;&lt;br /&gt;This release include several bugfixes. &lt;br /&gt;&lt;br /&gt;You can got it on my github website: &lt;a href=&apos;http://github.com/william-os4y/fapws3/tarball/v0.2&apos; rel=&apos;nofollow&apos;&gt;http://github.com/william-os4y/fapws3/tarball/v0.2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Most importantly, with this release FAPWS becomes much more stable and useful. &lt;br /&gt;&lt;br /&gt;I&apos;ve tested it with many different type of configurations and it has always resisted to my differents Stress tests (with ApacheBenchmark tool):&lt;br /&gt;- Django webpage with a complex (and ugly) sql command with 300 concurrent requests&lt;br /&gt;- Simple Django webpage with 300 concurrents requets&lt;br /&gt;- for a simple Jpg files I&apos;ve got 3524#/sec. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks to give it a trial. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;William&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ANNEXES:&lt;br /&gt;========&lt;br /&gt;&lt;br /&gt;Tests with 300 concurrent requests.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Heavy Django page:&lt;br /&gt;------------------&lt;br /&gt;&lt;pre&gt;
Server Software:        fapws3/0.2
Server Hostname:        127.0.0.1 
Server Port:            8084      

Document Path:          /acts/2009/
Document Length:        24554 bytes     

Concurrency Level:      300
Time taken for tests:   166.334 seconds
Complete requests:      1000            
Failed requests:        0              
Write errors:           0              
Total transferred:      19772014 bytes 
HTML transferred:       19667754 bytes 
Requests per second:    4.81 [#/sec] (mean)
Time per request:       62375.084 [ms] (mean)
Time per request:       207.917 [ms] (mean, across all concurrent requests)
Transfer rate:          116.08 [Kbytes/sec] received                       
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Much more simple Django page&lt;br /&gt;-----------------------------&lt;br /&gt;&lt;pre&gt;
Server Software:        fapws3/0.2
Server Hostname:        127.0.0.1 
Server Port:            8084      

Document Path:          /membres/Off/
Document Length:        4918 bytes

Concurrency Level:      300
Time taken for tests:   23.178 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      5290304 bytes
HTML transferred:       5154064 bytes
Requests per second:    43.14 [#/sec] (mean)
Time per request:       6953.497 [ms] (mean)
Time per request:       23.178 [ms] (mean, across all concurrent requests)
Transfer rate:          222.89 [Kbytes/sec] received
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Simple jpg file&lt;br /&gt;----------------&lt;br /&gt;&lt;pre&gt;
Server Software:        fapws3/0.2
Server Hostname:        127.0.0.1 
Server Port:            8084      

Document Path:          /static/images/img04.jpg
Document Length:        13974 bytes

Concurrency Level:      300
Time taken for tests:   28.369 seconds
Complete requests:      100000
Failed requests:        0
Write errors:           0
Total transferred:      1416300000 bytes
HTML transferred:       1397400000 bytes
Requests per second:    3524.99 [#/sec] (mean)
Time per request:       85.107 [ms] (mean)
Time per request:       0.284 [ms] (mean, across all concurrent requests)
Transfer rate:          48754.28 [Kbytes/sec] received
&lt;/pre&gt;</description>
  <lj:security>public</lj:security>
  <lj:reply-count>10</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/6264.html</guid>
  <pubDate>Tue, 30 Dec 2008 11:20:58 GMT</pubDate>
  <title>Fapws3-0.1 versus Fapws2-0.3: First comparison</title>
  <link>http://william-os4y.livejournal.com/6264.html</link>
  <description>As promised, you can see here under results of performance tests I&apos;ve made. &lt;br /&gt;&lt;p&gt;&lt;pre&gt;
&lt;b&gt;Machine&lt;/b&gt;: AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ A
&lt;b&gt;OS&lt;/b&gt;: Linux 2.6.27-ARCH #1 SMP PREEMPT
&lt;b&gt;Benchmark tool&lt;/b&gt;: ApacheBench, Version 2.3 ($Revision: 655654 $)
&lt;b&gt;Python&lt;/b&gt;: Python 2.6.1
&lt;b&gt;Libev&lt;/b&gt;: libev-3.49
&lt;b&gt;Methodology&lt;/b&gt;: run webserver and ApacheBench (&quot;ab&quot; in short) on the same host; 
but I use &quot;nice -n20&quot; for &quot;ab&quot;. Wait enough time between each run to assure all &quot;waiting&quot; 
connections  will be effectively closed (+- 1 minute on my machine). Execute each 
tests 5 times and take one &quot;ab&quot; report which is representative (to avoid abnormal good/bad 
results). 
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Observations&lt;/h4&gt; (results are in the annexes):&lt;br /&gt;&lt;pre&gt;
&lt;b&gt;Errors&lt;/b&gt;: we don&apos;t see it in the results here bellow, but neither Fapws2 neither Fapws3 have 
generated errors.
&lt;b&gt;Requests per seconds&lt;/b&gt;: Fapws3 is a bit better(10%) than Fapws2 for low number of concurrent 
requests. Above 500 concurrent requests Fapws2 is a bit better (5%).
&lt;b&gt;mean&lt;/b&gt;: Fapws3 has a better mean than Fapws2 for all tests.
&lt;b&gt;median&lt;/b&gt;: Fapws3 is better for all tests
&lt;b&gt;Standard deviation&lt;/b&gt;: Both are equal until 100 concurrent requests. Above Fapws2 is better. 
&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;To summarize I would say that, thanks to libev, Fapws3 is not too bad. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;
As comparison, I&apos;ve added results of cherrypy (threaded). By the way Charrypy is not bad 
at all ;-). We can see that, as expected (cherrypy is fully written with python), 
that number of requests per seconds are much lower than Fapws. We also see the impact of 
a threaded system on the Standard Deviation. With such a big standard deviation, user&apos;s 
perception can be quite various. 
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;William&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Annexes&lt;/h4&gt;&lt;br /&gt;&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;&lt;th&gt;Fapws3-0.1&lt;/th&gt;&lt;th&gt;Fapws2-0.3&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
Server Software:        fapws3/0.1
Document Path:          /test
Document Length:        13 bytes
Concurrency Level:      10
Complete requests:      10000        
Requests per second:    5565.03 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:          1    2   0.7      2      17
&lt;/pre&gt;&lt;/td&gt;
&lt;td&gt;&lt;pre&gt;
Server Software:        fapws2/0.3
Document Path:          /hello
Document Length:        13 bytes
Concurrency Level:      10
Complete requests:      10000        
Requests per second:    4964.60 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:          1    2   0.0      2       3
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
Server Software:        fapws3/0.1
Document Path:          /test
Document Length:        13 bytes
Concurrency Level:      100
Complete requests:      10000        
Requests per second:    5798.24 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:          1    3   4.4      2     212
&lt;/pre&gt;&lt;/td&gt;
&lt;td&gt;&lt;pre&gt;
Server Software:        fapws2/0.3
Document Path:          /hello
Document Length:        13 bytes
Concurrency Level:      100
Complete requests:      10000        
Requests per second:    4847.79 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:         12   21   1.1     21      28
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
Server Software:        fapws3/0.1
Document Path:          /test
Document Length:        13 bytes
Concurrency Level:      500
Complete requests:      10000        
Requests per second:    4464.30 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:          2   20  36.1      3     368
&lt;/pre&gt;&lt;/td&gt;
&lt;td&gt;&lt;pre&gt;
Server Software:        fapws2/0.3
Document Path:          /hello
Document Length:        13 bytes
Concurrency Level:      500
Complete requests:      10000
Requests per second:    4818.79 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:         85  103   2.6    104     107
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
Server Software:        fapws3/0.1
Document Path:          /test
Document Length:        13 bytes
Concurrency Level:      1000
Complete requests:      10000        
Requests per second:    4300.18 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:         60  120  46.3     92     220
&lt;/pre&gt;&lt;/td&gt;
&lt;td&gt;&lt;pre&gt;
Server Software:        fapws2/0.3
Document Path:          /hello
Document Length:        13 bytes
Concurrency Level:      1000
Complete requests:      10000
Requests per second:    4594.43 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:         11  154  92.7    221     680
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;&lt;th&gt;Charrypy-3.1.1&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
Server Software:        CherryPy/3.1.1
Document Path:          /
Document Length:        13 bytes
Concurrency Level:      10
Complete requests:      10000        
Requests per second:    1040.73 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:          1    5 105.4      3    9608
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
Server Software:        CherryPy/3.1.1
Document Path:          /
Document Length:        13 bytes
Concurrency Level:      100
Complete requests:      10000        
Requests per second:    1910.31 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:          0   26 268.2      3    4884
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
Server Software:        CherryPy/3.1.1
Document Path:          /
Document Length:        13 bytes
Concurrency Level:      500
Complete requests:      10000        
Requests per second:    1250.71 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:          1  228 659.8      5    6243
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
Server Software:        CherryPy/3.1.1
Document Path:          /
Document Length:        13 bytes
Concurrency Level:      1000
Complete requests:      10000
Requests per second:    1518.28 [#/sec] (mean)
Connection Times (ms)
              min  mean[+/-sd] median   max
Total:          1  275 865.1      5    6324
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description>
  <lj:security>public</lj:security>
  <lj:reply-count>13</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/6064.html</guid>
  <pubDate>Sun, 28 Dec 2008 13:51:15 GMT</pubDate>
  <title>Fapws3-0.1 has just been released</title>
  <link>http://william-os4y.livejournal.com/6064.html</link>
  <description>Hello all, &lt;br /&gt;&lt;br /&gt;After several months of hesitations, work, trials and tests, I&apos;m very happy to announce the first release of Fapws3. &lt;br /&gt;&lt;br /&gt;Fapws3 is a full re-write of Fapws2 but based on &lt;a href=&quot;http://software.schmorp.de/pkg/libev.html&quot; rel=&quot;nofollow&quot;&gt;libev&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Indeed, since the API changes in libevent (&amp;gt;1.4.0) we were forced to modify the libevent sources before compiling it, just for the usage of Fapws2. This was not really comfortable. &lt;br /&gt;Moreover, libev is incredibly very well &lt;a href=&quot;http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod&quot; rel=&quot;nofollow&quot;&gt;documented&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Fapws2 will stay open just for bug fixing, but my future work will now be focused on Fapws3. &lt;br /&gt;&lt;br /&gt;This has been successfully tested on Linux 2.6.27 and FreeBSD-6.1 with libev-3.49. &lt;br /&gt;&lt;br /&gt;Benchmark between Fapws2 and Fapws3 is on going and will be published as soon as possible.&lt;br /&gt;&lt;br /&gt;And because the number of people willing to discuss about Fapws is increasing, I&apos;ve setup a dedicated mailing-list: &lt;a href=&apos;http://groups.google.com/group/fapws&apos; rel=&apos;nofollow&apos;&gt;http://groups.google.com/group/fapws&lt;/a&gt;&lt;br /&gt;Feel free to join ;-). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;William&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ANNEXES:&lt;br /&gt;--------&lt;br /&gt;&lt;br /&gt;source repository for &lt;a href=&quot;http://github.com/william-os4y/fapws3/tree/v0.1&quot; rel=&quot;nofollow&quot;&gt;version 0.1&lt;/a&gt;&lt;br /&gt;Download &lt;a href=&quot;http://github.com/william-os4y/fapws3/tarball/v0.1/&quot; rel=&quot;nofollow&quot;&gt;fapws3-0.1&lt;/a&gt; as a tarball&lt;br /&gt;Git repository: &lt;a href=&apos;http://github.com/william-os4y/fapws3/tree/master&apos; rel=&apos;nofollow&apos;&gt;http://github.com/william-os4y/fapws3/tree/master&lt;/a&gt;&lt;br /&gt;Demo site running wsgi_wiki with Fapws3: &lt;a href=&apos;http://fapws3.vmrt.homelinux.com/&apos; rel=&apos;nofollow&apos;&gt;http://fapws3.vmrt.homelinux.com/&lt;/a&gt;</description>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/5726.html</guid>
  <pubDate>Mon, 03 Nov 2008 14:17:29 GMT</pubDate>
  <title>my contact details</title>
  <link>http://william-os4y.livejournal.com/5726.html</link>
  <description>Since the crash of my server: opensource4you.com, I&apos;ve spent lot of time to recover my files from few old backups. &lt;br /&gt;&lt;br /&gt;I&apos;ve not yet find back my mailing-lists for fapws, but interested people can contact me at my new gmail account: william dot os4y at gmail.com&lt;br /&gt;&lt;br /&gt;Sorry for disturbance.&lt;br /&gt;&lt;br /&gt;William</description>
  <comments>http://william-os4y.livejournal.com/5726.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/5427.html</guid>
  <pubDate>Sun, 02 Nov 2008 07:56:58 GMT</pubDate>
  <title>FAPWS2 on github</title>
  <link>http://william-os4y.livejournal.com/5427.html</link>
  <description>Thanks to Piranha, I&apos;ve discovered a git repository provider: &lt;a href=&quot;github.com&quot; rel=&quot;nofollow&quot;&gt;github&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;The new fapws2 git repository is now: &lt;a href=&apos;http://github.com/william-os4y/fapws2/tree/master&apos; rel=&apos;nofollow&apos;&gt;http://github.com/william-os4y/fapws2/tree/master&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;For interested people, I&apos;ve got several good feedback about FAPWS2. Some of them have internet websites runnning without any problems. Some have even reported an uptime of +2 months without any issue. &lt;br /&gt;You are always free to send me your websites running with fapws2, if they are public, I&apos;ll be happy to talk about them ;-). &lt;br /&gt;&lt;br /&gt;My current work with FAPWS is to facilitate the integration with libevent. Indeed, for fapws2, I&apos;m using a different methodology to parse URL than libevent does. This force me to modify the code of libevent (evhttp_handle_request); which is not a so good solution.&lt;br /&gt;&lt;br /&gt;William</description>
  <comments>http://william-os4y.livejournal.com/5427.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>4</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/5167.html</guid>
  <pubDate>Tue, 02 Sep 2008 15:35:51 GMT</pubDate>
  <title>Year the reasons why the server as desapeard</title>
  <link>http://william-os4y.livejournal.com/5167.html</link>
  <description>I&apos;ve stored all emails from the &lt;a href=&quot;http://sivit.fr&quot; rel=&quot;nofollow&quot;&gt;sivit.fr&lt;/a&gt; support team into one Yahoo folder. Even the emails send into the Yahoo Spam. &lt;br /&gt;&lt;br /&gt;As you can see under suddenly, all of the sivit&apos;s communications were filtered out by Yahoo as Spam. &lt;br /&gt;Indeed, they have used wrong email format with the fromaddress. That&apos;s why yahoo complains. &lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://users.skynet.be/fa235423/screenshot2.jpeg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;On that suddent email problem, they don&apos;t give any answers. &lt;br /&gt;&lt;br /&gt;They claim that I&apos;ve been informed on time about the issue and the associated risks. But, between the first mail and crash of the machine, we hae only 10 hours. Which are the sleeping hours.  &lt;br /&gt;&lt;br /&gt;This was, thus, rather impossible to treat them accordingly. &lt;br /&gt;&lt;br /&gt;More over, they never explained why the server has been destroyed. &lt;br /&gt;And for sure, they have never give any excuses. &lt;br /&gt;&lt;br /&gt;This is just my, bad, story with them. &lt;br /&gt;You should not be generalised, because, maybe, some customers are happy with their quality of service. &lt;br /&gt;&lt;br /&gt;Up to everyone to decide if they are trustable.</description>
  <comments>http://william-os4y.livejournal.com/5167.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/4939.html</guid>
  <pubDate>Tue, 02 Sep 2008 02:39:11 GMT</pubDate>
  <title>Repository is down</title>
  <link>http://william-os4y.livejournal.com/4939.html</link>
  <description>After a Technical intervention of sivit.fr, the dedicated server has been removed. &lt;br /&gt;The server opensource4you.com is, thus, no more available.&lt;br /&gt;&lt;br /&gt;I&apos;m no more trusting them and will surely no more use their services.&lt;br /&gt;&lt;br /&gt;I&apos;ll keep you informed when a new repository will be setup. &lt;br /&gt;&lt;br /&gt;William</description>
  <comments>http://william-os4y.livejournal.com/4939.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/4617.html</guid>
  <pubDate>Tue, 15 Apr 2008 12:00:21 GMT</pubDate>
  <title>using fapws2 as a proxy</title>
  <link>http://william-os4y.livejournal.com/4617.html</link>
  <description>On current multi core machine, I have the idea to run several fapws2 instances for complex websites. That way I will have several fapws2 server dealing each a part of the web application. &lt;br /&gt;&lt;br /&gt;To stay with fapws2, that means that one instance will be a &quot;front end&quot; web server. He will querying the others.&lt;br /&gt;&lt;br /&gt;But what is the best way to implement such proxy mechanism (by only using libevent, no threads) ?&lt;br /&gt;People having knowledge, references of document exaplaining it, ... are welcome ;). &lt;br /&gt;&lt;br /&gt;William</description>
  <comments>http://william-os4y.livejournal.com/4617.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>6</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/4382.html</guid>
  <pubDate>Tue, 15 Apr 2008 11:48:09 GMT</pubDate>
  <title>fapws2 with libevent-1.4.3-stable</title>
  <link>http://william-os4y.livejournal.com/4382.html</link>
  <description>I&apos;ve just tried compiling fapws2 with the brand new libevent library. With all the changes that they have made inside libevent, I was suprised that fapws2 is running without major changes ;). &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Patch for libevent-1.4&lt;/b&gt;: &lt;br /&gt;Remove &quot;static&quot; for the procedure called &quot;evhttp_handle_request&quot; in http.c. &lt;br /&gt;FAPWS2 over-writte this procedure, thus it cannot be static ;(. &lt;br /&gt;I&apos;ve provided my evhttp_handle_request (with backward compatibility), but the libevent development team has not include it ;(. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On the most important feature of fapws2: performance, and based on my simple &quot;hello world&quot; sample, I see a small improvement: 6%. (633#/sec with libevent-1.4.3  against 594#/sec with libevent-1.3e).&lt;br /&gt;&lt;br /&gt;Additional tests must be made with this new library but the starting point is promising ;). &lt;br /&gt;&lt;br /&gt;William&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.opensource4you.com/cgi-bin/gitweb.cgi?p=fapws2;a=summary&quot; rel=&quot;nofollow&quot;&gt;git repository&lt;/a&gt;&lt;br /&gt;Tar file &lt;a href=&quot;http://www.opensource4you.com/downloads/fapws2-0.3.tgz&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Annexe&lt;/h4&gt; &lt;br /&gt;&lt;b&gt;Patch on the libevent-1.4.3 sources&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;
[libevent]$ diff http.c http_orig.c
1936c1936
&amp;lt; void
---
&amp;gt; static void
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt; with fapws2 based on libevent-1.4.3&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;
[fapws2]# ab -n 1000 -c10 http://127.0.0.1:8080/hello
This is ApacheBench, Version 2.0.40-dev &amp;lt;$Revision: 1.146 $&amp;gt; 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 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        fapws2/0.3
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /hello
Document Length:        13 bytes

Concurrency Level:      10
Time taken for tests:   1.579206 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      105000 bytes
HTML transferred:       13000 bytes
Requests per second:    633.23 [#/sec] (mean)
Time per request:       15.792 [ms] (mean)
Time per request:       1.579 [ms] (mean, across all concurrent requests)
Transfer rate:          64.59 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       3
Processing:     1   15   9.5     12      48
Waiting:        0   14   9.4     12      48
Total:          3   15   9.5     12      48

Percentage of the requests served within a certain time (ms)
  50%     12
  66%     13
  75%     14
  80%     15
  90%     38
  95%     42
  98%     45
  99%     46
 100%     48 (longest request)
&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;with fapws2 based on libevent-1.3e&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;
[root@myhost fapws2]# ab -n 1000 -c10 http://127.0.0.1:8080/hello
This is ApacheBench, Version 2.0.40-dev &amp;lt;$Revision: 1.146 $&amp;gt; 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 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        fapws2/0.2
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /hello
Document Length:        13 bytes

Concurrency Level:      10
Time taken for tests:   1.683275 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      105000 bytes
HTML transferred:       13000 bytes
Requests per second:    594.08 [#/sec] (mean)
Time per request:       16.833 [ms] (mean)
Time per request:       1.683 [ms] (mean, across all concurrent requests)
Transfer rate:          60.60 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     1   16   9.5     13      58
Waiting:        0   15   9.4     13      55
Total:          3   16   9.5     13      58

Percentage of the requests served within a certain time (ms)
  50%     13
  66%     14
  75%     16
  80%     19
  90%     29
  95%     42
  98%     44
  99%     48
 100%     58 (longest request)

&lt;/pre&gt;</description>
  <comments>http://william-os4y.livejournal.com/4382.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/4256.html</guid>
  <pubDate>Mon, 12 Nov 2007 19:14:07 GMT</pubDate>
  <title>Fapws2-0.2 ready for tests</title>
  <link>http://william-os4y.livejournal.com/4256.html</link>
  <description>I&apos;ve just released the 0.2 version of FAPWS2 (Fast Asynchronous Python WebServer) which is &lt;a href=&quot;www.wsgi.org&quot; rel=&quot;nofollow&quot;&gt;WSGI&lt;/a&gt; compliant. &lt;br /&gt;&lt;br /&gt;With this release, several bug fixes has been done (binaries are better working, cookies, ...). &lt;br /&gt;Now, FAPWS2 can now serve Django application (GET and POST), the admin page is working too ;-).&lt;br /&gt;&lt;br /&gt;Please not that FAPWS2 has been developed based on libevent-1.3x releases (on linux, but has been reported to work on Mac-OSX too). &lt;br /&gt;&lt;br /&gt;TGZ: &lt;a href=&apos;http://www.opensource4you.com/downloads/fapws2-0.2.tgz&apos; rel=&apos;nofollow&apos;&gt;http://www.opensource4you.com/downloads/fapws2-0.2.tgz&lt;/a&gt;&lt;br /&gt;Git repository: &lt;a href=&apos;http://www.opensource4you.com/cgi-bin/gitweb.cgi?p=fapws2;a=summary&apos; rel=&apos;nofollow&apos;&gt;http://www.opensource4you.com/cgi-bin/gitweb.cgi?p=fapws2;a=summary&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Your feedbacks, comments, tests results, ... are very welcome. &lt;br /&gt;&lt;br /&gt;William</description>
  <lj:security>public</lj:security>
  <lj:reply-count>16</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/3916.html</guid>
  <pubDate>Thu, 08 Nov 2007 08:30:50 GMT</pubDate>
  <title>fapws2 (based on evhttp api of libevent) is working ;-)</title>
  <link>http://william-os4y.livejournal.com/3916.html</link>
  <description>Nearly 1 month after my last post, I&apos;ve got a working version of fapws using the http api of libevent. &lt;br /&gt;&lt;br /&gt;Thanks to a wonderfull book call &quot;C in a nutshell&quot;, the &lt;a href=&quot;http://docs.python.org/api/api.html&quot; rel=&quot;nofollow&quot;&gt;python API documentation&lt;/a&gt; and to the &lt;a href=&quot;http://www.google.com/codesearch&quot; rel=&quot;nofollow&quot;&gt;google code&lt;/a&gt; search engine, I&apos;ve been able to write the required code; but also to track memory leaks, debug, ...&lt;br /&gt;&lt;br /&gt;Thus, definitively YES, writing python API in C is not that difficult (for a python developer who don&apos;t know C)&lt;br /&gt;&lt;br /&gt;Concerning our WSGI webserver, it can serve +1100#/sec on my Athlon-XP 1.2Ghz. It can resist to massive C10k attacks and it can serve Django applications (look into the samples). &lt;br /&gt;&lt;br /&gt;It was really exiting and funny to write this peace of code and I would thanks all people who provide me help, feedbacks and productive remarks. I would also specially thanks Lateef J. who has guide me (more than the others) even concerning stupid questions I have had. &lt;br /&gt;&lt;br /&gt;Because of a better integration with C, this new fapws (called fapws2, see later) is +-40% quicker than fapws for the simple hello_world. &lt;br /&gt;For Django application, it runs 30% quicker than &lt;a href=&quot;http://www.cherrypy.org&quot; rel=&quot;nofollow&quot;&gt;CherryPy&lt;/a&gt; 3.0.2 (thread base). &lt;br /&gt;(I&apos;m not against cherrypy, which is a great webserver. But Cherrypy is, for me, the best one, thus the reference.).&lt;br /&gt;At least, Fapws2 prove that select based webserver can be a good alternative to thread base one.&lt;br /&gt;&lt;br /&gt;The goal was to show the feasibility and the capabilities, lot of works still need to be done on this peace of code. Do not use it others than for tests. &lt;br /&gt;The prove-of-concept is finished, now, based on the results, a project can start. In that context help of everyone is welcome: for testing, coding, documentation, and ... to find a better name (sounds that fapws is too close to fap which is not related to serious IT matters ;-) ).&lt;br /&gt;&lt;br /&gt;Source code is here: &lt;a href=&apos;http://www.opensource4you.com/cgi-bin/gitweb.cgi?p=fapws2;a=summary&apos; rel=&apos;nofollow&apos;&gt;http://www.opensource4you.com/cgi-bin/gitweb.cgi?p=fapws2;a=summary&lt;/a&gt;&lt;br /&gt;tgz is here: &lt;a href=&apos;http://www.opensource4you.com/downloads/&apos; rel=&apos;nofollow&apos;&gt;http://www.opensource4you.com/downloads/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;William (william _:at: opensource4you :dot:_ com)&lt;br /&gt;&lt;br /&gt;PS: &lt;br /&gt;Like for my previous post, prove (apache benchmark) will come soon.&lt;br /&gt;&lt;br /&gt;(added on November, 10th)&lt;br /&gt;&lt;b&gt;ANNEXE&lt;/b&gt;&lt;br /&gt;----------------&lt;br /&gt;FAPWS2 performance on &quot;hello world&quot;:&lt;br /&gt;&lt;pre&gt;
[root@myhost]# nice -n20 ab -n1000 -c10  http://127.0.0.1:8080/
This is ApacheBench, Version 2.0.40-dev &amp;lt;$Revision: 1.146 $&amp;gt; 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 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        fapws2/0.1
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /
Document Length:        13 bytes

Concurrency Level:      10
Time taken for tests:   1.313237 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      105000 bytes
HTML transferred:       13000 bytes
Requests per second:    761.48 [#/sec] (mean)
Time per request:       13.132 [ms] (mean)
Time per request:       1.313 [ms] (mean, across all concurrent requests)
Transfer rate:          77.67 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     1   11  13.0      8     107
Waiting:        0   10  12.3      7     107
Total:          2   11  13.0      8     107

Percentage of the requests served within a certain time (ms)
  50%      8
  66%      8
  75%      8
  80%      9
  90%     33
  95%     40
  98%     41
  99%    106
 100%    107 (longest request)
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;FAPWS perofrmance on &quot;Hello world&quot;&lt;br /&gt;&lt;pre&gt;
[root@myhost]# nice -n20 ab -n1000 -c10  http://127.0.0.1:8080/hello
This is ApacheBench, Version 2.0.40-dev &amp;lt;$Revision: 1.146 $&amp;gt; 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 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        fapws/0.7
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /hello
Document Length:        11 bytes

Concurrency Level:      10
Time taken for tests:   1.909155 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      112000 bytes
HTML transferred:       11000 bytes
Requests per second:    523.79 [#/sec] (mean)
Time per request:       19.092 [ms] (mean)
Time per request:       1.909 [ms] (mean, across all concurrent requests)
Transfer rate:          57.09 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        2    8  11.0      6     108
Processing:     3   10   9.5      8     110
Waiting:        0    6   8.9      5     108
Total:         13   18  13.3     14     112

Percentage of the requests served within a certain time (ms)
  50%     14
  66%     14
  75%     15
  80%     16
  90%     43
  95%     47
  98%     49
  99%    112
 100%    112 (longest request)
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;On this example, FAPWS2 is 45% quicker than FAPWS.</description>
  <comments>http://william-os4y.livejournal.com/3916.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>7</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/3718.html</guid>
  <pubDate>Mon, 08 Oct 2007 17:19:18 GMT</pubDate>
  <title>Libevent has pure http API</title>
  <link>http://william-os4y.livejournal.com/3718.html</link>
  <description>It&apos;s now long time since my last post. &lt;br /&gt;&lt;br /&gt;This surely does not means that I&apos;m stopping FAPWS, at contrary I&apos;m more and more convinced that one of the beauty of Python reside in his gluing capabilities.&lt;br /&gt;This observation is probably not new to lot of people, but for my personal case it&apos;s better now than never ;-), no ?&lt;br /&gt;&lt;br /&gt;After that small philosophical intro, please go back to our main interest: integrate libevent within the python world. &lt;br /&gt;What&apos;s great with libevent is that since several release, they have introduced several HTTP low level APIs: send_reply, send_error, ... &lt;br /&gt;I&apos;ve tried to use them thanks to &lt;a href=&quot;http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/&quot; rel=&quot;nofollow&quot;&gt;pyrex&lt;/a&gt;, &lt;a href=&quot;http://python.net/crew/theller/ctypes/&quot; rel=&quot;nofollow&quot;&gt;ctype&lt;/a&gt; and &lt;a href=&quot;http://www.swig.org/&quot; rel=&quot;nofollow&quot;&gt;swig&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;With every of those tools I&apos;m facing issues, problems, ... to get a webserver working correctly. &lt;br /&gt;Because I want FAPWS to be light, efficient and stable, I don&apos;t like the idea to add layers on which I don&apos;t have too much control. Hoooooo, I&apos;m already hearing some voices ;-). The point is not linked with those tools, but more to my competencies to be able to have them working correctly. Indeed, when you are new to C (which is my case) and try to understand how to use swig, trust me, this is not piece of cake. &lt;br /&gt;Thus I&apos;ll use the simple, low level Python API for this project. This will be a way for me to learn C and C API of Python. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Will it be easy to learn C from Python ?&lt;br /&gt;&lt;br /&gt;We will see. &lt;br /&gt;Any how, any helps are welcome ;-).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here after, you can see a minimalist webserver serving the famous &quot;Hello World!&quot;: &lt;br /&gt;&lt;pre&gt;
import ctypes
import sys

libevent=ctypes.cdll.LoadLibrary(&apos;libevent.so&apos;)

def root_handler(req, *arg):
    #print &quot;got request:&quot;, req
    libevent.evbuffer_new.restype=ctypes.c_void_p
    #Build a buffer and put page content into it
    buf=libevent.evbuffer_new()
    libevent.evbuffer_add_printf.argtypes=[ctypes.c_void_p, ctypes.c_char_p]
    libevent.evbuffer_add_printf(buf,&quot;Hello world!\n\n&quot;)
    #send the buffer with a return code of 200
    libevent.evhttp_send_reply.argtypes=[ctypes.c_void_p, ctypes.c_int, ctypes.c_char_p, ctypes.c_void_p]
    libevent.evhttp_send_reply(req, 200, &quot;OK&quot;, buf)
    return 1


    
def main():
    #We just initialise and give the server address and port
    libevent.event_init()
    libevent.evhttp_start.argtypes=[ctypes.c_char_p, ctypes.c_short]
    libevent.evhttp_start.restype=ctypes.c_void_p
    http=libevent.evhttp_start(&apos;0.0.0.0&apos;,8080)
    #we lik the call to root_handler at a request of &quot;/&quot;
    FUNC=ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p)
    libevent.evhttp_set_cb.argtypes=[ctypes.c_void_p, ctypes.c_char_p, ctypes.c_void_p]
    libevent.evhttp_set_cb(http,&quot;/&quot;,FUNC(root_handler), None)
    #we loop and wait events ;-)
    libevent.event_dispatch()
    #we close the loop
    print &quot;end loop main&quot; 
    libevent.evhttp_free.argtypes=[ctypes.c_void_p]
    libevent.evhttp_free(http)

if __name__==&quot;__main__&quot;:
    main()
&lt;/pre&gt;&lt;br /&gt;&lt;bold&gt;Note:&lt;/bold&gt; I don&apos;t know exsactly why, but the server does not stop when you hit &quot;&lt;ctrl&gt;-c&quot;. You must kill it ;-(.&lt;br /&gt;&lt;br /&gt;Amazingly, I&apos;m able to get 1700#/sec on my 1.2Ghz Athlon. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;bold&gt;Annexes:&lt;/bold&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
[myhost ~]$ ab -n2000 -c10 http://127.0.0.1:8080/
This is ApacheBench, Version 2.0.40-dev &amp;lt;$Revision: 1.146 $&amp;gt; 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 127.0.0.1 (be patient)

Server Software:
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /
Document Length:        14 bytes

Concurrency Level:      10
Time taken for tests:   1.170227 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      196000 bytes
HTML transferred:       28000 bytes
Requests per second:    1709.07 [#/sec] (mean)
Time per request:       5.851 [ms] (mean)
Time per request:       0.585 [ms] (mean, across all concurrent requests)
Transfer rate:          163.22 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       3
Processing:     2    5   2.5      4      15
Waiting:        1    5   2.6      4      15
Total:          2    5   2.5      4      15

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      7
  80%      7
  90%      9
  95%     11
  98%     13
  99%     14
 100%     15 (longest request)
[myhost ~]$             
&lt;/pre&gt;</description>
  <comments>http://william-os4y.livejournal.com/3718.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>5</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/3491.html</guid>
  <pubDate>Tue, 27 Mar 2007 21:01:43 GMT</pubDate>
  <title>Fast Asynchronous Python Web Server</title>
  <link>http://william-os4y.livejournal.com/3491.html</link>
  <description>I&apos;m really happy to announce that we&apos;ve reached (I&apos;m no more alone on this project) a first interesting objective with FAPWS: FAPWS-0.6!!!&lt;br /&gt;&lt;br /&gt;Indeed, We don&apos;t have memory leaks any more, the server is much more stable and the WSGI implementation is now rather complete (Thanks Alex).&lt;br /&gt;&lt;br /&gt;I&apos;ve tested it with a simple Django wiki (&lt;a href=&apos;http://e-scribe.com/news/171&apos; rel=&apos;nofollow&apos;&gt;http://e-scribe.com/news/171&lt;/a&gt;) ... and it works :-)!!!.&lt;br /&gt;In this specific case the added value of FAPWS is not that big (114 #/sec vs 81 #/sec with lighttpd+flup-scgi). But If I look at my simple wiki (code is in the samples folder of the fapws .tgz), It can go up to 628#/sec!!!.&lt;br /&gt;&lt;br /&gt;Even with all those bugs fixes, WSGI adaptations, ... the overall performance of FAPWS remains at a very high level (for a python web server): 898#/sec.&lt;br /&gt;&lt;br /&gt;I would here thanks Alex for his very valuable collaboration related to WSGI; Roberto and Lateef for their tests, ideas and feedbacks (I really hope I&apos;ve not forgot someone)&lt;br /&gt;The active users community is not that big, but the quality is there ;-); and most important we have lot of fun with FAPWS.&lt;br /&gt;&lt;br /&gt;As I&apos;ve already said, don&apos;t hesitate to give your feedbacks, ideas, comments, ... &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;William&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PS:&lt;br /&gt;- simple demo web site running FAPWS: &lt;a href=&apos;http://www.opensource4you.com:8080/&apos; rel=&apos;nofollow&apos;&gt;http://www.opensource4you.com:8080/&lt;/a&gt;&lt;br /&gt;- Code repository: &lt;a href=&apos;http://www.opensource4you.com/cgi-bin/gitweb.cgi&apos; rel=&apos;nofollow&apos;&gt;http://www.opensource4you.com/cgi-bin/gitweb.cgi&lt;/a&gt;&lt;br /&gt;- download: &lt;a href=&apos;http://www.opensource4you.com/downloads/&apos; rel=&apos;nofollow&apos;&gt;http://www.opensource4you.com/downloads/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ANNEXES&lt;br /&gt;-----------&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;

[root@bsdhome ~]# nice -n 20 ab -n 1000 -c10 http://localhost:8080/hello
This is ApacheBench, Version 1.3d &amp;lt;$Revision: 1.73 $&amp;gt; apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests
Server Software:        fapws/0.6
Server Hostname:        localhost
Server Port:            8080

Document Path:          /hello
Document Length:        11 bytes

Concurrency Level:      10
Time taken for tests:   1.113 seconds
Complete requests:      1000
Failed requests:        0
Broken pipe errors:     0
Total transferred:      112000 bytes
HTML transferred:       11000 bytes
Requests per second:    898.47 [#/sec] (mean)
Time per request:       11.13 [ms] (mean)
Time per request:       1.11 [ms] (mean, across all concurrent requests)
Transfer rate:          100.63 [Kbytes/sec] received

Connnection Times (ms)
              min  mean[+/-sd] median   max
Connect:        1     4    1.6      5    16
Processing:     2     6    1.9      6    18
Waiting:        1     5    1.8      5    16
Total:          9    11    1.0     10    19

Percentage of the requests served within a certain time (ms)
  50%     10
  66%     11
  75%     11
  80%     11
  90%     12
  95%     13
  98%     14
  99%     19
 100%     19 (last request)



&lt;/pre&gt;</description>
  <comments>http://william-os4y.livejournal.com/3491.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>5</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/3169.html</guid>
  <pubDate>Tue, 13 Feb 2007 19:21:23 GMT</pubDate>
  <title>FAPWS status and progress</title>
  <link>http://william-os4y.livejournal.com/3169.html</link>
  <description>I&apos;ve been busy since last 2 months to fix several bugs in the current implementation. &lt;br /&gt;I&apos;ve nevertheless add some minor features that increase a little bit the global performance: internal caching, refactory of some classes, ...&lt;br /&gt;&lt;br /&gt;Now fapws can resist nicely to massive attacks: &lt;br /&gt;- via the ApacheBenchmark tool with 100, 200, ... concurrent connections. &lt;br /&gt;- via 50 &quot;wget -r&quot; in parallel. &lt;br /&gt;- both combined. &lt;br /&gt;&lt;br /&gt;Fapws still need to be enhanced in the HTTP headers parsing. I suspect that it can crash is the header is not correctly formatted.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Based on the same html page, Fapws can reached (on my machines) 728#/sec. This is a major step compared to CP or Twisted (198#/sec). But, we still have room for improvement, indeed I have 4235#/seq with Lighttpd.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Many thanks for the different feedback, comments, suggestion and bug fixes I&apos;ve received.&lt;br /&gt;&lt;br /&gt;William&lt;br /&gt;&lt;br /&gt;PS:&lt;br /&gt;- simple web site running FAPWS: &lt;a href=&apos;http://www.opensource4you.com:8080/&apos; rel=&apos;nofollow&apos;&gt;http://www.opensource4you.com:8080/&lt;/a&gt;&lt;br /&gt;- Code repository: &lt;a href=&apos;http://www.opensource4you.com/cgi-bin/pygitweb/views.py?project=fapws%2F.git&apos; rel=&apos;nofollow&apos;&gt;http://www.opensource4you.com/cgi-bin/pygitweb/views.py?project=fapws%2F.git&lt;/a&gt;</description>
  <comments>http://william-os4y.livejournal.com/3169.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/2924.html</guid>
  <pubDate>Sun, 12 Nov 2006 14:03:36 GMT</pubDate>
  <title>release of fapws-0.5 (Fast Asynchronous Python Web Server)</title>
  <link>http://william-os4y.livejournal.com/2924.html</link>
  <description>Now that several bugs are now fixed in the kernel of FAPWS. FAPWS is now much more stable and resits very correctly to &lt;a href=&quot;http://www.kegel.com/c10k.html&quot; rel=&quot;nofollow&quot;&gt;C10K&lt;/a&gt; attacks.&lt;br /&gt;&lt;br /&gt;On my Gentoo PC (1.2Ghz), Fapws can perform 3x faster than Cherrypy-3.0. Not because CP3 is bad, but because the heart of FAPWS is written in C (&lt;a href=&quot;http://www.monkey.org/~provos/libevent/&quot; rel=&quot;nofollow&quot;&gt;libevent&lt;/a&gt;). Thanks to libevent (and pyevent), you are able to run FAPWS on Windows, Linux, *BSD, Mac OSx and Solaris machines.&lt;br /&gt;&lt;br /&gt;As said before, FAPWS is targeted to run on small hardware (limited memory, ...) like several Virtual Dedicated Servers (&lt;a href=&quot;http://en.wikipedia.org/wiki/Virtual_private_server&quot; rel=&quot;nofollow&quot;&gt;VDS&lt;/a&gt;) offer.&lt;br /&gt;&lt;br /&gt;Up to now, the WSGI implementation is quite simplistic. If people are willing to improve this part of FAPWS with me, they are welcome ;-) (william _at_  opensource4you.com)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;William.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;links:  &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://www.opensource4you.com/cgi-bin/pygitweb/views.py?project=fapws%2F.git&quot; rel=&quot;nofollow&quot;&gt;FAPWS repository&lt;/a&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://www.opensource4you.com/cgi-bin/pygitweb/views.py?project=fapws%2F.git&amp;amp;snapshot=db40fed1935bdd814ceb1be5a0230d58609528ce&quot; rel=&quot;nofollow&quot;&gt;FAPWS-0.5.tgz&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://www.opensource4you.com:8080/&quot; rel=&quot;nofollow&quot;&gt;Demo of FAPWS wiki&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ANNEXE:&lt;br /&gt;---------------&lt;br /&gt;&lt;br /&gt;(I&apos;ve made 5 concurrent requests and started CP3 with 10 threads).&lt;br /&gt;&lt;pre&gt;
Server Software:        fapws/0.5
Server Hostname:        localhost
Server Port:            8081

Document Path:          /hello
Document Length:        11 bytes

Concurrency Level:      5
Time taken for tests:   8.421295 seconds
Complete requests:      5000
Failed requests:        0
Write errors:           0
Total transferred:      570000 bytes
HTML transferred:       55000 bytes
Requests per second:    593.73 [#/sec] (mean)
Time per request:       8.421 [ms] (mean)
Time per request:       1.684 [ms] (mean, across all concurrent requests)
Transfer rate:          66.02 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        1    3   1.4      3      15
Processing:     2    4   1.7      5      17
Waiting:        0    2   1.7      2      13
Total:          7    7   1.6      7      18

Percentage of the requests served within a certain time (ms)
  50%      7
  66%      8
  75%      9
  80%      9
  90%      9
  95%      9
  98%     10
  99%     12
 100%     18 (longest request)




Server Software:        CherryPy/3.0.0beta2
Server Hostname:        localhost
Server Port:            8080

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      5
Time taken for tests:   25.149331 seconds
Complete requests:      5000
Failed requests:        0
Write errors:           0
Total transferred:      710000 bytes
HTML transferred:       60000 bytes
Requests per second:    198.81 [#/sec] (mean)
Time per request:       25.149 [ms] (mean)
Time per request:       5.030 [ms] (mean, across all concurrent requests)
Transfer rate:          27.56 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        3   10   4.8     10      27
Processing:     6   14   4.9     15      30
Waiting:        0    7   5.9      7      26
Total:         23   24   1.7     24      35

Percentage of the requests served within a certain time (ms)
  50%     24
  66%     24
  75%     25
  80%     25
  90%     26
  95%     26
  98%     32
  99%     33
 100%     35 (longest request)
&lt;/pre&gt;</description>
  <lj:security>public</lj:security>
  <lj:reply-count>7</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://william-os4y.livejournal.com/2616.html</guid>
  <pubDate>Sun, 29 Oct 2006 12:58:32 GMT</pubDate>
  <title>Fast Asynchronous Python Web Server</title>
  <link>http://william-os4y.livejournal.com/2616.html</link>
  <description>As said in my &lt;a href=&quot;http://william-os4y.livejournal.com/2420.html&quot; rel=&quot;nofollow&quot;&gt;previous post&lt;/a&gt;, the code of&lt;br /&gt;FAPWS is now available. As my repository is &lt;a href=&quot;http://git.or.cz/&quot; rel=&quot;nofollow&quot;&gt;git&lt;/a&gt;, you can browse the code on my &lt;a href=&quot;http://www.opensource4you.com/cgi-bin/pygitweb/views.py?project=fapws%2F.git&quot; rel=&quot;nofollow&quot;&gt;python gitweb&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you want to see it running, you can see a demo &lt;a href=&quot;http://www.opensource4you.com:8080/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;- FAPWS requires to have &lt;a href=&quot;http://www.monkey.org/~provos/libevent/&quot; rel=&quot;nofollow&quot;&gt;libevent&lt;/a&gt; and &lt;a href=&quot;http://www.monkey.org/~dugsong/pyevent/&quot; rel=&quot;nofollow&quot;&gt;pyevent&lt;/a&gt;.&lt;br /&gt;- FAPWS works on linux and Windows.&lt;br /&gt;- FAPWS is based on WSGI.&lt;br /&gt;- FAPWS is very light. &lt;br /&gt;- FAPWS is very very fast!!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;William</description>
  <lj:security>public</lj:security>
  <lj:reply-count>16</lj:reply-count>
</item>
</channel>
</rss>
