Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
git-svn-id: http://evserver.googlecode.com/svn/trunk@21 e9bb6d7e-af12…
…-11dd-bad7-87afd3b02348
- Loading branch information
majek04
committed
Nov 19, 2008
1 parent
bc2d00c
commit 8c5e012
Showing
5 changed files
with
65 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,5 @@ | ||
|
||
INSTALLATION | ||
|
||
You should probably check out current development brach: | ||
$ svn checkout http://evserver.googlecode.com/svn/trunk/ evserver | ||
|
||
Then, to use 'evserver' you just need to set your PYTHONPATH environment | ||
variable, for example, if you have evserver sources installed in your home directory: | ||
$ PYTHONPATH="$HOME/evserver" python ./myscript.py | ||
|
||
If you must have egg package, you can get one: | ||
$ wget "" | ||
$ sudo easy_install evserver | ||
|
||
But beware, this packet has included a libevent.so binary, which is 32 bits only. | ||
|
||
|
||
COMPILATION | ||
|
||
This package needs libevent.so binary and automatically generated python wrapper | ||
file for this specific version of libevent. Currently I include libevent 1.4.5 | ||
32 bit files. If you need to use your own version of libevent, you must: | ||
- install dependencies: | ||
$ sudo apt-get install gccxml python-setuptools | ||
$ sudo easy_install ctypeslib | ||
|
||
- grab libevent sources. Libevent from 1.4.2 to 1.4.5 seems to be working. 1.4.1 had | ||
an important bug in chunk encoding, 1.4.6 and newer have issues when receiving | ||
timeouts on file descriptors. I use libevent-1.4.5. | ||
You need to compile the sources. | ||
$ wget "http://monkey.org/~provos/libevent-1.4.5-stable.tar.gz" | ||
$ tar xvzf libevent-1.4.5-stable.tar.gz | ||
$ cd libevent-1.4.5 | ||
$ ./configure && make | ||
|
||
- Run 'make ctypes' with LIBEVENTSOURCES environment variable set, for example: | ||
$ LIBEVENTSOURCES=../libevent-1.4.5-stable make ctypes | ||
Then, if you need to create egg, just run 'make egg' | ||
$ LIBEVENTSOURCES=../libevent-1.4.5-stable make egg | ||
Your package will be ready in 'dist' directory. | ||
|
||
|
||
RUNNING | ||
|
||
If you installed egg just try: | ||
$ evserver | ||
|
||
If you haven't installed egg, only got the development branch in ~/evserver: | ||
$ ~/evserver/evserver.py | ||
|
||
|
||
TESTS | ||
|
||
There are some working tests for the application. You can run them: | ||
$ make test | ||
|
||
|
||
FEATURES | ||
|
||
The status panel is great. Just add '-s 127.0.0.1:9999' option when running eveserver, | ||
and see the status at url http://127.0.0.1:9999/ | ||
|
||
|
||
|
||
|
||
BUGS | ||
|
||
There are still some issues with this software: | ||
- Despite long fight, there are still some memory leaks in libevent. The leaks are tiny, but take | ||
them into consideration and think of restarting the worker processes once in few months. | ||
- | ||
|
||
|
||
I FOUND A BUG! | ||
That's great! It means that I'm still a human (I lost my certainty about this point). | ||
Write a test case using our 'test.py' facility, then I'll try to fix a bug for free. | ||
In the other case feel free to fix the bug yourself, I'd be happy to include your | ||
changes. Just drop me the patch at majek04+evserver@gmail.com | ||
|
||
|
||
The good idea is to take a look at: | ||
|
||
http://code.google.com/p/evserver/wiki/Documentation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
global | ||
log 127.0.0.1 local0 | ||
log 127.0.0.1 local1 notice | ||
maxconn 256 | ||
chroot /var/empty | ||
uid 65534 | ||
gid 65534 | ||
daemon | ||
|
||
defaults | ||
log global | ||
mode tcp | ||
option httplog | ||
option dontlognull | ||
retries 3 | ||
option redispatch | ||
maxconn 2000 | ||
contimeout 5000 | ||
clitimeout 50000 | ||
srvtimeout 50000 | ||
|
||
listen http-server 0.0.0.0:80 | ||
mode tcp | ||
balance roundrobin | ||
clitimeout 86400000 # a day | ||
srvtimeout 86400000 | ||
server inst00 127.0.0.1:9000 check inter 2000 fall 3 | ||
server inst01 127.0.0.1:9001 check inter 2000 fall 3 | ||
server inst02 127.0.0.1:9002 check inter 2000 fall 3 | ||
server inst03 127.0.0.1:9003 check inter 2000 fall 3 | ||
server inst04 127.0.0.1:9004 check inter 2000 fall 3 | ||
server inst05 127.0.0.1:9005 check inter 2000 fall 3 | ||
server inst06 127.0.0.1:9006 check inter 2000 fall 3 | ||
server inst07 127.0.0.1:9007 check inter 2000 fall 3 | ||
server inst08 127.0.0.1:9008 check inter 2000 fall 3 | ||
server inst09 127.0.0.1:9009 check inter 2000 fall 3 | ||
server inst10 127.0.0.1:9010 check inter 2000 fall 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,40 @@ | ||
from setuptools import setup, find_packages | ||
from setuptools.dist import Distribution | ||
import os | ||
print find_packages(".") | ||
import subprocess | ||
import re | ||
|
||
version = "0.01" | ||
|
||
try: | ||
proc = subprocess.Popen(["svn", "info"], stdout=subprocess.PIPE) | ||
svn = proc.stdout.read() | ||
|
||
rev = int(re.compile(r"Revision: ([0-9]*)").findall(svn)[0]) | ||
version = "%s-r%s" % (version, rev) | ||
except Exception: | ||
pass | ||
|
||
|
||
class MyDist(Distribution): | ||
def has_ext_modules(self): | ||
return True | ||
|
||
setup( | ||
name="evserver", | ||
description = "EvServer - Asynchronous WSGI http server", | ||
version = "0.01", | ||
version = version, | ||
keywords = "wsgi awsgi django asynchronous libevent", | ||
author = "Marek Majkowski", | ||
url = "", | ||
license = "GPL", | ||
url = "http://code.google.com/p/evserver/wiki/Documentation", | ||
license = "BSD", | ||
package_data = {'': ['*.so']}, | ||
packages = ['evserver', 'evserver.management', 'evserver.management.commands'], | ||
package_dir = {'':"."}, | ||
|
||
entry_points = { | ||
'console_scripts': ['evserver = evserver.evserver:egg_entry_point'], | ||
}, | ||
distclass = MyDist, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters