After maapi_save_config called 1020 times then it turn into really slow

my test is to input the same keypath string to let confd save the corresponding cdb data into xml format using maapi_save_config

i duplicated called this API for 2000 times using the same keypath string input, and find that, the first 1020 times call is really fast (only consume 6 sec in total for 1020 times call), but from 1021th call, it turned into really slow, each maapi_save_config API call will consume like 9 seconds to finish, it’s really strange how can such thing happen?

That indeed sounds strange. Am not a performance expert, but several brainstorming questions:

  • what is approximate size of the configuration being saved - small/med/large? (roughly megabytes/record count) (could be related to disk caching/buffering?)
  • do you create new MAAPI transaction for every “new” maapi_save_config request, or run it inside one single? (potentially unclosed transactions/sockets piling up?)
  • can you track and see CPU/disk/interrupts peak in either ConfD or supporting data provider deamons (if applicable, to see which component really is causing the lag)
  • what is approximate size of the configuration being saved - small/med/large? (roughly megabytes/record count) (could be related to disk caching/buffering?)

very small, just 7K bytes

  • do you create new MAAPI transaction for every “new” maapi_save_config request, or run it inside one single? (potentially unclosed transactions/sockets piling up?)

i tried both, same result, if i create a new MAAPI transaction for each maapi_save_config call, it will change to “maapi_finish_trans” consume 9 sec from 1021th API call but if i do it inside one single transaction, it will be maapi_save_config itself take 10 sec from 1021th call

  • can you track and see CPU/disk/interrupts peak in either ConfD or supporting data provider deamons (if applicable, to see which component really is causing the lag)

cpu is quite idle, confd is not busy for sure