Configuration of the Swagger port to reduce CPU Utilization

The usecase comprised of multiple REST services. Both the services were deployed on separate AppNodes and each AppNode was created in a separate AppSpace. The AppNodes were configured to have the same Swagger framework port and The details of the Swagger port are provided in the section below.

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, bw.rest.docApi.port=7777

This property specifies the port on which Swagger framework serves the API's documentation endpoint,api-docs etc. For more information, see TIBCO ActiveMatrix BusinessWorks™ 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

Testing was focused on the following aspects:
  • 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, even after stopping the application. This was because the same Swagger port was 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 the case of multiple REST services deployed to multiple AppNodes, it is recommended to use unique Swagger ports for each AppNode.