diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2016-06-23 17:29:40 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2016-06-23 17:36:28 +1000 |
commit | a63e21b838548b9ee8c66136c1c53f922f06c8ac (patch) | |
tree | 7852f40abe8296a4febbe6f4e9a80941dd21b838 | |
parent | 30e49acc9036721491e78af9d0c13d5816aea7ca (diff) | |
download | mongo-a63e21b838548b9ee8c66136c1c53f922f06c8ac.tar.gz |
SERVER-24580 Add more eviction stats to track efficiency. (#2830)
(cherry picked from commit 1f4aaa4490a82cf947afdabbb9214ee5b1850d13)
-rw-r--r-- | dist/s_string.ok | 1 | ||||
-rw-r--r-- | dist/stat_data.py | 6 | ||||
-rw-r--r-- | src/conn/conn_cache.c | 8 | ||||
-rw-r--r-- | src/evict/evict_lru.c | 33 | ||||
-rw-r--r-- | src/include/stat.h | 6 | ||||
-rw-r--r-- | src/include/wiredtiger.in | 262 | ||||
-rw-r--r-- | src/support/stat.c | 24 | ||||
-rw-r--r-- | tools/wtstats/stat_data.py | 2 |
8 files changed, 208 insertions, 134 deletions
diff --git a/dist/s_string.ok b/dist/s_string.ok index 06173fe978c..631f2a5c909 100644 --- a/dist/s_string.ok +++ b/dist/s_string.ok @@ -1068,6 +1068,7 @@ unescaped unicode uninstantiated unistd +unlink unlinked unmap unmarshall diff --git a/dist/stat_data.py b/dist/stat_data.py index bd951e64999..790cf043357 100644 --- a/dist/stat_data.py +++ b/dist/stat_data.py @@ -162,6 +162,7 @@ connection_stats = [ CacheStat('cache_bytes_write', 'bytes written from cache', 'size'), CacheStat('cache_eviction_aggressive_set', 'eviction currently operating in aggressive mode', 'no_clear,no_scale'), CacheStat('cache_eviction_app', 'pages evicted by application threads'), + CacheStat('cache_eviction_app_dirty', 'modified pages evicted by application threads'), CacheStat('cache_eviction_checkpoint', 'checkpoint blocked page eviction'), CacheStat('cache_eviction_clean', 'unmodified pages evicted'), CacheStat('cache_eviction_deepen', 'page split during eviction deepened the tree'), @@ -173,6 +174,9 @@ connection_stats = [ CacheStat('cache_eviction_hazard', 'hazard pointer blocked page eviction'), CacheStat('cache_eviction_internal', 'internal pages evicted'), CacheStat('cache_eviction_maximum_page_size', 'maximum page size at eviction', 'no_clear,no_scale,size'), + CacheStat('cache_eviction_pages_queued', 'pages queued for eviction'), + CacheStat('cache_eviction_pages_queued_oldest', 'pages queued for urgent eviction'), + CacheStat('cache_eviction_pages_seen', 'pages seen by eviction walk'), CacheStat('cache_eviction_queue_empty', 'eviction server candidate queue empty when topping up'), CacheStat('cache_eviction_queue_not_empty', 'eviction server candidate queue not empty when topping up'), CacheStat('cache_eviction_server_evicting', 'eviction server evicting pages'), @@ -181,6 +185,8 @@ connection_stats = [ CacheStat('cache_eviction_split_internal', 'internal pages split during eviction'), CacheStat('cache_eviction_split_leaf', 'leaf pages split during eviction'), CacheStat('cache_eviction_walk', 'pages walked for eviction'), + CacheStat('cache_eviction_walks_active', 'files with active eviction walks', 'no_clear,no_scale,size'), + CacheStat('cache_eviction_walks_started', 'files with new eviction walks started'), CacheStat('cache_eviction_worker_evicting', 'eviction worker thread evicting pages'), CacheStat('cache_inmem_split', 'in-memory page splits'), CacheStat('cache_inmem_splittable', 'in-memory page passed criteria to be split'), diff --git a/src/conn/conn_cache.c b/src/conn/conn_cache.c index 9a2c394e9a6..9dfd1cdcbfa 100644 --- a/src/conn/conn_cache.c +++ b/src/conn/conn_cache.c @@ -217,6 +217,14 @@ __wt_cache_stats_update(WT_SESSION_IMPL *session) WT_STAT_SET( session, stats, cache_bytes_overflow, cache->bytes_overflow); WT_STAT_SET(session, stats, cache_bytes_leaf, leaf); + + /* + * The number of files with active walks ~= number of hazard pointers + * in the walk session. Note: reading without locking. + */ + if (conn->evict_session != NULL) + WT_STAT_SET(session, stats, cache_eviction_walks_active, + conn->evict_session->nhazard); } /* diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c index a2bf1d77dd0..0fd3c069eb0 100644 --- a/src/evict/evict_lru.c +++ b/src/evict/evict_lru.c @@ -1270,7 +1270,7 @@ __evict_walk_file(WT_SESSION_IMPL *session, u_int *slotp) WT_PAGE *page; WT_PAGE_MODIFY *mod; WT_REF *ref; - uint64_t pages_walked; + uint64_t pages_seen, refs_walked; uint32_t walk_flags; int internal_pages, restarts; bool enough, modified; @@ -1304,17 +1304,21 @@ __evict_walk_file(WT_SESSION_IMPL *session, u_int *slotp) * Once we hit the page limit, do one more step through the walk in * case we are appending and only the last page in the file is live. */ - for (evict = start, pages_walked = 0; + for (evict = start, pages_seen = refs_walked = 0; evict < end && !enough && (ret == 0 || ret == WT_NOTFOUND); ret = __wt_tree_walk_count( - session, &btree->evict_ref, &pages_walked, walk_flags)) { - enough = pages_walked > cache->evict_max_refs_per_file; + session, &btree->evict_ref, &refs_walked, walk_flags)) { + enough = refs_walked > cache->evict_max_refs_per_file; if ((ref = btree->evict_ref) == NULL) { if (++restarts == 2 || enough) break; + WT_STAT_FAST_CONN_INCR( + session, cache_eviction_walks_started); continue; } + ++pages_seen; + /* Ignore root pages entirely. */ if (__wt_ref_is_root(ref)) continue; @@ -1342,9 +1346,13 @@ __evict_walk_file(WT_SESSION_IMPL *session, u_int *slotp) } /* Pages we no longer need (clean or dirty), are found money. */ + if (page->read_gen == WT_READGEN_OLDEST) { + WT_STAT_FAST_CONN_INCR( + session, cache_eviction_pages_queued_oldest); + goto fast; + } if (__wt_page_is_empty(page) || - F_ISSET(session->dhandle, WT_DHANDLE_DEAD) || - page->read_gen == WT_READGEN_OLDEST) + F_ISSET(session->dhandle, WT_DHANDLE_DEAD)) goto fast; /* Skip clean pages if appropriate. */ @@ -1410,6 +1418,8 @@ fast: /* If the page can't be evicted, give up. */ WT_RET_NOTFOUND_OK(ret); *slotp += (u_int)(evict - start); + WT_STAT_FAST_CONN_INCRV( + session, cache_eviction_pages_queued, (u_int)(evict - start)); /* * If we happen to end up on the root page, clear it. We have to track @@ -1428,10 +1438,11 @@ fast: /* If the page can't be evicted, give up. */ else if (ref->page->read_gen == WT_READGEN_OLDEST) WT_RET_NOTFOUND_OK(__wt_tree_walk_count( session, &btree->evict_ref, - &pages_walked, walk_flags)); + &refs_walked, walk_flags)); } - WT_STAT_FAST_CONN_INCRV(session, cache_eviction_walk, pages_walked); + WT_STAT_FAST_CONN_INCRV(session, cache_eviction_walk, refs_walked); + WT_STAT_FAST_CONN_INCRV(session, cache_eviction_pages_seen, pages_seen); return (0); } @@ -1547,8 +1558,12 @@ __evict_page(WT_SESSION_IMPL *session, bool is_server) else WT_STAT_FAST_CONN_INCR( session, cache_eviction_worker_evicting); - } else + } else { + if (__wt_page_is_modified(ref->page)) + WT_STAT_FAST_CONN_INCR( + session, cache_eviction_app_dirty); WT_STAT_FAST_CONN_INCR(session, cache_eviction_app); + } /* * In case something goes wrong, don't pick the same set of pages every diff --git a/src/include/stat.h b/src/include/stat.h index f9170dc1a79..a72da020766 100644 --- a/src/include/stat.h +++ b/src/include/stat.h @@ -269,6 +269,8 @@ struct __wt_connection_stats { int64_t cache_eviction_slow; int64_t cache_eviction_worker_evicting; int64_t cache_eviction_force_fail; + int64_t cache_eviction_walks_active; + int64_t cache_eviction_walks_started; int64_t cache_eviction_hazard; int64_t cache_inmem_splittable; int64_t cache_inmem_split; @@ -280,14 +282,18 @@ struct __wt_connection_stats { int64_t cache_bytes_max; int64_t cache_eviction_maximum_page_size; int64_t cache_eviction_dirty; + int64_t cache_eviction_app_dirty; int64_t cache_eviction_deepen; int64_t cache_write_lookaside; int64_t cache_pages_inuse; int64_t cache_eviction_force; int64_t cache_eviction_force_delete; int64_t cache_eviction_app; + int64_t cache_eviction_pages_queued; + int64_t cache_eviction_pages_queued_oldest; int64_t cache_read; int64_t cache_read_lookaside; + int64_t cache_eviction_pages_seen; int64_t cache_eviction_fail; int64_t cache_eviction_walk; int64_t cache_write; diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index 5c2efad77e0..60f725b3d3d 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -3787,257 +3787,269 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection); #define WT_STAT_CONN_CACHE_EVICTION_WORKER_EVICTING 1040 /*! cache: failed eviction of pages that exceeded the in-memory maximum */ #define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 1041 +/*! cache: files with active eviction walks */ +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ACTIVE 1042 +/*! cache: files with new eviction walks started */ +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_STARTED 1043 /*! cache: hazard pointer blocked page eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1042 +#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1044 /*! cache: in-memory page passed criteria to be split */ -#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1043 +#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1045 /*! cache: in-memory page splits */ -#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1044 +#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1046 /*! cache: internal pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1045 +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1047 /*! cache: internal pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1046 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1048 /*! cache: leaf pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1047 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1049 /*! cache: lookaside table insert calls */ -#define WT_STAT_CONN_CACHE_LOOKASIDE_INSERT 1048 +#define WT_STAT_CONN_CACHE_LOOKASIDE_INSERT 1050 /*! cache: lookaside table remove calls */ -#define WT_STAT_CONN_CACHE_LOOKASIDE_REMOVE 1049 +#define WT_STAT_CONN_CACHE_LOOKASIDE_REMOVE 1051 /*! cache: maximum bytes configured */ -#define WT_STAT_CONN_CACHE_BYTES_MAX 1050 +#define WT_STAT_CONN_CACHE_BYTES_MAX 1052 /*! cache: maximum page size at eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1051 +#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1053 /*! cache: modified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1052 +#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1054 +/*! cache: modified pages evicted by application threads */ +#define WT_STAT_CONN_CACHE_EVICTION_APP_DIRTY 1055 /*! cache: page split during eviction deepened the tree */ -#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1053 +#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1056 /*! cache: page written requiring lookaside records */ -#define WT_STAT_CONN_CACHE_WRITE_LOOKASIDE 1054 +#define WT_STAT_CONN_CACHE_WRITE_LOOKASIDE 1057 /*! cache: pages currently held in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_INUSE 1055 +#define WT_STAT_CONN_CACHE_PAGES_INUSE 1058 /*! cache: pages evicted because they exceeded the in-memory maximum */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1056 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1059 /*! cache: pages evicted because they had chains of deleted items */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1057 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1060 /*! cache: pages evicted by application threads */ -#define WT_STAT_CONN_CACHE_EVICTION_APP 1058 +#define WT_STAT_CONN_CACHE_EVICTION_APP 1061 +/*! cache: pages queued for eviction */ +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED 1062 +/*! cache: pages queued for urgent eviction */ +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_OLDEST 1063 /*! cache: pages read into cache */ -#define WT_STAT_CONN_CACHE_READ 1059 +#define WT_STAT_CONN_CACHE_READ 1064 /*! cache: pages read into cache requiring lookaside entries */ -#define WT_STAT_CONN_CACHE_READ_LOOKASIDE 1060 +#define WT_STAT_CONN_CACHE_READ_LOOKASIDE 1065 +/*! cache: pages seen by eviction walk */ +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_SEEN 1066 /*! cache: pages selected for eviction unable to be evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1061 +#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1067 /*! cache: pages walked for eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_WALK 1062 +#define WT_STAT_CONN_CACHE_EVICTION_WALK 1068 /*! cache: pages written from cache */ -#define WT_STAT_CONN_CACHE_WRITE 1063 +#define WT_STAT_CONN_CACHE_WRITE 1069 /*! cache: pages written requiring in-memory restoration */ -#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1064 +#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1070 /*! cache: percentage overhead */ -#define WT_STAT_CONN_CACHE_OVERHEAD 1065 +#define WT_STAT_CONN_CACHE_OVERHEAD 1071 /*! cache: tracked bytes belonging to internal pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1066 +#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1072 /*! cache: tracked bytes belonging to leaf pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_LEAF 1067 +#define WT_STAT_CONN_CACHE_BYTES_LEAF 1073 /*! cache: tracked bytes belonging to overflow pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_OVERFLOW 1068 +#define WT_STAT_CONN_CACHE_BYTES_OVERFLOW 1074 /*! cache: tracked dirty bytes in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1069 +#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1075 /*! cache: tracked dirty pages in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1070 +#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1076 /*! cache: unmodified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1071 +#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1077 /*! connection: auto adjusting condition resets */ -#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1072 +#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1078 /*! connection: auto adjusting condition wait calls */ -#define WT_STAT_CONN_COND_AUTO_WAIT 1073 +#define WT_STAT_CONN_COND_AUTO_WAIT 1079 /*! connection: files currently open */ -#define WT_STAT_CONN_FILE_OPEN 1074 +#define WT_STAT_CONN_FILE_OPEN 1080 /*! connection: memory allocations */ -#define WT_STAT_CONN_MEMORY_ALLOCATION 1075 +#define WT_STAT_CONN_MEMORY_ALLOCATION 1081 /*! connection: memory frees */ -#define WT_STAT_CONN_MEMORY_FREE 1076 +#define WT_STAT_CONN_MEMORY_FREE 1082 /*! connection: memory re-allocations */ -#define WT_STAT_CONN_MEMORY_GROW 1077 +#define WT_STAT_CONN_MEMORY_GROW 1083 /*! connection: pthread mutex condition wait calls */ -#define WT_STAT_CONN_COND_WAIT 1078 +#define WT_STAT_CONN_COND_WAIT 1084 /*! connection: pthread mutex shared lock read-lock calls */ -#define WT_STAT_CONN_RWLOCK_READ 1079 +#define WT_STAT_CONN_RWLOCK_READ 1085 /*! connection: pthread mutex shared lock write-lock calls */ -#define WT_STAT_CONN_RWLOCK_WRITE 1080 +#define WT_STAT_CONN_RWLOCK_WRITE 1086 /*! connection: total read I/Os */ -#define WT_STAT_CONN_READ_IO 1081 +#define WT_STAT_CONN_READ_IO 1087 /*! connection: total write I/Os */ -#define WT_STAT_CONN_WRITE_IO 1082 +#define WT_STAT_CONN_WRITE_IO 1088 /*! cursor: cursor create calls */ -#define WT_STAT_CONN_CURSOR_CREATE 1083 +#define WT_STAT_CONN_CURSOR_CREATE 1089 /*! cursor: cursor insert calls */ -#define WT_STAT_CONN_CURSOR_INSERT 1084 +#define WT_STAT_CONN_CURSOR_INSERT 1090 /*! cursor: cursor next calls */ -#define WT_STAT_CONN_CURSOR_NEXT 1085 +#define WT_STAT_CONN_CURSOR_NEXT 1091 /*! cursor: cursor prev calls */ -#define WT_STAT_CONN_CURSOR_PREV 1086 +#define WT_STAT_CONN_CURSOR_PREV 1092 /*! cursor: cursor remove calls */ -#define WT_STAT_CONN_CURSOR_REMOVE 1087 +#define WT_STAT_CONN_CURSOR_REMOVE 1093 /*! cursor: cursor reset calls */ -#define WT_STAT_CONN_CURSOR_RESET 1088 +#define WT_STAT_CONN_CURSOR_RESET 1094 /*! cursor: cursor restarted searches */ -#define WT_STAT_CONN_CURSOR_RESTART 1089 +#define WT_STAT_CONN_CURSOR_RESTART 1095 /*! cursor: cursor search calls */ -#define WT_STAT_CONN_CURSOR_SEARCH 1090 +#define WT_STAT_CONN_CURSOR_SEARCH 1096 /*! cursor: cursor search near calls */ -#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1091 +#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1097 /*! cursor: cursor update calls */ -#define WT_STAT_CONN_CURSOR_UPDATE 1092 +#define WT_STAT_CONN_CURSOR_UPDATE 1098 /*! cursor: truncate calls */ -#define WT_STAT_CONN_CURSOR_TRUNCATE 1093 +#define WT_STAT_CONN_CURSOR_TRUNCATE 1099 /*! data-handle: connection data handles currently active */ -#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1094 +#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1100 /*! data-handle: connection sweep candidate became referenced */ -#define WT_STAT_CONN_DH_SWEEP_REF 1095 +#define WT_STAT_CONN_DH_SWEEP_REF 1101 /*! data-handle: connection sweep dhandles closed */ -#define WT_STAT_CONN_DH_SWEEP_CLOSE 1096 +#define WT_STAT_CONN_DH_SWEEP_CLOSE 1102 /*! data-handle: connection sweep dhandles removed from hash list */ -#define WT_STAT_CONN_DH_SWEEP_REMOVE 1097 +#define WT_STAT_CONN_DH_SWEEP_REMOVE 1103 /*! data-handle: connection sweep time-of-death sets */ -#define WT_STAT_CONN_DH_SWEEP_TOD 1098 +#define WT_STAT_CONN_DH_SWEEP_TOD 1104 /*! data-handle: connection sweeps */ -#define WT_STAT_CONN_DH_SWEEPS 1099 +#define WT_STAT_CONN_DH_SWEEPS 1105 /*! data-handle: session dhandles swept */ -#define WT_STAT_CONN_DH_SESSION_HANDLES 1100 +#define WT_STAT_CONN_DH_SESSION_HANDLES 1106 /*! data-handle: session sweep attempts */ -#define WT_STAT_CONN_DH_SESSION_SWEEPS 1101 +#define WT_STAT_CONN_DH_SESSION_SWEEPS 1107 /*! log: busy returns attempting to switch slots */ -#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1102 +#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1108 /*! log: consolidated slot closures */ -#define WT_STAT_CONN_LOG_SLOT_CLOSES 1103 +#define WT_STAT_CONN_LOG_SLOT_CLOSES 1109 /*! log: consolidated slot join races */ -#define WT_STAT_CONN_LOG_SLOT_RACES 1104 +#define WT_STAT_CONN_LOG_SLOT_RACES 1110 /*! log: consolidated slot join transitions */ -#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1105 +#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1111 /*! log: consolidated slot joins */ -#define WT_STAT_CONN_LOG_SLOT_JOINS 1106 +#define WT_STAT_CONN_LOG_SLOT_JOINS 1112 /*! log: consolidated slot unbuffered writes */ -#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1107 +#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1113 /*! log: log bytes of payload data */ -#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1108 +#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1114 /*! log: log bytes written */ -#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1109 +#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1115 /*! log: log files manually zero-filled */ -#define WT_STAT_CONN_LOG_ZERO_FILLS 1110 +#define WT_STAT_CONN_LOG_ZERO_FILLS 1116 /*! log: log flush operations */ -#define WT_STAT_CONN_LOG_FLUSH 1111 +#define WT_STAT_CONN_LOG_FLUSH 1117 /*! log: log force write operations */ -#define WT_STAT_CONN_LOG_FORCE_WRITE 1112 +#define WT_STAT_CONN_LOG_FORCE_WRITE 1118 /*! log: log force write operations skipped */ -#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1113 +#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1119 /*! log: log records compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1114 +#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1120 /*! log: log records not compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1115 +#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1121 /*! log: log records too small to compress */ -#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1116 +#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1122 /*! log: log release advances write LSN */ -#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1117 +#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1123 /*! log: log scan operations */ -#define WT_STAT_CONN_LOG_SCANS 1118 +#define WT_STAT_CONN_LOG_SCANS 1124 /*! log: log scan records requiring two reads */ -#define WT_STAT_CONN_LOG_SCAN_REREADS 1119 +#define WT_STAT_CONN_LOG_SCAN_REREADS 1125 /*! log: log server thread advances write LSN */ -#define WT_STAT_CONN_LOG_WRITE_LSN 1120 +#define WT_STAT_CONN_LOG_WRITE_LSN 1126 /*! log: log server thread write LSN walk skipped */ -#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1121 +#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1127 /*! log: log sync operations */ -#define WT_STAT_CONN_LOG_SYNC 1122 +#define WT_STAT_CONN_LOG_SYNC 1128 /*! log: log sync_dir operations */ -#define WT_STAT_CONN_LOG_SYNC_DIR 1123 +#define WT_STAT_CONN_LOG_SYNC_DIR 1129 /*! log: log write operations */ -#define WT_STAT_CONN_LOG_WRITES 1124 +#define WT_STAT_CONN_LOG_WRITES 1130 /*! log: logging bytes consolidated */ -#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1125 +#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1131 /*! log: maximum log file size */ -#define WT_STAT_CONN_LOG_MAX_FILESIZE 1126 +#define WT_STAT_CONN_LOG_MAX_FILESIZE 1132 /*! log: number of pre-allocated log files to create */ -#define WT_STAT_CONN_LOG_PREALLOC_MAX 1127 +#define WT_STAT_CONN_LOG_PREALLOC_MAX 1133 /*! log: pre-allocated log files not ready and missed */ -#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1128 +#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1134 /*! log: pre-allocated log files prepared */ -#define WT_STAT_CONN_LOG_PREALLOC_FILES 1129 +#define WT_STAT_CONN_LOG_PREALLOC_FILES 1135 /*! log: pre-allocated log files used */ -#define WT_STAT_CONN_LOG_PREALLOC_USED 1130 +#define WT_STAT_CONN_LOG_PREALLOC_USED 1136 /*! log: records processed by log scan */ -#define WT_STAT_CONN_LOG_SCAN_RECORDS 1131 +#define WT_STAT_CONN_LOG_SCAN_RECORDS 1137 /*! log: total in-memory size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_MEM 1132 +#define WT_STAT_CONN_LOG_COMPRESS_MEM 1138 /*! log: total log buffer size */ -#define WT_STAT_CONN_LOG_BUFFER_SIZE 1133 +#define WT_STAT_CONN_LOG_BUFFER_SIZE 1139 /*! log: total size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_LEN 1134 +#define WT_STAT_CONN_LOG_COMPRESS_LEN 1140 /*! log: written slots coalesced */ -#define WT_STAT_CONN_LOG_SLOT_COALESCED 1135 +#define WT_STAT_CONN_LOG_SLOT_COALESCED 1141 /*! log: yields waiting for previous log file close */ -#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1136 +#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1142 /*! reconciliation: fast-path pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1137 +#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1143 /*! reconciliation: page reconciliation calls */ -#define WT_STAT_CONN_REC_PAGES 1138 +#define WT_STAT_CONN_REC_PAGES 1144 /*! reconciliation: page reconciliation calls for eviction */ -#define WT_STAT_CONN_REC_PAGES_EVICTION 1139 +#define WT_STAT_CONN_REC_PAGES_EVICTION 1145 /*! reconciliation: pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE 1140 +#define WT_STAT_CONN_REC_PAGE_DELETE 1146 /*! reconciliation: split bytes currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1141 +#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1147 /*! reconciliation: split objects currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1142 +#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1148 /*! session: open cursor count */ -#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1143 +#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1149 /*! session: open session count */ -#define WT_STAT_CONN_SESSION_OPEN 1144 +#define WT_STAT_CONN_SESSION_OPEN 1150 /*! thread-yield: page acquire busy blocked */ -#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1145 +#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1151 /*! thread-yield: page acquire eviction blocked */ -#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1146 +#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1152 /*! thread-yield: page acquire locked blocked */ -#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1147 +#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1153 /*! thread-yield: page acquire read blocked */ -#define WT_STAT_CONN_PAGE_READ_BLOCKED 1148 +#define WT_STAT_CONN_PAGE_READ_BLOCKED 1154 /*! thread-yield: page acquire time sleeping (usecs) */ -#define WT_STAT_CONN_PAGE_SLEEP 1149 +#define WT_STAT_CONN_PAGE_SLEEP 1155 /*! transaction: number of named snapshots created */ -#define WT_STAT_CONN_TXN_SNAPSHOTS_CREATED 1150 +#define WT_STAT_CONN_TXN_SNAPSHOTS_CREATED 1156 /*! transaction: number of named snapshots dropped */ -#define WT_STAT_CONN_TXN_SNAPSHOTS_DROPPED 1151 +#define WT_STAT_CONN_TXN_SNAPSHOTS_DROPPED 1157 /*! transaction: transaction begins */ -#define WT_STAT_CONN_TXN_BEGIN 1152 +#define WT_STAT_CONN_TXN_BEGIN 1158 /*! transaction: transaction checkpoint currently running */ -#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1153 +#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1159 /*! transaction: transaction checkpoint generation */ -#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1154 +#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1160 /*! transaction: transaction checkpoint max time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1155 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1161 /*! transaction: transaction checkpoint min time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1156 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1162 /*! transaction: transaction checkpoint most recent time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1157 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1163 /*! transaction: transaction checkpoint total time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1158 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1164 /*! transaction: transaction checkpoints */ -#define WT_STAT_CONN_TXN_CHECKPOINT 1159 +#define WT_STAT_CONN_TXN_CHECKPOINT 1165 /*! transaction: transaction failures due to cache overflow */ -#define WT_STAT_CONN_TXN_FAIL_CACHE 1160 +#define WT_STAT_CONN_TXN_FAIL_CACHE 1166 /*! transaction: transaction range of IDs currently pinned */ -#define WT_STAT_CONN_TXN_PINNED_RANGE 1161 +#define WT_STAT_CONN_TXN_PINNED_RANGE 1167 /*! transaction: transaction range of IDs currently pinned by a checkpoint */ -#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1162 +#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1168 /*! transaction: transaction range of IDs currently pinned by named * snapshots */ -#define WT_STAT_CONN_TXN_PINNED_SNAPSHOT_RANGE 1163 +#define WT_STAT_CONN_TXN_PINNED_SNAPSHOT_RANGE 1169 /*! transaction: transaction sync calls */ -#define WT_STAT_CONN_TXN_SYNC 1164 +#define WT_STAT_CONN_TXN_SYNC 1170 /*! transaction: transactions committed */ -#define WT_STAT_CONN_TXN_COMMIT 1165 +#define WT_STAT_CONN_TXN_COMMIT 1171 /*! transaction: transactions rolled back */ -#define WT_STAT_CONN_TXN_ROLLBACK 1166 +#define WT_STAT_CONN_TXN_ROLLBACK 1172 /*! * @} diff --git a/src/support/stat.c b/src/support/stat.c index 2a826eda962..d64915f0250 100644 --- a/src/support/stat.c +++ b/src/support/stat.c @@ -551,6 +551,8 @@ static const char * const __stats_connection_desc[] = { "cache: eviction server unable to reach eviction goal", "cache: eviction worker thread evicting pages", "cache: failed eviction of pages that exceeded the in-memory maximum", + "cache: files with active eviction walks", + "cache: files with new eviction walks started", "cache: hazard pointer blocked page eviction", "cache: in-memory page passed criteria to be split", "cache: in-memory page splits", @@ -562,14 +564,18 @@ static const char * const __stats_connection_desc[] = { "cache: maximum bytes configured", "cache: maximum page size at eviction", "cache: modified pages evicted", + "cache: modified pages evicted by application threads", "cache: page split during eviction deepened the tree", "cache: page written requiring lookaside records", "cache: pages currently held in the cache", "cache: pages evicted because they exceeded the in-memory maximum", "cache: pages evicted because they had chains of deleted items", "cache: pages evicted by application threads", + "cache: pages queued for eviction", + "cache: pages queued for urgent eviction", "cache: pages read into cache", "cache: pages read into cache requiring lookaside entries", + "cache: pages seen by eviction walk", "cache: pages selected for eviction unable to be evicted", "cache: pages walked for eviction", "cache: pages written from cache", @@ -748,6 +754,8 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->cache_eviction_slow = 0; stats->cache_eviction_worker_evicting = 0; stats->cache_eviction_force_fail = 0; + /* not clearing cache_eviction_walks_active */ + stats->cache_eviction_walks_started = 0; stats->cache_eviction_hazard = 0; stats->cache_inmem_splittable = 0; stats->cache_inmem_split = 0; @@ -759,14 +767,18 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) /* not clearing cache_bytes_max */ /* not clearing cache_eviction_maximum_page_size */ stats->cache_eviction_dirty = 0; + stats->cache_eviction_app_dirty = 0; stats->cache_eviction_deepen = 0; stats->cache_write_lookaside = 0; /* not clearing cache_pages_inuse */ stats->cache_eviction_force = 0; stats->cache_eviction_force_delete = 0; stats->cache_eviction_app = 0; + stats->cache_eviction_pages_queued = 0; + stats->cache_eviction_pages_queued_oldest = 0; stats->cache_read = 0; stats->cache_read_lookaside = 0; + stats->cache_eviction_pages_seen = 0; stats->cache_eviction_fail = 0; stats->cache_eviction_walk = 0; stats->cache_write = 0; @@ -943,6 +955,10 @@ __wt_stat_connection_aggregate( WT_STAT_READ(from, cache_eviction_worker_evicting); to->cache_eviction_force_fail += WT_STAT_READ(from, cache_eviction_force_fail); + to->cache_eviction_walks_active += + WT_STAT_READ(from, cache_eviction_walks_active); + to->cache_eviction_walks_started += + WT_STAT_READ(from, cache_eviction_walks_started); to->cache_eviction_hazard += WT_STAT_READ(from, cache_eviction_hazard); to->cache_inmem_splittable += @@ -962,6 +978,8 @@ __wt_stat_connection_aggregate( to->cache_eviction_maximum_page_size += WT_STAT_READ(from, cache_eviction_maximum_page_size); to->cache_eviction_dirty += WT_STAT_READ(from, cache_eviction_dirty); + to->cache_eviction_app_dirty += + WT_STAT_READ(from, cache_eviction_app_dirty); to->cache_eviction_deepen += WT_STAT_READ(from, cache_eviction_deepen); to->cache_write_lookaside += @@ -971,8 +989,14 @@ __wt_stat_connection_aggregate( to->cache_eviction_force_delete += WT_STAT_READ(from, cache_eviction_force_delete); to->cache_eviction_app += WT_STAT_READ(from, cache_eviction_app); + to->cache_eviction_pages_queued += + WT_STAT_READ(from, cache_eviction_pages_queued); + to->cache_eviction_pages_queued_oldest += + WT_STAT_READ(from, cache_eviction_pages_queued_oldest); to->cache_read += WT_STAT_READ(from, cache_read); to->cache_read_lookaside += WT_STAT_READ(from, cache_read_lookaside); + to->cache_eviction_pages_seen += + WT_STAT_READ(from, cache_eviction_pages_seen); to->cache_eviction_fail += WT_STAT_READ(from, cache_eviction_fail); to->cache_eviction_walk += WT_STAT_READ(from, cache_eviction_walk); to->cache_write += WT_STAT_READ(from, cache_write); diff --git a/tools/wtstats/stat_data.py b/tools/wtstats/stat_data.py index c75e4f194dd..05401702083 100644 --- a/tools/wtstats/stat_data.py +++ b/tools/wtstats/stat_data.py @@ -5,6 +5,7 @@ no_scale_per_second_list = [ 'async: maximum work queue length', 'cache: bytes currently in the cache', 'cache: eviction currently operating in aggressive mode', + 'cache: files with active eviction walks', 'cache: maximum bytes configured', 'cache: maximum page size at eviction', 'cache: pages currently held in the cache', @@ -71,6 +72,7 @@ no_clear_list = [ 'async: maximum work queue length', 'cache: bytes currently in the cache', 'cache: eviction currently operating in aggressive mode', + 'cache: files with active eviction walks', 'cache: maximum bytes configured', 'cache: maximum page size at eviction', 'cache: pages currently held in the cache', |