Performance tuning suggestions on installable cloud apps

Hosting Web APIs and database on the same LAN

Same as any other web applications, for installable cloud apps, the PowerServer Web APIs must be published to a server that locates on the same LAN as the database server. If the database is not on same network as the Web APIs, every request has to go a long way from PowerServer to the database, it is highly possible that there will be performance problem.

Web API publishing method

To ensure the Web API execution performance, it is strongly recommended that you publish the Web APIs to IIS or Docker or Kestrel. The performance would be much affected if you just use the Compile & Run Web APIs (that is, running the Web APIs from the SnapDevelop IDE). See Tutorials for step-by-step instructions on how to publish the Web APIs.

Choosing the right app file download option

The project settings provide the app download options: Download the app files as necessary, and download all the app files at app startup.

  • If you select the "Download the app files as necessary", the following files will be downloaded before the app runs: 1) The PowerBuilder Runtime files; 2) The application executable; and 3) The files you selected to be preloaded in the External Files settings. The other files are downloaded only when they are called by the app.

  • If you select the "Download all the app files at app startup", the runtime files, app executable, the application files, and external files are all downloaded at the startup, except for the image files that are set as “dynamically-loaded” in the External Files settings.

If you want to shorten the app-startup time, you can set to "Download the app files as necessary", but the application-running performance will be compromised. Note that usually, if you have already run certain function of an application, when you run it again, there is no need to download any additional files.

Improving database performance with connection pooling

Instead of opening and closing connections for every request, connection pooling uses a cache of database connections that can be reused when future requests to the database are required. For example, right now the connection pooling is enabled by default for SQL Anywhere if the database server is on the same machine as PowerBuilder. If SQL Anywhere is on a different machine, you need manually enable the connection pooling.

Debugging the performance

If you want to find out what factors/operations cause the performance issue, we suggest that you download Fiddler and use it to track the web traffic between the application and the server, and then locate the web page/operation that is running slowly. For more instructions on how to use Fiddler, please check here: Debugging with Fiddler. Be sure to run the PowerServer Web APIs before you start Fiddler (or any other Web debugging proxy tool). Otherwise, the PowerServer Web APIs will fail to start.