Menu

Tree [68fbc1] master /
 History

HTTPS access


File Date Author Commit
 X64 2014-12-30 UlricE UlricE [84e3c1] .
 X86 2014-12-30 UlricE UlricE [84e3c1] .
 AUTHORS 2014-12-18 UlricE UlricE [585a9f] more files
 COPYING 2014-12-18 UlricE UlricE [585a9f] more files
 ChangeLog 2015-02-25 UlricE UlricE [68fbc1] dummy server
 HOWTO 2014-12-18 UlricE UlricE [585a9f] more files
 INSTALL 2015-02-24 UlricE UlricE [9e7a51] Updated INSTALL again
 Makefile.am 2015-02-12 UlricE UlricE [5c05bd] Added config.h.win
 Makefile.win 2015-02-12 UlricE UlricE [5c05bd] Added config.h.win
 NEWS 2014-12-18 UlricE UlricE [585a9f] more files
 README 2014-12-18 UlricE UlricE [585a9f] more files
 config.h.in 2014-12-22 UlricE UlricE [a32c24] config.h.in
 config.h.win 2015-02-12 UlricE UlricE [e743d8] .
 configure.ac 2015-02-19 UlricE UlricE [1e5b81] Checking 0.27.1
 dlist.c 2015-02-19 UlricE UlricE [1e5b81] Checking 0.27.1
 epoll.c 2015-02-13 UlricE UlricE [dc0193] don't EPOLL_CTL_DEL when we're about to close t...
 kqueue.c 2015-02-06 Charlie Root Charlie Root [439659] stateful kqueue.c
 mergelogs.1 2014-12-18 UlricE UlricE [585a9f] more files
 mergelogs.c 2014-12-18 UlricE UlricE [585a9f] more files
 pen.1 2015-02-12 UlricE UlricE [0f606f] .
 pen.c 2015-02-25 UlricE UlricE [68fbc1] dummy server
 pen.h 2015-02-24 UlricE UlricE [bbddf6] reliable idlers
 pen.spec 2014-12-30 UlricE UlricE [218feb] .
 penctl.1 2015-02-24 UlricE UlricE [bbddf6] reliable idlers
 penctl.c 2014-12-18 UlricE UlricE [585a9f] more files
 penctl.cgi 2014-12-30 UlricE UlricE [169fa3] .
 penlog.1 2014-12-18 UlricE UlricE [585a9f] more files
 penlog.c 2014-12-18 UlricE UlricE [585a9f] more files
 penlogd.1 2014-12-18 UlricE UlricE [585a9f] more files
 penlogd.c 2014-12-18 UlricE UlricE [585a9f] more files
 penstats 2014-12-30 UlricE UlricE [1d8e16] added penstats
 poll.c 2015-02-06 UlricE UlricE [f9c150] fixed poll for solaris
 select.c 2015-02-05 UlricE UlricE [481e9f] Stateful event management
 siag.pem 2014-12-30 UlricE UlricE [dad4fb] .
 windows.c 2015-01-27 UlricE UlricE [c8bcf8] Pen does Windows

Read Me

This is pen, a load balancer for udp and tcp based protocols such as
dns, http or smtp. It allows several servers to appear as one to the
outside and automatically detects servers that are down and distributes
clients among the available servers. This gives high availability and
scalable performance.

The load balancing algorithm keeps track of clients and will try to
send them back to the server they visited the last time. The client
table has a number of slots (default 2048, settable through command-line
arguments). When the table is full, the least recently used one will
be thrown out to make room for the new one.

This is superior to a simple round-robin algorithm, which sends a client
that connects repeatedly to different servers. Doing so breaks
applications that maintain state between connections in the server,
including most modern web applications.

When pen detects that a server is unavailable, it scans for another
starting with the server after the most recently used one. That way
we get load balancing and "fair" failover for free.

Correctly configured, pen can ensure that a server farm is always
available, even when individual servers are brought down for maintenance
or reconfiguration. The final single point of failure, pen itself,
can be eliminated by running pen on several servers, using vrrp to
decide which is active.


A side-effect of load-balancing web servers is that several logfiles
are produced, and all accesses seem to come from the load balancer.
The program penlogd solves this problem by merging pen's log file
with the ones produced by the web servers. See penlogd(1) and penlog(1)
for details.

This load balancer is known to work on FreeBSD, Linux, HP-UX and Solaris.
Other Unixes should work as well, possibly requiring trivial changes.
Success stories or problem reports are welcome.


If pen is started with the -w option, statistics are saved in html
format when a USR1 signal is received. The cgi script penstats can
be used to simplify this; it must be edited to reflect local conditions.


I am Ulric Eriksson, ulric@siag.nu.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.