CPS-786 Spike: scale CPS-NCMP horizontal using several instances of the service
Overview
This analysis is to see the possibility of scaling the CPS-NCMP component horizontally to respond well to increased load.
https://lf-onap.atlassian.net/browse/CPS-786
Scenario
Load scenario: (model)sync 10,000 cm handles with the same schema-set: imagine this is done by firing 1000 requests of (batches of) 10 cm handles registration to a pool of cps-ncmp instances
CPS Deployment in ONAP
Currently, CPS in ONAP deployment has the following configuration shown in the table below.
**Resources listed below is only relevant for this study
Resource name | Description | Notes |
|---|---|---|
cps-and-ncmp deployment |
|
|
postgres deployment |
| |
cps-core service |
|
|
postgres Service |
|
Vertical Scaling
In the case, that for one instance of the service and it's seen that bottleneck comes from the connection pool size, this can be configured to change from the default size of 10.
CPS application runs with Spring Boot and by default, the DataSource implementation that comes with this, and on CPS, is HikariCP. Therefore, to modify the maximum pool size from 10 ,the yaml file 'application.yaml' in cps-application folder can be updated to add maximum pool size definition.
Example:
.....
spring:
.....
datasource:
url: jdbc:postgresql://${DB_HOST}:1234/cpsdb
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driverClassName: org.postgresql.Driver
initialization-mode: always
hikari:
maximum-pool-size: 20
**The following change on the example above has been tested and passes all CSIT tests and is deployable.
Load Balancing Options
Load balancing option | Description | Issues | Possible solution |
|---|---|---|---|
Increasing pod/replica count via deployment object
| Replica count is changed from the default number to the number of pods desired to be added through values.yaml file
|
|
|
Database Bottleneck | ****can be a different study on how to scale Postgres horizontally
| ||
Using Horizontal Pod Autoscaling |
|
|
|
|
- type: Object ....
|
References:
https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/
https://www.gsd.inesc-id.pt/~mpc/pubs/smr-kubernetes.pdf
https://www.heydari.be/papers/WoC-stef.pdf
http://bawkawajwanw.com/books/masteringkubernetes.pdf
https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/
https://www.heydari.be/papers/WoC-stef.pdf
https://www.weave.works/blog/how-to-correctly-handle-db-schemas-during-kubernetes-rollouts
https://www.diva-portal.org/smash/get/diva2:1369598/FULLTEXT01.pdf
https://momjian.us/main/writings/pgsql/sharding.pdf