Configuration of Swagger Port to Reduce CPU Utilization

The use case comprised of multiple REST services. Both the services were deployed on separate AppNodes. Each of the AppNodes were created in separate AppSpaces. The AppNodes were configured to have the same Swagger framework port, details of which are provided in the following section.

For REST services, documentation endpoint configuration properties can be specified at the AppSpace or the AppNode level. Properties set at the AppNode level only apply to applications running on that AppNode. One of the properties at the AppNode level is the Swagger framework port, the property for which is as follows:

bw.rest.docApi.port=7777

This property specifies the port on which the Swagger framework serves the API's documentation endpoint, api-docs, and so on. For more information, refer to the TIBCO ActiveMatrix BusinessWorks 6.4.2 Administration Guide.

The property can be configured in the AppNode config.ini file and in the TEA UI as shown below:

Parameter location = AppNodes > Select AppNode > Configure > General

Default Value = 7777

Testing and Measurement

The testing was focused on the aspects below:

  • The two REST services were deployed on separate AppNodes and started.
  • No requests or load was sent to the services. The CPU usage of the AppNodes was continuously monitored.
  • One of the AppNode showed continuous CPU activity without any load and even after stopping the application. This was due to the same Swagger port being used by the AppNodes.

Solution for Performance Improvement

  • The Swagger framework port for one of the AppNodes was changed from 7777 to another value.
  • This configuration change stops the CPU activity when the applications are in the stopped/running state.
  • In case of multiple REST services deployed to multiple AppNodes, it is recommended to use unique Swagger ports for each of the AppNodes.