Skip to main content

proxenos: A rendezvous hashing and service routing toolkit.

Project description

https://img.shields.io/pypi/v/proxenos.svg https://img.shields.io/pypi/pyversions/proxenos.svg https://travis-ci.org/darvid/proxenos.svg?branch=master https://img.shields.io/coveralls/darvid/proxenos.svg Join the chat at https://gitter.im/python-proxenos/Lobby

A Python toolkit for Rendezvous/Highest Random Weight (HRW) hash based routing.

>>> import proxenos.mappers.consul
>>> import proxenos.rendezvous
>>> mapper = proxenos.mappers.consul.ConsulClusterMapper(
...     host='localhost', port=8500)
>>> mapper.update()
>>> mapper.cluster
{SocketAddress(host=IPAddress('::'), port=8000),
 SocketAddress(host=IPAddress('::'), port=8001),
 SocketAddress(host=IPAddress('::'), port=8300),
 SocketAddress(host=IPAddress('::'), port=8500)}
>>> mapper.select('github.com', proxenos.rendezvous.HashMethod.SIPHASH)
SocketAddress(host=IPAddress('::'), port=8001)
$ proxenos select -b consul -h localhost -p 8500 github.com
0.0.0.0:8300

Features

  • Support for multiple service discovery backends possible. Currently only support for Consul is implemented, but other backends coming eventually.

  • Supports many different hash functions and PRFs. The default hashing method is the SipHash PRF.

  • Provides a command-line interface for quickly testing/debugging node selection.

Installation

$ pip install proxenos
$ # If you'd like Murmur3 support, use:
$ pip install proxenos[murmur]

Notes

proxenos uses Python’s PRNG for calculating the weight of nodes in a cluster, rather than using a linear congruential generator (LCG) as described in the original paper on Rendezvous hashing. Seeded weights generated are limited to sys.maxsize, which means the resulting weights will differ depending on the platform architecture.

Similar projects

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

proxenos-0.0.3-py2.py3-none-any.whl (33.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file proxenos-0.0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for proxenos-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 07f5d4adb852c9d88efaa9118987a0bf3c7fac3c6fbb2856de22c6e5a722dd4a
MD5 cd61cd12ef9ee48ff882551997c879fe
BLAKE2b-256 dacdc082455bb19aff3bb48f548a867e185638e222ad038294ef312247cb62aa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page