Dogproxy
Experimental HTTP proxy (using node.js) for avoiding the dog pile effect.
Install / Use
/learn @simonw/DogproxyREADME
dogproxy
A very simple dog pile preventing proxy.
The dog pile effect (also known as a thundering herd) affects caching systems that use time-based expiry. In a heavy traffic system, a cached item expiring could cause dozens of parallel "update" requests to be fired at once.
dogproxy assumes that these update requests go over HTTP. It joins together simultaneous requests for the same URL, and only performs one actual fetch to that resource.
STATUS: highly experimental. Known bugs (Content-Type is not correctly passed through, for example). Expect to modify this code further before use.
Usage:
$ node dogproxy.js
Server running at http://127.0.0.1:8009/
Testing using ab:
$ ab -n 10 -c 5 'http://127.0.0.1:8009/?url=http://example.com/'
dogproxy.js says:
Request for http://example.com/
... kicking off backend HTTP fetch
Request for http://example.com/
... already in flight, adding to queue
Request for http://example.com/
... already in flight, adding to queue
Request for http://example.com/
... already in flight, adding to queue
Request for http://example.com/
... already in flight, adding to queue
Fetched http://example.com/, alerting 5 waiting clients
Request for http://example.com/
... kicking off backend HTTP fetch
Request for http://example.com/
... already in flight, adding to queue
Request for http://example.com/
... already in flight, adding to queue
Request for http://example.com/
... already in flight, adding to queue
Request for http://example.com/
... already in flight, adding to queue
Fetched http://example.com/, alerting 5 waiting clients
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.2kCommit, push, and open a PR
