User Tools

Site Tools


programming:python:py-prefork-server

This is an old revision of the document!


Python Prefork Server

What is it?

The py-prefork-server project is a simple TCP/UDP prefork server library for Python. It is loosely modelled on the excellent Perl library Net::Server::PreFork. Where the Perl library is a bit of an “everything and the kitchen sink” approach, py-prefork-server only manages the network connections and child process distribution. Unlike Net::Server::PreFork, you will have to manage the daemonization, logging, pidfile, privilege dropping, etc. yourself. This was a design decision that makes it a bit more work on the programmer's part, but keeps it very flexible in how you use it.

Speaking of design decisions, another one that I made was not to make much use of the multiprocessing module that is now part of the Python standard library. This was done on purpose because, somewhat unfortunately, I use FreeBSD primarily in my job environment and the semaphore implementation on FreeBSD is not wholly compatible with the Python multiprocessing module. I wanted this to be a usable library across *nix environments as much as possible, which means that I was not, unfortunately, able to use semaphores.

All that aside, this seems to perform quite well in initial testing.

License

This project is licensed under the GPLv3. A copy of the license is included in the source and is available at http://www.gnu.org/licenses/gpl-3.0.txt.

Downloading

You can download this package here: py-prefork-server-0.1.1.tar.gz

You can also track this project on github

Installing

# tar -xvzf py-prefork-server-X.X.X.tar.gz
# cd py-prefork-server-*
# python setup.py install

Usage

Coming soon.

programming/python/py-prefork-server.1295292911.txt.gz · Last modified: 2011/01/17 19:35 by jay