Prerequisites
To complete this guide, you must have the following prerequisites:- Basic working knowledge of the LaunchDarkly Lua server-side SDK
- Basic working knowledge of the LaunchDarkly C++ server-side SDK
Preparing the C++ server-side SDK
Make the binary of the C++ server-side SDK accessible to the dynamic linker. The most convenient way to do this is to install the binary system-wide at/usr/lib/libldserverapi.so.
Ensuring correct initialization
The most important part of effective SDK usage is managing the lifetime of clients correctly. When HAProxy utilizes process-based concurrency, multiple clients initiate. If you accidentally initiate a client per request, the application is substantially slower because the SDK has to download a fresh ruleset from LaunchDarkly. For ideal operations, initialize each HAProxy worker process exactly once. You can do this with thelua-load directive under global. This directive executes a script when a process is freshly spawned. Client initialization should reside in this script. In the example below, this file is called shared.lua.
Here is an example of initialization logic:
Want to know more? Start a trial.Your 14-day trial begins as soon as you sign up. Get started in minutes using the in-app Quickstart. You’ll discover how easy it is to release, monitor, and optimize your software.
Want to try it out? Start a trial.
Want to try it out? Start a trial.