{"id":44650490,"url":"https://github.com/atongen/tpc","last_synced_at":"2026-02-14T20:43:52.071Z","repository":{"id":57640224,"uuid":"105943206","full_name":"atongen/tpc","owner":"atongen","description":"Listens to redis sentinels and updates twemproxy config after failover","archived":false,"fork":false,"pushed_at":"2018-01-10T22:35:00.000Z","size":395,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-20T08:05:27.580Z","etag":null,"topics":["ha","redis","sentinel","twemproxy"],"latest_commit_sha":null,"homepage":"https://github.com/atongen/tpc","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atongen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-05T21:40:16.000Z","updated_at":"2017-12-06T09:00:43.000Z","dependencies_parsed_at":"2022-09-05T07:40:16.174Z","dependency_job_id":null,"html_url":"https://github.com/atongen/tpc","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/atongen/tpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atongen%2Ftpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atongen%2Ftpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atongen%2Ftpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atongen%2Ftpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atongen","download_url":"https://codeload.github.com/atongen/tpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atongen%2Ftpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29455362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ha","redis","sentinel","twemproxy"],"created_at":"2026-02-14T20:43:51.428Z","updated_at":"2026-02-14T20:43:52.066Z","avatar_url":"https://github.com/atongen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tpc\n\ntpc roughly stands for Twemproxy Configurator\n\nListens to a cluster of redis sentinel servers via pubsub.\nRewrites twemproxy config file and executes twemproxy reload command when\nsentinel notifies of redis master failover.\n\n## Install\n\nDownload the [latest release](https://github.com/atongen/tpc/releases), extract it,\nand put it somewhere on your PATH.\n\nor\n\n```sh\n$ go get github.com/atongen/tpc\n```\n\nor\n\n```sh\n$ mkdir -p $GOPATH/src/github.com/atongen\n$ cd $GOPATH/src/github.com/atongen\n$ git clone git@github.com:atongen/tpc.git\n$ cd tpc\n$ go install\n$ rehash\n```\n\n## Testing\n\n```sh\n$ cd $GOPATH/src/github.com/atongen/tpc\n$ go test -cover\n```\n\n## Releases\n\n```sh\n$ mkdir -p $GOPATH/src/github.com/atongen\n$ cd $GOPATH/src/github.com/atongen\n$ git clone git@github.com:atongen/tpc.git\n$ cd tpc\n$ make release\n```\n\n## Command-Line Options\n\n```\nλ tpc -h\nUsage of tpc:\n  -auto_eject_hosts\n        Twemproxy: A boolean value that controls if server should be ejected temporarily when it fails consecutively server_failure_limit times.\n  -backlog int\n        Twemproxy: TCP backlog argument (default 1024)\n  -channel string\n        Slack: channel for notifications (default \"#incidents\")\n  -client_connections int\n        Twemproxy: The maximum number of connections allowed from redis clients (default 4096)\n  -cmd string\n        Process: Command to execute after master failover\n  -distribution string\n        Twemproxy: Key distribution (default \"ketama\")\n  -has_tag string\n        Twemproxy: A two character string that specifies the part of the key used for hashing. Eg '{}' or '$$'\n  -hash string\n        Twemproxy: Hash algorithm (default \"fnv1a_64\")\n  -icon_emoji string\n        Slack: icon emoji for notifications\n  -ip string\n        Twemproxy: Ip address (default \"0.0.0.0\")\n  -listen_address string\n        Prometheus: Listen address (default \":9298\")\n  -log string\n        Process: Path to log file, will write to STDOUT if empty\n  -master_pattern string\n        Process: If provided, will filter master names from sentinel based on pattern\n  -name string\n        Twemproxy: Name of redis pool (default \"redis\")\n  -out string\n        Process: File to write configuration, will write to STDOUT if empty\n  -backup string\n        Process: Directory to write backup files, will write to STDOUT if empty\n  -port int\n        Twemproxy: Port (default 9000)\n  -preconnect\n        Twemproxy: A boolean value that controls if we should preconnect to all the servers in this pool on process start (default true)\n  -redis_auth string\n        Twemproxy: authenticate to the redis server on connect\n  -redis_db int\n        Twemproxy: The DB number to use on the redis pool servers. Twemproxy will always present itself to clients as DB 0\n  -sentinels string\n        Process: CSV of host:port to redis sentinels\n  -server_connections int\n        Twemproxy: The maximum number of connections that can be open to each server (default 1)\n  -server_failure_limit int\n        Twemproxy: The number of consecutive failures on a server that would lead to it being temporarily ejected when auto_eject_host is set to true. (default -1)\n  -server_retry_timeout int\n        Twemproxy: The timeout value in msec to wait for before retrying on a temporarily ejected server, when auto_eject_host is set to true. (default -1)\n  -telemetry_path string\n        Prometheus: Telemetry path (default \"/metrics\")\n  -timeout int\n        Twemproxy: The timeout value in msec that we wait for to establish a connection to the server or receive a response from a server. (default -1)\n  -token string\n        Slack: API token used for notifications\n  -username string\n        Slack: username for notifications\n  -v    Print version information and exit\n```\n\n## Issues\n\n### twemproxy hot reload\n\nThere is a long-running twemproxy feature branch that is supposed to bring config hot-reload via unix signal:\n\n* https://github.com/twitter/twemproxy/issues/6\n* https://github.com/twitter/twemproxy/pull/321\n* https://github.com/machinezone/twemproxy/tree/lwalkin/config-reload\n\nCurrently the solution is to pause the redis clients, then stop and restart the twemproxy process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatongen%2Ftpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatongen%2Ftpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatongen%2Ftpc/lists"}