Is there a way to force a buffer flush?

Hello all!

Is there a way to force a buffer flush? At the moment I’m thinking about setting the write_limit to 1 for a few seconds. But is there a better way?

Thanks

Matthias

Matthias,

even setting write_limit to 1 may not give you exactly what you want / need
as it doesn’t immediately force a bufferflush, and it may cause a lot more
bufferflushes than you want, depending on the system activity at that time.

On mainframe Adabas one can force a bufferflush with a C1 command,
not sure if this is implemented on OpenSystems as well, at least it isn’t
documented, you’d have to ask support if there may be an “undocumented
feature”.

What exactly do you need to force that bufferflush for ?

Cheers

   Wolfgang

Hi Wolfgang,

Of course you’re right. I set the WRITE_LIMIT to 2 on monday. Sometimes I got 2-3 BF within 10 seconds… That’s not exactly what I want.

Thanks fot the hint. I’m gonna ask …

That’s a long story. Parameter WRITE_LIMIT - Adabas-Natural - Software AG Tech Community & Forums

To make it short: Performance problems during buffer flush. So one idea is (for example) to make a buffer flush during lunchtime, when most of the users won’t use the programs.

Matthias

Matthias,

Ah, THAT story, I see.
Hopefully Wolfgang Obmann can provide some insight as to if there is
a reliable way to force a bufferflush on demand.

But there’s the problem, you can set WRITE_LIMIT as low as you want, when noone is there
to fill the BP with updates no flush will happen :wink:

Hi Matthias,

adaopr ext_backup=prepare
adaopr ext-backup=abort

would make a buffer flush. But it will also require all transactions to be synchronized i.e. all have to be on ET-status and have to wait for it (TT parameter). TT can be reduced for this process but may result in user being timed out.

Perhaps not a good alternative but it depends on how eager you are in making a buffer flush? :?

Hello Mogens!

We don’t want to make an ET_SYNC. Blocking all new transactions would result in a dialog freeze (from the user’s point of view)…

Regards,

Matthias

Wolfgang,

Meanwhile I found a way on my own. Your C1-thing was a good hint. The documentation says, C1 writes a checkpoint. And this is exactly what ADAINV is doing - even if ADAINV aborts, it does a buffer flush.

example:

adainv db=14 invert=30 fields AA end_of_fields
%ADAINV-I-STARTED,      15-DEC-2011 10:11:58, Version 6.1.10.10 (Solaris 64Bit)
%ADAINV-I-DBON, database 14 accessed online
AA
^
%ADAINV-E-ISDESC, field has already descriptor status
%ADAINV-E-NOFIELDS, no fields supplied

%ADAINV-I-IOCNT,          3 IOs on dataset ASSO
%ADAINV-I-ABORTED,      15-DEC-2011 10:11:59, elapsed time: 00:00:01

adamon looks like that:

Commands         I/Os per sec      Throw   Buffer pool
per sec      ASSO DATA WORK PLOG   backs   Hit  Flushs
------------------------------------------------------
       0        0    0    0    0       0     -       0
       0        0    0    0    0       0     -       0
       0        0    0    0    0       0     -       0
       7        1   56    6    1       0     -       3    <-- ADAINV here
       0        0    0    0    0       0     -       0
       1        0    0    0    0       0     -       0
       0        0    0    0    0       0     -       0

and the “write pool” was almost empty at that time:

                       ADANUC Version 6.1.10.10
        Database 14    Buffer Pool Statistics   on 15-DEC-2011 10:14:42


Buffer Pool Size   :   536,870,912

Pool Allocation                        RABNs present
---------------                        -------------
Current     ( 72%) :   390,276,096     ASSO               :        12,901
Highwater   ( 72%) :   390,276,096     DATA               :        38,512
                                       WORK               :             0
                                       NUCTMP             :             1
                                       NUCSRT             :             0

I/O Statistics                         Buffer Flushes
--------------                         --------------
Logical Reads      :     3,093,026     Total              :            28
Physical Reads     :        51,402     To Free Space      :             0
Pool Hit Rate      :            98%
                                       Write Limit  ( 60%):   322,122,000
Physical Writes    :        26,612     Modified     (  0%):       462,848



                       ADANUC Version 6.1.10.10
        Database 14    Buffer Pool Statistics   on 15-DEC-2011 10:15:22


Buffer Pool Size   :   536,870,912

Pool Allocation                        RABNs present
---------------                        -------------
Current     ( 72%) :   390,276,096     ASSO               :        12,901
Highwater   ( 72%) :   390,276,096     DATA               :        38,512
                                       WORK               :             0
                                       NUCTMP             :             1
                                       NUCSRT             :             0

I/O Statistics                         Buffer Flushes
--------------                         --------------
Logical Reads      :     3,093,036     Total              :            31
Physical Reads     :        51,402     To Free Space      :             0
Pool Hit Rate      :            98%
                                       Write Limit  ( 60%):   322,122,000
Physical Writes    :        26,612     Modified     (  0%):             0


%ADAOPR-I-TERMINATED,   15-DEC-2011 10:15:24, elapsed time: 00:00:00

BTW: “%ADAINV-E-NOTAVL, File ?? not available” results in 2 flushes.

Next question is: Are there any side effects - for example in case of a restore + recover via plog?

Regards

Matthias

Hi Matthias,

Your adainv was running at 10:11:58 and the two “display bp” were running at 10:14:42 and 10:15:22. Much later (nearly 3 min). And between these two displays (just 40 secs in between) no of buffer flushes has bumped with 3. What makes you think the bp displays prove buffer flushes has taken place at adainv time?

