XMLRPC Advanced Configuration

Requests to the Billing XMLRPC API are processed by the xmlrpcd service. By default, one instance of the service is configured during the installation of CloudBlue Commerce. This instance has the following configuration:

  • TCP port 5224 is used.
  • HTTP authentication is turned on.
  • SSL is turned on.
  • 16 threads per service instance.

This configuration is stored in /usr/local/bm/etc/ssm.conf.d/xmlrpcd.conf.

Configuring Additional Instances

In addition to the default instance of the xmlrpcd service, you can configure more instances that can have different configurations. For example, you can configure two additional instances like these: (1) port 5225 is used; HTTP authentication is off; SSL is on; (2) port 5226 is used; HTTP authentication is on; SSL is off;

To configure an additional instance, perform the following steps:

  1. Create a copy of /usr/local/bm/etc/ssm.conf.d/.xmlrpcd.conf and place it next to the original file. Note that the name of the copy will be used as the name of the instance (the part before .conf).

    For example:

    cp -p /usr/local/bm/etc/ssm.conf.d/.xmlrpcd.conf /usr/local/bm/etc/ssm.conf.d/xmlrpcd_5227.conf
  2. Modify the file that you created:

    1. In the [environment] section, replace

      ATMName=XMLRPC_Container:$(_index)

      with

      ATMName=XMLRPC_Container_<port of instance>:$(_index) 

      For example:

      ATMName=XMLRPC_Container_5227:$(_index) 
    2. In the [options] section, replace

      bin = $(_name)$(_eext)

      with

      bin = xmlrpcd$(_eext)
    3. In the [options] section, specify an unused port for the instance by replacing

      arguments = $(HOST_IP):$(XMLRPCD_PORT)

      with

      arguments = $(HOST_IP):<port of instance>

      For example:

      arguments = $(HOST_IP):5227
    4. In the [environment] section, specify whether HTTP authentication is turned on or not:

      To turn it on, make sure that the AuthorizationRequired option is set to true.

      For example:

      AuthorizationRequired = true

      To turn it off, make sure that the AuthorizationRequired option is commented out. For example:

      #AuthorizationRequired = true
    5. In the [environment] section, specify whether SSL is turned on or not:

      To turn it on, prepare an SSL certificate and its private key, place them on the server, and specify their location in the SslPrivateKey and SslCertificate options.

      For example:

      SslPrivateKey = /usr/local/bm/etc/certs/API.pk_file
      SslCertificate = /usr/local/bm/etc/certs/API.cert_file
      

      Note: To prepare an SSL certificate and its private key, use the openssl req -new -nodes -x509 -days 7300 -keyout API.pk_file -out API.cert_file command.

      To turn it off, make sure that the SslPrivateKey and SslCertificate option are commented out.

      For example:

      #SslPrivateKey = _path_to_private_key_
      #SslCertificate = _path_to_certificate_
      
  3. Create an init script for the instance:

    Go to /usr/local/bm and execute the command below.

    /usr/local/stellart/bin/ssm install -f <name of instance>

    For example:

    /usr/local/stellart/bin/ssm install -f xmlrpcd_5227

    As a result, the xmlrpcd_5227 init script will be created in /etc/init.d/ for the instance.

  4. Configure the instance to start automatically with the server:

    In /usr/local/bm/etc/ssm.conf.d/global.conf, add the name of the instance to the value of the startdep option.

    For example:

    startdep = atm www xmlrpcd scheduler generic_worker xmlrpcd_5227

    Note: If /usr/local/bm/etc/ssm.conf.d/global.conf does not have the startdep option, copy it and its value from /usr/local/bm/etc/ssm.conf.d/.global.conf. After that, make your changes in /usr/local/bm/etc/ssm.conf.d/global.conf.

  5. Start the instance by executing the following command:

    /etc/init.d/<name of instance> start

    For example:

    /etc/init.d/xmlrpcd_5227 start

After configuring and starting the additional instance, make sure that it works as expected. For example, make a call of a method by using curl.

Tuning Performance

You can tune the performance of an instance of the xmlrpcd service by using the Threads option in the respective configuration file. On a server that has many CPU cores, the performance of an instance grows as the number of threads increases, up to a certain point.

To modify the number of threads for an instance, follow these steps:

  1. In a text editor, open the configuration file of the instance that you need.

    For example, to modify the number of threads for the default instance, open /usr/local/bm/etc/ssm.conf.d/xmlrpcd.conf.

  2. In the [environment] section, modify the Threads option as you need.
  3. Restart the instance by running the command below.

    /etc/init.d/<name of instance> restart

    For example, to restart the default instance, execute:

    /etc/init.d/xmlrpcd restart