StreamBase Services and Registry Keys on Windows

This topic describes the StreamBase services and Registry keys that are installed on Microsoft Windows machines, and how you can (optionally) customize them for your environment. Often these steps occur during the deployment phase of your StreamBase application.

Note

Beginning in Version 5.0, StreamBase supports installing multiple versions of StreamBase, and the version number is appended to StreamBase registry keys and default installation directory. If you are configuring an earlier version of StreamBase, omit the version number from registry keys and installation directories shown in this topic.

  • HKEY_LOCAL_MACHINE\SOFTWARE\StreamBase Systems\StreamBase.n.m (in release 5.0 and later)

  • HKEY_LOCAL_MACHINE\SOFTWARE\StreamBase Systems\StreamBase (release 3.7 and earlier)

StreamBase Service

A Windows service is an executable that can be set to run when Windows is booted. The StreamBase installer adds the following service to the registry on your Windows machine, and leaves it set for manual startup:

  • StreamBase n.m Service, to run the StreamBase Server executable, sbd.exe.

After StreamBase installation, you can view this service in the Windows Services Control Panel. For example:

Notice in the sample above that the StreamBase Service is installed but is not started by default. To start a service, click the Start the service link. If you want the service to start when Windows is booted:

  • Select the service name

  • Right click and select Properties from the menu

Then on the dialog shown below, change the Startup type from Manual to Automatic:

Setting Up Multiple StreamBase Applications as Services

StreamBase lets you run multiple StreamBase applications on the same Windows machine. Each application file is hosted by its own StreamBase Server (sbd) process. If you want to run more than one application as a Windows service, you can create additional StreamBase services to run the applications. To create an additional service, use the --install-service and --service-name options on the sbd command line.

For example, at the StreamBase Command Prompt, type:

sbd --install-service --service-name "sbd2,StreamBase Service Two"

If successful, StreamBase displays a confirmation message. For example:

sbd2 installed with display name "StreamBase Service Two"

Refresh the Services Control Panel, and notice the service we just added, StreamBase Service Two, in the listing:

Note

The first argument in the --service-name option is used as a prefix in several Windows Registry keys. The second argument, the service name, is used (as shown above) in the alphabetical display of Windows services. We recommend that you start the name with StreamBase to make it easier to manage (start, pause, resume, or stop) your StreamBase services in the Windows Services control panel.

If desired, change the Properties for the service that you added, by following the instructions in the previous section of this topic. For example, you might change the Startup type from Manual to Automatic:

Also Note

If you ever need to remove a StreamBase service, use the --remove-service option on the sbd command line, using only the first argument you gave with the --install-service option. For example:

sbd --remove-service --service-name sbd2

Because your edits to the Windows Registry were not done by an installer, a StreamBase uninstallation operation does not remove the registry keys of a service that you added and then subsequently removed. Under these circumstances, use regedit to search for and remove any obsolete keys, such as an sbd2Startup key in HKEY_LOCAL_MACHINE\SOFTWARE\StreamBase Systems\StreamBase.n.m.

Important: Next Step

A required next step is to edit the Registry keys for each StreamBase service, to associate the startup of a particular StreamBase application with each service, as described in the next section. Also read the note that follows the table in Registry Keys for the StreamBase Installation.

Registry Keys

If you decide to automatically start a StreamBase service on a Windows machine (for example, on a production machine that is hosting a deployed StreamBase application), you may need to modify configuration parameters for the StreamBase Server instance running as a service.

For Windows services that start at boot time, the way to define non-default settings is by editing keys in the Windows Registry. To start the Registry Editor, select Run from the Start menu. In the Run dialog, enter regedit and click OK.

Registry Key Values Used for Different Cases

This section explains when the StreamBase keys in the Windows Registry are used. Details about these keys are provided in subsequent sections.

The following Registry key is used only by StreamBase Server when running as a Windows service:

sbdStartup

The following keys are used by StreamBase Server instances that are either running as Windows services, or were started with an sbd command, and are running as background processes (sbd -b command-line option).

LogFile
LogLevel
LogToLogFile
CrashDump
CrashQuiet
CrashPause

You can optionally set crash dump environment variables to override the Registry key values. However, if you are running a StreamBase Server instance as a Windows service, this practice is not recommended in cases where a different user-id (Local System) could be used.

The following Registry keys are used in all cases of (StreamBase Servers started as Windows services, or command-line background processes, or command-line foreground processes).

InstallDir
DataDir

Note that not all the Registry keys can be specified on a command line, or in a configuration file. The DataDir parameter specifies the directory where disk-based Query Tables (available only in StreamBase Enterprise Edition) store their persistent data. The DataDir parameter is the only one subject to a multi-stage precedence resolution, which is:

  1. If present on the sbd command line (--datadir value).

  2. The STREAMBASE_DATA environment variable's value.

  3. The value in the server section of the sbd.sbconf configuration file.

  4. The HKEY_LOCAL_MACHINE\SOFTWARE\StreamBase Systems\StreamBase.n.m\DataDir value in the Registry.

  5. Finally, if not specified (assumes the Registry key value has been deleted), or the special value "+TEMP+" is used, a temporary directory is created on server startup and deleted on shutdown.

