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.
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.