5 Full OptServer¶
This page is about installing and running the full version of OptServer, which is a remote solver service additionally equipped with task storage, user management and additional management features.
Important
We recommend all users interested with remote optimization to try the light version, OptServerLight, first. It requires no extra setup, is much easier to start, and has all the same capabilities regarding optimization itself.
This documentation for the full OptServer is intentionally terse and does not cover all possible options in detail. If in doubt please check the config file to see all configuration options, or ideally contact MOSEK support for help with the setup.
5.1 Installation¶
Below is an outline of steps required to install, initialize and start the OptServer.
5.1.1 Requirements and files¶
OptServer is available for
linux64x86
andwin64x86
.Install MOSEK following the installation instructions.
Download the OptServer, which is a separate package available from http://download.mosek.com/optserver/index.html and unpack it.
The OptServer installation consists of three folders, containing:
bin
- the OptServer binaryoptserver
/optserver.exe
.etc/mosek
- the configuration fileoptserver.conf
.var
- HTML pages and the default location for database and jobs files created on runtime.
All paths are fully configurable, so the components of OptServer can be moved around to arbitrary locations.
5.1.2 The config file¶
Locate and familiarize yourself with the configuration file. It contains default settings, many of which may need to be adjusted later. The file is divided into major sections:
[API]
- specifies the API to be used.[Database]
- database configuration.[Http]
- settings for the HTTP/HTTPS service.[Paths]
- paths to MOSEK, log and data files.[Tasks]
- settings for managing server load, limits for task sizes and similar.
5.1.3 Initializing database¶
OptServer supports three database backends: Sqlite, MySql and Postgres. Edit the Database.Driver
entry in the config file to choose the required backend, and fill in the respective subsection of [Database]
with the required configuration for that backend.
The simple built-in Sqlite backend is recommend for initial test. In this case only the Database.Sqlite.Path
entry needs to be configured to point to the location of the database file (or left as default).
Initialize the database by running
optserver --config path_to_config_file.conf --log-file - --create-db initialize
5.1.4 Connecting MOSEK solver¶
OptServer needs to know where to find the MOSEK solver. This is configured with the option Paths.Mosek
, which is a list of paths, each leading to the bin
folder of the MOSEK installation you wish to use.
For example, assuming that MOSEK version 11.0 on Linux is installed in the folder /opt/mosek_inst
, you would configure the path as
[Paths]
Mosek = [ "/opt/mosek_inst/11.0/tools/platform/linux64x86/bin" ]
The list can contain multiple paths for various MOSEK installations coming from different MOSEK versions. When remote optimization is invoked from the MOSEK client the OptServer will choose the binaries corresponding to the version of the caller. Therefore all the MOSEK versions (major/minor X.Y
) that will be used by clients must be available and configured on the server.
5.1.5 Major options to configure¶
The following are the major options the user may be interested in editing. This can be done either in the config file or in the command-line invocation (see optserver --help
for a list of command-line options).
Database.Driver
and specific backend settings - as discussed above.Http.Port
- the port to listen on.Http.UseTLS
- whether to run onhttps
. In this case the TLS key and certificate paths must be provided in the same section. Recommendedfalse
for initial testing.Paths
- the paths to the log file, working directory for storing task files, and paths to MOSEK solver (see above).Paths.License
- the path to the MOSEK license file, if not using a default location (see licenese manual).Tasks.NumWorkers
- maximum number of concurrent jobs to be optimized.Tasks.QueueCapacity
- maximum number of accepted connections before new arriving jobs are rejeccted.Tasks.SolveTimeout
- maximum solver time per job.Tasks.TaskSizeLimit
- maximum size of a task in bytes.
Options can also be provided on command line, for example Tasks.NumWorkers=6
. Command-line options override configuration file options.
5.1.6 Starting the OptServer¶
To start the OptServer run
optserver --config path_to_config_file.conf [OPTIONS]
Additional startup options that may be useful
--logfile -
- write the log to stdout.--verbose
- more verbose log.--debug
- very verbose log.
5.1.7 Web GUI¶
Web GUI is available via
https://server:port/index.html
when using SSL. The initial password for the admin user can be set using the command-line (see optserver --help
).
5.2 Testing the installation¶
The server started successfully if the log output does not indicate any errors, contains the printout of the configuration used and the host/port at which the server was started.
To further test the setup continue to the section Sec. 6 (Testing the installation).