The remaining sections in this topic describe the Registry keys installed by StreamBase.

Registry Keys for the StreamBase Installation

The registry keys at the following location affect the StreamBase installation as a whole.

HKEY_LOCAL_MACHINE\SOFTWARE\StreamBase System\StreamBase.n.m

If you have more than one StreamBase version installed, you will find more than one set of keys at this registry location, one for each StreamBase installation, as shown in the following image:

The keys and their default values are as follows:

Key Name Default Value Description
CrashPause no If set to yes, the StreamBase Server process pauses for five minutes before dumping data to the log file and dump file. StreamBase Systems recommends that you keep the default value.

On Windows, if you use the Dr. Watson program to set preferences for crash dumps, the default location for dump files is:

C:\Documents and Settings\All Users\Application Data\Microsoft\Dr Watson

The dump file is a binary file and can be used for debugging in Visual Studio. Dr. Watson has its own text-based log file that is different from the StreamBase log files. You can use any text editor to view the StreamBase log files. They contain StreamBase messages (INFO, NOTICE, WARNING, DEBUG levels, depending on the log-level setting) and by default reside in C:\Program Files\StreamBase Systems\StreamBase.n.m\logs\*.

CrashDump no Controls whether the crash dump is written to the dump file.
CrashQuiet yes When set to yes (the default), the StreamBase Server process can create the crash dump without having to launch a dialog box. The no setting is not appropriate when you are starting the StreamBase Server as a service.
DataDir C:\Program Files\StreamBase Systems\StreamBase.n.m\DataDir Sets the directory that will contain disk-based Query Tables. Change this value to specify a different DataDir location for your StreamBase applications,
InstallDir (The directory where you installed StreamBase.) Do not change this value.
sbdStartup -b You can use this value to pass in any valid sbd command-line parameter at startup. For example:

-b -f "C:\My Apps\streambase\marketwatch.sbconf" C:\marketwatch.sbapp

The -b flag indicates that the StreamBase Server starts in background mode. In most cases this is the appropriate value, so that a Windows command prompt is not displayed during the boot sequence when the sbd.exe executable is starting. The -f flag allows you to specify a non-default location or filename for the StreamBase Server configuration file that you edited for your application. For more information about the sbd command parameters, see its reference topic.

Note

If the command-line argument contains spaces, such as in a Windows path, you must enclose it in quotes.

Important

Please see the note that appears after this table for related information about multiple StreamBase services, if you defined any.

sbd2Startup None This key is present when you add another service

If you create you own Windows services, in addition to the default services installed by StreamBase, you will find additional Registry key names of the form <service-name>Startup in this key. The prefix name comes from the first argument of the --service-name option on the sbd command line, as described above in Setting Up Multiple StreamBase Applications as Services.

For example, in HKEY_LOCAL_MACHINE\SOFTWARE\StreamBase Systems\StreamBase.n.m, notice the sbd2Startup key, which we added with an sbd command described earlier in this topic:

Notice in the screen above, we modified the sbd2Startup key's value, from the default of -b, to start a specific StreamBase application with a specific server configuration file.

Assuming that you set the service's property to start automatically (in the control panel, as described earlier), the sbd process will start and host this StreamBase application (Ourapp.sbapp) when the system is booted.

Registry Keys for Each StreamBase Server Service

The registry keys at the following location affect the StreamBase Server set to run as a Windows service.

HKEY_LOCAL_MACHINE\SOFTWARE\StreamBase System\StreamBase.n.m\sbd.n.m

For example, the keys for the folder sbd.6.0 affect the StreamBase Server set to run as a service by the StreamBase 6.0 installer.

The keys and their default values are as follows:

Key Name Default Value Description
LogFile C:\Program Files\StreamBase Systems\StreamBase.n.m\logs\sbd.log Sets the location of the StreamBase Server log file. Change this value if you want to designate a different directory.
LogLevel 0 Sets the log level of messages reported by the StreamBase Server. The log levels are:
  • 0, the default, which provides NOTICE level messages and higher.

  • -1, to disable NOTICE messages and only show WARN, ERROR and FATAL messages.

  • 1, which adds INFO messages to the standard messages.

  • 2, which adds DEBUG messages.

LogToLogFile False Boolean to indicate whether you want logging to occur for the StreamBase Server.

If you added a second or third service as described above, you can create a folder named the same as the first argument you gave to the --install-service option. Using the example above, you could create a registry folder named:

HKEY_LOCAL_MACHINE\SOFTWARE\StreamBase System\StreamBase.6.1\sbd2

Create LogFile, LogLevel, or LogToLogFile keys in this folder as required to manage your secondary StreamBase service.