#1 2021-05-22 19:58:31

wxinix
Member
Registered: 2020-09-07
Posts: 121

mORMot2, strange performance pattern

mORMot2,  Zeos,  PostgresQL

Every ONE minute, the software (that uses mORMot2 as the ORM) will BATCH ADD a fixed number of 6014 rows.   Again,  This happens EVERY ONE minute.

I logged the time for each BATCH ADD operation.

I am perplexed by the pattern I observed - for every 5 consecutive BATCH ADD operations (that happened in 5 consecutive minutes), I saw the following  pattern repeated like below:

BatchAdd 6014 rows takes about 2 sec
BatchAdd 6014 rows takes about 300 ms
BatchAdd 6014 rows takes about 300 ms
BatchAdd 6014 rows takes about 300 ms
BatchAdd 6014 rows takes about 300 ms


In other words, every 5 minutes, the BatchAdd is slower to insert, then in between much faster.

What could cause this pattern?   Could this because I "misuse" mORMot, or some magic switch misplaced?

I'd expect EACH BatchAdd to have relatively similar time......

Last edited by wxinix (2021-05-22 19:59:37)

Offline

#2 2021-05-22 20:02:07

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,350
Website

Re: mORMot2, strange performance pattern

Before asking from abstract, enable the logs and check how many time take each step.
Perhaps the connection is recreated, or whatever.
I can't comment here. It could come from very diverse reasons. Also 6014*3 = 18,000 rows per seconds seems a pretty low number to me.

(and please don't put the logs here, but e.g. as an external gist, as asked by the forum rules)

Offline

#3 2021-05-22 21:07:34

wxinix
Member
Registered: 2020-09-07
Posts: 121

Re: mORMot2, strange performance pattern

ab wrote:

Before asking from abstract, enable the logs and check how many time take each step.
Perhaps the connection is recreated, or whatever.
I can't comment here. It could come from very diverse reasons. Also 6014*3 = 18,000 rows per seconds seems a pretty low number to me.

(and please don't put the logs here, but e.g. as an external gist, as asked by the forum rules)

I am pretty sure that the connection is not re-created.

This log snapshot shows that:  BatchAdd 6014 rows takes 2.14 s

https://www.dropbox.com/s/cnbqzmzpmtub6 … 5.png?dl=0

This log snapshot shows that: for the NEXT MINUTE,  BatchAdd 6014 rows takes 263.39ms

https://www.dropbox.com/s/ggfi5aqrpill4 … 9.png?dl=0

I don't understand why it has x10 speed difference, for the same number of rows.  Any heads up appreciated!

Last edited by wxinix (2021-05-22 21:10:13)

Offline

Board footer

Powered by FluxBB