Performance Tuning

MOISP is now being used by multiple countries and there is a frequent ask from many of our implementors on “What should be done for having good performance in MOSIP?”. In order to answer this question, we have come up with this document containing some of the tips and tricks.

Database Indexes

As there are multiple queries running in MOSIP we have come up with a list of indexes that are needed in MOSIP to make the query execution faster.

Postgres has a way to log slow queries. It is recommended that the implementor should enable this feature in their production or performance test environments to identify more such indexes.

Database Configuration

Below are some database level configurations that we recommend.

changes in postgresql.conf ---------------------------------- < shared_buffers = 16GB # min 128kB --- > shared_buffers = 128MB # min 128kB < huge_pages = try # on, off, or try --- > #huge_pages = try # on, off, or try < max_prepared_transactions = 1000 # zero disables the feature --- > #max_prepared_transactions = 0 # zero disables the feature < work_mem = 16MB # min 64kB < maintenance_work_mem = 3GB # min 1MB --- > #work_mem = 4MB # min 64kB > #maintenance_work_mem = 64MB # min 1MB < effective_cache_size = 32GB --- > #effective_cache_size = 4GB < log_min_duration_statement = 1000 # -1 is disabled, 0 logs all statements --- > #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements

Data Archival Scripts

It is recommended that the implementor should archive certain transactional tables used in MOSIP, after a certain number of days. We have published some archival scripts which can be used by implementors to archive database records that have been processed for quite some time.

We have started publishing these scripts from our 1.1.5 release as part of our mosip-ref-impl repository under the data-archive section.

Pod Configuration

The memory allocation and replicas needed for each pod can be set appropriately to handle the load from the field. The below pod configurations are for handling the load for the registration processes (registration client to UIN generation and storage) for around 180K registrations per day.

Please note that the details are related to only the registration process. We do not have data related to ID Authentication right now. The same will be available soon.