Skip to main content
Version: 2.0

Microservices optimizations

Introduction

REGARDS provides several type of configurations in order to optimize its performances:

  • the number of parallel processes that can be run by microservice - this global thread pool will be shared by all tenants on every instance of microservice (regards.jobs.pool.size)
  • the number of parallel database connections permitted by tenant and by microservice - a connection pool is created for every tenant on every instance of microservice (regards.jpa.multitenant.maxPoolSize)
  • the number of entities handled inside a microservice process. Every REGARDS process exposes a property to override the number of entities handled on a bulk
Important

Usually, it is more efficient to configure each service to allow:

  • a large number of parallel processes
  • a small number of entities to process on every parallel process

But it depends on how many resources you can allocate to REGARDS services.

Implications

When you increase the number of parallel processes:

  • you need to increase database connections
  • you use more CPU,or vCPU, of your server

When you add more entities to handle by job/thread:

  • you increase the amount of memory used on the server
  • you increase the duration of the database commit

Default microservice configurations:

MicroserviceDefault RAMDefault job pool size (shared)Default DB pool size (by tenant)
rs-config128mNoneNone
rs-registry128mNoneNone
rs-admin512mNone5 per tenant of the instance
rs-admin-instance512mNone5 per instance
rs-access-project512mNone5 per tenant of the instance
rs-access-instance512mNone3 per instance
rs-dam1280mNone5 per tenant of the instance
rs-ingest1536m55 per tenant of the instance
rs-fem1024m55 per tenant of the instance
rs-notifier1280m510 per tenant of the instance
rs-storage1024m55 per tenant of the instance
rs-dataprovider1024m55 per tenant of the instance
rs-catalog1024m55 per tenant of the instance
rs-order1280m55 per tenant of the instance
rs-worker-manager1024m55 per tenant of the instance
rs-processing2048m505 per tenant of the instance
rs-lta-manager512m55 per tenant of the instance
Many CPU adaptation

If your server(s) has a lot of CPU, or vCPU, we recommend you to increase on each microservice the value of job pool size and DB pool size.
Don't forget to increase these properties together to avoid DB connection starvation during microservice processes.

Ingest optimization

PropertiesDescriptiondefault
Ansible property:
group_docker_mservices.ingest.configuration.jobs_pool_size
REGARDS property:
regards.jobs.pool.size
Maximum number of ingestion processes (ingest, delete, update...)2
Ansible property:
group_docker_mservices.ingest.configuration.database_max_pool_size
REGARDS property:
regards.jpa.multitenant.maxPoolSize
Maximum number of parallel database connections usable5
Ansible property:
group_docker_mservices.ingest.configuration.read_batch_size
REGARDS property:
regards.storage.client.response.batch.size
Number of storage request response to handle at a time500
Ansible property:
group_docker_mservices.ingest.configuration.entities_per_job
REGARDS property:
regards.ingest.aips.scan.iteration-limit
Number of entities to handle in one ingestion process (ingest, delete, update...)100

FEM optimization

PropertiesDescriptiondefault
Ansible property:
group_docker_mservices.fem.configuration.jobs_pool_size
REGARDS property:
regards.jobs.pool.size
Maximum number of FEM processes (ingest, delete, update...)2
Ansible property:
group_docker_mservices.fem.configuration.database_max_pool_size
REGARDS property:
regards.jpa.multitenant.maxPoolSize
Maximum number of parallel database connections usable5
Ansible property:
group_docker_mservices.fem.configuration.read_batch_size
REGARDS property:
regards.fem.batch.size
Number of FEM requests to handle at a time1000
Ansible property:
group_docker_mservices.fem.configuration.entities_per_job
REGARDS property:
regards.fem.max.bulk.size
Number of entities to handle in one FEM process (create, delete, update...)1000

Notifier optimization

PropertiesDescriptiondefault
Ansible property:
group_docker_mservices.notifier.configuration.jobs_pool_size
REGARDS property:
regards.jobs.pool.size
Maximum number of Notifier processes (ingest, delete, update...)2
Ansible property:
group_docker_mservices.notifier.configuration.database_max_pool_size
REGARDS property:
regards.jpa.multitenant.maxPoolSize
Maximum number of parallel database connections usable5
Ansible property:
group_docker_mservices.notifier.configuration.read_batch_size
REGARDS property:
regards.notifier.batch.size
Number of AMQP Notifier requests to handle at a time1000
Ansible property:
group_docker_mservices.fem.configuration.entities_per_job
REGARDS property:
regards.notifier.max.bulk.size
Number of entities to handle in one Notifier process1000

Storage optimization

Note : It is recommended to not set a big value to the read_batch_size property for storage microservice. Recommended value between 10 and 100.

