Under load testing api gateway fails with OutOfMemoryExecpetion when handling api portal requests.
Cause
Gettng list of the API's was a slow process, so to optimize a more direct JDBC connection to query the API's can be used in the API Gateway from API Portal 3.5 CR2 onwards.
Environment
API Portal 3.5 CR2 + API Gateway 9.3
Resolution
1. Login to your API Gateway via Policy Manager
2. Create a JDBC connection with the following details:
Connection Name: Local Driver Class: com.l7tech.jdbc.mysql.MySQLDriver JDBC URL: jdbc:mysql://<Primary DB Server Hostname-OR-IPaddy>,<Secondary DB Server Hostname-OR-IPaddy>:3306/ssg Username: gateway Password: <gateway user password set during initial setup>
3. Click “Test” button to ensure your configuration is valid
4. Open line 355 of the portalman policy (Perform JDBC Query Assertion) and set the drop down to: JDBC Connection = Local
5. Save and Activate the policy.
6. Go to "Manage Cluster-Wide Properties" and create a new cluster-wide property named: portal.useJDBCToQueryAPIs and set the value to: true
***Note: make sure there isn't any white space in the cluster-wide property name or value***
7. Test the API Portal by going to Dashboard > APIs and ensure that you're getting a list of APIs returned.
If it returns a list of APIs, you should be seeing a noticeable performance improvement when retrieving the list of APIs. Let me know if you have any questions.