473,394 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Re: heavy inserts and bufferpool

<dc********@aim.comwrote in message news:fu*********@drn.newsguy.com...
>I am new to DB2.

version info DB2 9.5 , Linux

some more info:-
create bufferpool bp1 size 140000 pagesize 8K ;
update db cfg for test using CHNGPGS_THRESH 5 ;
update db cfg for test using NUM_IOCLEANERS 3 ;
update db cfg for test using NUM_IOSERVERS 3 ;

I am tying to convert a perl program to multi threaded.
To test the difference I created a table and loaded 100000 rows.
It loads fine as a single thread program. Loads it in about 15 seconds.

When I run it as multi threaded with 3 threads and all 3 of them
inserting, I
frequently
get this message:-

DBD::DB2::st execute failed: [IBM][CLI Driver][DB2/LINUX] SQL1218N There
are no
pages currently available in bufferpool "4097". SQLSTATE=57011
DBD::DB2::st execute failed: [IBM][CLI Driver][DB2/LINUX] SQL1218N There
are no
pages currently available in bufferpool "4097". SQLSTATE=57011

It seems the rate of insert is much higher than the ability of DB2 to
clean the
dirty pages
out and frequently it reaches a point where it can't find a single free
page to
load the newly inserted row. but why this is an error. I have informix
background and in informix we don't see such errors.

Once I change the code and insert a sleep time after every X number of
rows
inserted,
the problem goes way. essentially giving the engine some time to flush the
dirty
buffers.

Or may be I am missing out a basic thing.

thanks.
I would try these:

db2set DB2_USE_ALTERNATE_PAGE_CLEANING=ON (this will override
CHNGPGS_THRESH)
db2set DB2_SKIPINSERTED=ON (this will reduce lock contention on inserts)
db2 update db cfg for test using NUM_IOCLEANERS 8
db2 update db cfg for test using LOGBUFSZ 256
db2 update db cfg for test using DBHEAP 2000 (unless it already at least
this high)

Jun 27 '08 #1
3 4956
<dc********@aim.comwrote in message news:fu********@drn.newsguy.com...
In article <dS******************@bignews9.bellsouth.net>, Mark A says...
>>db2set DB2_USE_ALTERNATE_PAGE_CLEANING=ON (this will override
CHNGPGS_THRESH)
db2set DB2_SKIPINSERTED=ON (this will reduce lock contention on inserts)
db2 update db cfg for test using NUM_IOCLEANERS 8
db2 update db cfg for test using LOGBUFSZ 256
db2 update db cfg for test using DBHEAP 2000 (unless it already at least
this high)

I did it and it works. I still get this error but very rarely.
per a db2 dba, it is this which solved my problem.

db2set DB2_USE_ALTERNATE_PAGE_CLEANING=ON

I am going to test it again with everything at default setting,
and then set the above.
You probably don't want to use the default setting of 8 for LOGBUFSZ (at
least that was the default before version 9.5). For your high insert volume
application 256 should work better (and the LOGBUFSZ comes out of DBHEAP so
that needs to be increased by the same amount). I would also go with
NUM_IOCLEANERS of 8 or automatic. 3 is probably too low.

But I agree that for your symptoms, DB2_USE_ALTERNATE_PAGE_CLEANING=ON makes
the biggest difference.

Unless something is set to automatic from a fresh database create using DB2
9.5 (instead of an upgrade of database from a previous release), the
defaults are usually suspect, since many of them have not changed in about
10 years or more.
Jun 27 '08 #2
<dc********@aim.comwrote in message news:fu*********@drn.newsguy.com...
I recreated the database with all default settings and changed only
the DB2_USE_ALTERNATE_PAGE_CLEANING=ON .

I inserted 2 million rows in 2 threads parallely. Only 4 times it
spewed out the error and only those 4 rows failed to insert.

Thanks Mark and Serge.
Ian mentioned in this thread that the bufferpool you created is too large
for the available real memory on your database server, and that is the
source of your problem. The bufferpool BP1 did not get allocated because of
memory limitations and the DB2 hidden (very small) 8K bufferpool was used
instead. This is the real source of your problem (although the other
recommendations will help speed things up).

If you do the following, it will probably fix your problem permanently:

db2 alter bufferpool bp1 size 30000;

Then (just to be safe):

db2stop
db2start
Jun 27 '08 #3
On Apr 22, 7:00 pm, "Mark A" <nob...@nowhere.comwrote:
<dcrunch...@aim.comwrote in messagenews:fu*********@drn.newsguy.com...
I recreated the database with all default settings and changed only
the DB2_USE_ALTERNATE_PAGE_CLEANING=ON .
I inserted 2 million rows in 2 threads parallely. Only 4 times it
spewed out the error and only those 4 rows failed to insert.
Thanks Mark and Serge.

Ian mentioned in this thread that the bufferpool you created is too large
for the available real memory on your database server, and that is the
source of your problem. The bufferpool BP1 did not get allocated because of
memory limitations and the DB2 hidden (very small) 8K bufferpool was used
instead. This is the real source of your problem (although the other
recommendations will help speed things up).

If you do the following, it will probably fix your problem permanently:

db2 alter bufferpool bp1 size 30000;

Then (just to be safe):

db2stop
db2start
Another option, of course, would be to enable self tuning memory for
your system.
Not sure if this is something that you've considered. To do that,
issue the following:

db2 connect to test
db2 update db cfg using SELF_TUNING_MEM ON DATABASE_MEMORY AUTOMATIC
db2 alter bufferpool bp1 size AUTOMATIC

Once this is done, you should no longer see any use of the hidden
buffer pools.

Thanks,
Adam

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul | last post by:
Hi, is there any way to know the content of the bufferpool : - space usage not present in snapshot - tables actually cached in and number of pages, same for index ... thx
1
by: Christian Berg | last post by:
Hi, I have got a problem with resizing the bufferpool of a DB2 v.8.2 instance. The DB2 runs on an AIX 5.x platform. Problem is that an "ALTER BUFFERPOOL ..." command is not persistent if...
5
by: Hemant Shah | last post by:
Folks, I am not sure what I am doing wrong, but We have an transaction that does some serious calculation on small chink of data over and over again. It selects few rows from the table...
20
by: Hemant Shah | last post by:
Folks, I am using DB2 UDB 8.2 on AIX 5.1. How large of a bufferpool can you create? I tried to create a 4GB bufferpool db2 complained that is cannot allocate enogth memory. I have 16GB on this...
3
by: dotyet | last post by:
Hi Everyone, I am in a very strange situation, and am looking for suggestions to tackle it. I have a 10 gig database on 64-bit windows 2003 running platform. The database has about 5 gigs of...
1
by: Raja Shekar | last post by:
HI Every body , I would like to know whether is it mandatory to give Tablespace page size and Bufferpool page size equal..? i also heard like while creating tablespace if pages size of tablespace...
0
by: Ian | last post by:
dcruncher4@aim.com wrote: The issue here is that you're hitting bufferpool 4097. This is the "hidden" 8k bufferpools that will be used if your system does not have enough memory to support...
3
by: Amber | last post by:
We are using 8.2.9 Windows 64 edtion, in one of our projects we need to recreate a few lager tables which have many millions of rows each, we have used concurrent Java threads to read from data...
3
by: dunleav1 | last post by:
In 9.1 and 9.5 (Linux 64 bit) when a buffer pool is set to self- tuning, how are blocks configured in respect to blocked vs non-blocked when self-tuning is set to on? (ie) I have one bufferpool...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.