For almost as long as there has been code, there have been knobs to tweak. These take many forms -- configuration files, command-line parameters, constants, “magic cookies”.
In the modern world of distributed systems, these settings can be hard to manage. Changing a setting may require updating a file across many machines, restarting servers, or even releasing a new build of your product.
Scalyr’s “Knobs” Service radically simplifies the task of managing and distributing program settings. Settings are organized into files and stored in our service. With a couple of lines of setup code, accessing a setting can be as simple as:
int bufferSize = Knob.getInteger("bufferSize", 4096, configFile);
Updating a setting takes just a few clicks on our web site. The updated value immediately propagates to all your servers, no restarts required.
- Configuration files stored in a reliable, redundant, centrally managed service.
- Push-button updates from our web site -- edit from anywhere, no special tools required.
- Minimal coding -- retrieve values with a single method call. Add new knobs at any time.
- Configuration files are automatically cached on your server, for zero-latency access.
- Changes propagate instantly, no server restarts required.
- You can register a callback to be notified when a setting changes.
- Use our client library or a simple JSON API.
- Configuration files can be “stacked” to inherit from one another. This makes life easy when you have servers that need slightly different configurations (e.g. because they are located in different data centers). You can centralize the shared settings in a single file.
Controlling experiments. Developing a new feature for your web site and want to roll it out gradually? Use a knob to specify what percentage of users see the new feature. Increasing the experiment becomes a trivial edit on our web site. If a problem develops, you can instantly turn off the experiment, without the disruption (and delay) of a server restart.
Server addresses. Running a multi-tier system? For each tier, put the server addresses in a knob. The front tiers can consult this knob to find the servers behind them. Now, adjusting the address list is a snap.
Internal passwords. Does your server need passwords to access backend services (such as a database or mail server)? Leaving these passwords lying around in your source code or a command line makes them too easy to see and too hard to change. The Knobs service gives them a secure, easily updated home.
Server tuning. Do you depend on tuning parameters such as rate limits, buffer sizes, and connection pool sizes to keep your servers healthy? Restarting to tweak a parameter is like pulling off the highway to change gears. With the Knobs service, you can tweak settings on the fly and instantly observe the effects. Change notification makes it easy to resize buffers and connection pools when the configuration file is edited.
Whitelists. Do you maintain a list of users authorized to perform administrative tasks, or a list of IP addresses authorized to access an internal service? The Knobs service is an easy way to manage this whitelist.