Flagsmith is an open source, fully featured, Feature Flag and Remote Config service. Use our hosted API, deploy to your own private cloud, or run on-premise.
The Flagsmith Edge Proxy allows you to run an instance of the Flagsmith Engine close to your servers. If you are running Flagsmith within a server-side environment and you want to have very low latency flags, you have two options:
- Run the Edge Proxy and connect to it from your server-side SDKs
- Run your server-side SDKs in Local Evaluation Mode.
The main benefit to running the Edge Proxy is that you reduce your polling requests against the Flagsmith API itself.
The main benefit to running server side SDKs in Local Evaluation Mode is that you get the lowest possible latency.
Install locked dependencies:
rye sync --no-lock
Install pre-commit hooks:
pre-commit install
Run tests:
rye test
# Build image
docker build . -t edge-proxy-local
# Run image
docker run --rm \
-p 8000:8000 \
edge-proxy-local
See complete configuration reference.
Edge Proxy expects to load configuration from ./config.json
.
Create an example configuration by running the edge-proxy-render-config
entrypoint:
rye run edge-proxy-render-config
This will output the example configuration to stdout and write it to ./config.json
.
Here's how to mount the file into Edge Proxy's Docker container:
docker run -v ./config.json:/app/config.json flagsmith/edge-proxy:latest
You can specify custom path to config.json
, e.g.:
export CONFIG_PATH=/<path-to-config>/config.json
edge-proxy-render-config # Will write an example configuration to custom path.
edge-proxy-serve # Will read configuration from custom path.
You can also mount to custom path inside container:
docker run \
-e CONFIG_PATH=/var/foo.json \
-v /<path-to-config>/config.json:/var/foo.json \
flagsmith/edge-proxy:latest
You can send post request with wrk
like this:
cd load-test
wrk -t10 -c40 -d5 -s post.lua -H 'X-Environment-Key: <your environment key>' 'http://localhost:8001/api/v1/identities/?identifier=development_user_123456'