PropertiesDescriptiondefault
Ansible property:
group_docker_mservices.storage.configuration.jobs_pool_size
REGARDS property:
regards.jobs.pool.size
Maximum number of Storage processes (store, delete, copy...)2
Ansible property:
group_docker_mservices.storage.configuration.database_max_pool_size
REGARDS property:
regards.jpa.multitenant.maxPoolSize
Maximum number of parallel database connections usable5
Ansible property:
group_docker_mservices.storage.configuration.read_batch_size
REGARDS property:
regards.storage.availability.items.bulk.size
Number of file availibility requests to handle at a time10
Ansible property:
group_docker_mservices.storage.configuration.read_batch_size
REGARDS property:
regards.storage.copy.items.bulk.size
Number of copy requests to handle at a time10
Ansible property:
group_docker_mservices.storage.configuration.read_batch_size
REGARDS property:
regards.storage.deletion.items.bulk.size
Number of deletion requests to handle at a time10
Ansible property:
group_docker_mservices.storage.configuration.read_batch_size
REGARDS property:
regards.storage.reference.items.bulk.size
Number of file reference requests to handle at a time10
Ansible property:
group_docker_mservices.storage.configuration.read_batch_size
REGARDS property:
regards.storage.store.items.bulk.size
Number of store requests to handle at a time10
Ansible property:
group_docker_mservices.storage.configuration.entities_per_job
REGARDS property:
regards.storage.cache.requests.per.job
Number of file availibility requests to handle in one Storage process100
Ansible property:
group_docker_mservices.storage.configuration.entities_per_job
REGARDS property:
regards.storage.deletion.requests.per.job
Number of deletion requests to handle in one Storage process100
Ansible property:
group_docker_mservices.storage.configuration.entities_per_job
REGARDS property:
regards.storage.storage.requests.per.job
Number of files to store requests to handle in one Storage process100
Ansible property:
group_docker_mservices.storage.configuration.restoration_availability_bulk_limit
REGARDS property:
regards.storage.availability.request.product.bulk.limit
Maximum number of products inside a single availibility request. This limitation exists to avoid too many access to the storage location at a time.100

Data Management optimization

PropertiesDescriptiondefault
Ansible property:
group_docker_mservices.dam.configuration.database_max_pool_size
REGARDS property:
regards.jpa.multitenant.maxPoolSize
Maximum number of parallel database connections usable5
Ansible property:
group_docker_mservices.dam.configuration.crawler_batch_size
REGARDS property:
regards.crawler.max.bulk.size
Number of entities to request at a time from the data source to harvest10000
Ansible property:
group_docker_mservices.dam.configuration.crawler_rate_delay_ms
REGARDS property:
regards.ingester.rate.ms
Time elapsed in milliseconds between two scans of configured crawlers to check if a datasource can be harvest60000

Order optimization

PropertiesDescriptiondefault
Ansible property:
group_docker_mservices.order.configuration.jobs_pool_size
REGARDS property:
regards.jobs.pool.size
Maximum number of order processes5
Ansible property:
group_docker_mservices.order.configuration.database_max_pool_size
REGARDS property:
regards.jpa.multitenant.maxPoolSize
Maximum number of parallel database connections usable5
Ansible property:
group_docker_mservices.order.configuration.entities_per_job
REGARDS property:
regards.order.batch.size
Number of entities to handle in one Order process1000

Dataprovider optimization

PropertiesDescriptiondefault
Ansible property:
group_docker_mservices.dataprovider.configuration.jobs_pool_size
REGARDS property:
regards.jobs.pool.size
Maximum number of Dataprovider processes5
Ansible property:
group_docker_mservices.dataprovider.configuration.database_max_pool_size
REGARDS property:
regards.jpa.multitenant.maxPoolSize
Maximum number of parallel database connections usable5
Ansible property:
group_docker_mservices.dataprovider.configuration.entities_per_job
REGARDS property:
regards.acquisition.batch.size
Number of entities to handle in one Dataprovider process100

Worker Manager optimization

PropertiesDescriptiondefault
Ansible property:
group_docker_mservices.worker_manager.configuration.database_max_pool_size
REGARDS property:
regards.jpa.multitenant.maxPoolSize
Maximum number of parallel database connections usable5
Ansible property:
group_docker_mservices.worker_manager.configuration.read_batch_size
REGARDS property:
regards.worker_manager.request.bulk.size
Number of Worker Manager requests to handle at a time1000

Processing optimization

PropertiesDescriptiondefault
Ansible property:
group_docker_mservices.processing.configuration.jobs_pool_size
REGARDS property:
regards.jobs.pool.size
Maximum number of Processing processes50
Ansible property:
group_docker_mservices.processing.configuration.database_max_pool_size
REGARDS property:
regards.jpa.multitenant.maxPoolSize
Maximum number of parallel database connections usable5

LTA Manager optimization

PropertiesDescriptiondefault
Ansible property:
group_docker_mservices.lta_manager.configuration.jobs_pool_size
REGARDS property:
regards.jobs.pool.size
Maximum number of LTA Manager processes5
Ansible property:
group_docker_mservices.lta_manager.configuration.database_max_pool_size
REGARDS property:
regards.jpa.multitenant.maxPoolSize
Maximum number of parallel database connections usable5
Ansible property:
group_docker_mservices.lta_manager.configuration.entities_per_job
REGARDS property:
regards.ltamanager.request.bulk.size
Number of entities to handle in one process (create, delete, update...)1000