adamon shows 3 buffer flushes but at which time?

Regenerate should not be affected by this. There should be nothing to do even if adainv has written a checkpoint. And invert - as far as I remember - is done “on the flight” by regenerate.

If you want to force a buffer flush, just perform adadbm db=…
There were complaints by customers that ADADBM sometimes requires a lot of time; this is because of the buffer flush. Therefore this behaviour may be changed with a future version, but because other custumers may rely on this behaviour this will not be done for the currently released versions.

Regards,
Wolfgang

Your’re right. The time doesn’t match. Obviously the adaopr-bp is showing my second try.

I was alone on my test-database. I did several tries (with reinvert, invert+descriptor already exists and invert+File in use) and every time, the modified byte count was reset to 0, the number of buffer flushes was increased by 2 or 3. So I’m sure Adabas did a buffer flush while ADAINV was running.

I did the adainv while watching adamon … interval=1. The listing was quite long so I just cut out the relevant part…

Thank you, Mogens.

Hello Wolfgang Obmann,

Works fine! Thank you very much!

@Mogens: Here’s my try with adadbm:

$ adaopr db=12 di=bp
%ADAOPR-I-STARTED,      15-DEC-2011 16:07:28, Version 6.1.10.10 (Solaris 64Bit)

Database 12, startup at 24-NOV-2011 21:22:07
ADANUC Version 6.1.10.10, PID 25604

                       ADANUC Version 6.1.10.10
        Database 12    Buffer Pool Statistics   on 15-DEC-2011 16:07:19


Buffer Pool Size   :   536,870,912

Pool Allocation                        RABNs present
---------------                        -------------
Current     ( 42%) :   230,350,848     ASSO               :        15,119
Highwater   ( 42%) :   230,350,848     DATA               :        17,751
                                       WORK               :             0
                                       NUCTMP             :             5
                                       NUCSRT             :             0

I/O Statistics                         Buffer Flushes
--------------                         --------------
Logical Reads      :     7,808,175     Total              :            79
Physical Reads     :        34,565     To Free Space      :             0
Pool Hit Rate      :            99%
                                       Write Limit  ( 60%):   322,122,000
Physical Writes    :         2,302     Modified     (  0%):       561,152


%ADAOPR-I-TERMINATED,   15-DEC-2011 16:07:28, elapsed time: 00:00:00
$ adadbm db=12
%ADADBM-I-STARTED,      15-DEC-2011 16:07:49, Version 6.1.10.10 (Solaris 64Bit)
%ADADBM-I-DBON, database 12 accessed online

%ADADBM-I-TERMINATED,   15-DEC-2011 16:07:49, elapsed time: 00:00:00
$ adaopr db=12 di=bp
%ADAOPR-I-STARTED,      15-DEC-2011 16:08:01, Version 6.1.10.10 (Solaris 64Bit)

Database 12, startup at 24-NOV-2011 21:22:07
ADANUC Version 6.1.10.10, PID 25604

                       ADANUC Version 6.1.10.10
        Database 12    Buffer Pool Statistics   on 15-DEC-2011 16:07:59


Buffer Pool Size   :   536,870,912

Pool Allocation                        RABNs present
---------------                        -------------
Current     ( 42%) :   230,350,848     ASSO               :        15,119
Highwater   ( 42%) :   230,350,848     DATA               :        17,751
                                       WORK               :             0
                                       NUCTMP             :             5
                                       NUCSRT             :             0

I/O Statistics                         Buffer Flushes
--------------                         --------------
Logical Reads      :     7,808,185     Total              :            80
Physical Reads     :        34,565     To Free Space      :             0
Pool Hit Rate      :            99%
                                       Write Limit  ( 60%):   322,122,000
Physical Writes    :         2,302     Modified     (  0%):             0


%ADAOPR-I-TERMINATED,   15-DEC-2011 16:08:01, elapsed time: 00:00:00
$
$ adamon db=12 interval=1
%ADAMON-I-STARTED,      15-DEC-2011 16:07:43, Version 6.1.10.10 (Solaris 64Bit)

Database 12, startup at 24-NOV-2011 21:22:07
ADANUC Version 6.1.10.10, PID 25604



Commands         I/Os per sec      Throw   Buffer pool
per sec      ASSO DATA WORK PLOG   backs   Hit  Flushs
------------------------------------------------------
       0        0    0    0    0       0     -       0
       0        0    0    0    0       0     -       0
       0        0    0    0    0       0     -       0
       0        0    0    0    0       0     -       0
       0        0    0    0    0       0     -       0
       0        0    0    0    0       0     -       0
       0        0    0    0    0       0     -       0
       4       82   22    2    1       0     -       1
       0        0    0    0    0       0     -       0
       2        0    0    0    0       0   100%      0
       0        0    0    0    0       0     -       0
       0        0    0    0    0       0     -       0
       0        0    0    0    0       0     -       0
^C

Summary (measurement time: 00:00:12)

                 Totals    Ratio per sec
----------------------------------------
Commands     :        6                0
ASSO I/Os    :       82                6
DATA I/Os    :       22                1
WORK I/Os    :        2                0
TEMP I/Os    :        3                0
PLOG I/Os    :        1                0
Throwbacks   :        0                0
Buffer Hit   :      100%
Buffer flushs:        1
     Explicit:        1

%ADAMON-I-TERMINATED,   15-DEC-2011 16:07:55, elapsed time: 00:00:12
$

Hi Matthias,

This looks much more nice and clean. :slight_smile: