diff options
author | Markos Fountoulakis <44345837+mfundul@users.noreply.github.com> | 2020-02-06 21:58:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-06 21:58:13 +0200 |
commit | 6b119d9170fce726e9a5720edc83f6d9ac88e7ce (patch) | |
tree | 90dc7094ba92af299f5e7c0532e519f706b47d92 /database/engine/rrdengine.h | |
parent | b2b3c182548fe81e6d1c9a599b2571dabfdabcaa (diff) |
Drop dirty dbengine pages if disk cannot keep up (#7777)
* Introduce dirty page pressure handling in the dbengine page cache that invalidates pages when the disk cannot keep up with the flushing speed.
Diffstat (limited to 'database/engine/rrdengine.h')
-rw-r--r-- | database/engine/rrdengine.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/database/engine/rrdengine.h b/database/engine/rrdengine.h index 67f1b41c3d..22c3d33bef 100644 --- a/database/engine/rrdengine.h +++ b/database/engine/rrdengine.h @@ -49,6 +49,7 @@ enum rrdeng_opcode { RRDENG_COMMIT_PAGE, RRDENG_FLUSH_PAGES, RRDENG_SHUTDOWN, + RRDENG_INVALIDATE_OLDEST_MEMORY_PAGE, RRDENG_MAX_OPCODE }; @@ -102,7 +103,16 @@ struct rrdengine_worker_config { uv_thread_t thread; uv_loop_t* loop; uv_async_t async; - uv_work_t now_deleting; + + /* file deletion thread */ + uv_thread_t *now_deleting_files; + unsigned long cleanup_thread_deleting_files; /* set to 0 when now_deleting_files is still running */ + + /* dirty page deletion thread */ + uv_thread_t *now_invalidating_dirty_pages; + /* set to 0 when now_invalidating_dirty_pages is still running */ + unsigned long cleanup_thread_invalidating_dirty_pages; + unsigned inflight_dirty_pages; /* FIFO command queue */ uv_mutex_t cmd_mutex; @@ -145,7 +155,8 @@ struct rrdengine_statistics { rrdeng_stats_t page_cache_descriptors; rrdeng_stats_t io_errors; rrdeng_stats_t fs_errors; - rrdeng_stats_t flushing_errors; + rrdeng_stats_t pg_cache_over_half_dirty_events; + rrdeng_stats_t flushing_pressure_page_deletions; }; /* I/O errors global counter */ @@ -154,13 +165,15 @@ extern rrdeng_stats_t global_io_errors; extern rrdeng_stats_t global_fs_errors; /* number of File-Descriptors that have been reserved by dbengine */ extern rrdeng_stats_t rrdeng_reserved_file_descriptors; -/* inability to flush global counter */ -extern rrdeng_stats_t global_flushing_errors; +/* inability to flush global counters */ +extern rrdeng_stats_t global_pg_cache_over_half_dirty_events; +extern rrdeng_stats_t global_flushing_pressure_page_deletions; /* number of deleted pages */ struct rrdengine_instance { struct rrdengine_worker_config worker_config; struct completion rrdengine_completion; struct page_cache pg_cache; + uint8_t drop_metrics_under_page_cache_pressure; /* boolean */ uint8_t global_compress_alg; struct transaction_commit_log commit_log; struct rrdengine_datafile_list datafiles; |