天天看点

db_stat查看cache size大小

电子书《BerkeleyDB-Core-Cxx-GSG.pdf》,在chapter6描述如何查看bdb的cache size。

使用Berkeley DB 4.5.20安装包中db_stat工具查看。

具体操作如下:

\Oracle\Berkeley DB 4.5.20\bin\db_stat.exe -m -h (bdb环境home目录),也就是如下代码片段中的envHome

DbEnv myEnv(0);
	int nRet = 0;
	try
	{
		nRet = myEnv.open(envHome.c_str(), env_flags, 0);
	}
           

输出结果如下:

259KB 260B      Total cache size

1       Number of caches

264KB   Pool individual cache size

0       Maximum memory-mapped file size

0       Maximum open file descriptors

0       Maximum sequential buffer writes

0       Sleep after writing maximum sequential buffers

0       Requested pages mapped into the process' address space

0       Requested pages found in the cache (0%)

1       Requested pages not found in the cache

0       Pages created in the cache

1       Pages read into the cache

0       Pages written from the cache to the backing file

0       Clean pages forced from the cache

0       Dirty pages forced from the cache

0       Dirty pages written by trickle-sync thread

1       Current total page count

1       Current clean page count

0       Current dirty page count

37      Number of hash buckets used for page location

2       Total number of times hash chains searched for a page

0       The longest hash chain searched for a page

0       Total number of hash chain entries checked for page

0       The number of hash bucket locks that required waiting (0%)

0       The maximum number of times any hash bucket lock was waited for (0%)

0       The number of region locks that required waiting (0%)

0       The number of buffers frozen

0       The number of buffers thawed

0       The number of frozen buffers freed

5       The number of page allocations

0       The number of hash buckets examined during allocations

0       The maximum number of hash buckets examined for an allocation

0       The number of pages examined during allocations

0       The max number of pages examined for an allocation

0       Threads waited on page I/O

Pool File: mydb.db

8192    Page size

0       Requested pages mapped into the process' address space

0       Requested pages found in the cache (0%)

1       Requested pages not found in the cache

0       Pages created in the cache

1       Pages read into the cache

0       Pages written from the cache to the backing file

Press any key to continue