Preprod Total Events: 10 lakhs, 25 partition gm_0_0_0_aec_cp_search_inventory_v7 2 2 66.6gb gm_0_0_0_aec_cp_ims_inventory_v3 2 2 93.3gb 5 concurrent consumer

Prod Total Events: 60 lakhs on prod gm_0_0_0_aec_cp_search_inventory_v1 881.9gb gm_0_0_0_aec_cp_ims_inventory_v1 811.1gb

.TimeEvents lagtime diffevent processed
1.35280,056
1.48240,55713 min40K
1.59208,2579 min32K
2.06188,7447 min12K
2.09180,0443 min8K
2.18162,2459 min18K
2.36107,25218 min55K
2.5156,95315 min51K
2.5249,5531 min7K
2.5442,5532 min7K
2.5540,5531 min2K
2.5931,0544 min9K
3.15done15 min31K

Current time taken matrix for preprod 10 lakh events Took 3 hours to run

Task nametime in mstime in mstime in mstime in mstime in mstime in mstime in ms
VALIDATE011
FETCH_DC_DEALER_DETAILS0
IMS_DATA_DOWNLOAD_FROM_STORAGE2118627
TRANSFORM_TO_SEARCH_ES_PAYLOAD0
TRANSFORM_TO_IMS_ES_PAYLOAD11
ADD_CS_DEALER_DETAILS_IN_SEARCH_ES0
SAVE_TO_IMS_ES_INDEX3048488462
SAVE_TO_SEARCH_STORAGE2752953124
total work flow329971026516523671

Current time taken matrix for preprod 20 lakh events triggered at 12 AM

Task nametime in mstime in mstime in mstime in mstime in ms
VALIDATE311
FETCH_DC_DEALER_DETAILS00
IMS_DATA_DOWNLOAD_FROM_STORAGE18618
UPLOAD_TO_STORAGE54391645
SAVE_TO_DB899
TRANSFORM_TO_SEARCH_ES_PAYLOAD00
TRANSFORM_TO_IMS_ES_PAYLOAD1111
ADD_CS_DEALER_DETAILS_IN_SEARCH_ES001
SAVE_TO_IMS_ES_INDEX83948488541828487
SAVE_TO_SEARCH_STORAGE2529531271722350
total work flow93510010261028993942

Problems:

All network integrations was processed as a single event.

  1. such as kafka consumer was consuming single event at a time
  2. Single vin was getting saved at a time in ES, too much overloaded network calls to ES
  3. Replay trigger was fetch data from mongo in batch, so producer was able to push 20 lakh vins with in 10 min
  4. Blob interaction was also done as a single call

Solution

First POC for batch ES interaction

  1. change kafka consumer batch consumer
  2. Query mongo in bluk
  3. Save ES in bulk
  4. Fetch and save blob in bulk or parallel
  5. Moved Fetch dealer details from single to batch api

In memory consumption in batch processing

>  batch:100

> concurrent consumer:5

> 500 * 16/17KB data per vin = 7500 KB ~ **7.5 MB** for TInventory blob object data.

> Currently its only every

> 5 * 16 KB

2nd solution

Batch save to ES as a separate async task Send transformed message payload via kafka `elastic max data size/ max record can be saved in bulk 100 mb or 10000

`kafka disk uses 1 vin transformed data: 14KB 1 KB = 1/14 vin data 1 * 1012 * 1012 = 6*6000000 / 14 ~ 6 * 428000 approx vin at one time

2568000 vin will consume 6 gb space

for 40 lakh vins to be replayed, we will need 24 GB data broker storage on preprod, with retention period of this topic as 3 hours need to run and test the outcome

3rd Solution

Send list of download url for blob, download a list. transform, then save in ES in bulk>> bad idea

GC setting for batch processing, using parallel GC: -XX:+UseParallelGC