[MDEV-11378] AliSQL: [Perf] Issue#23 MERGE INNODB AIO REQUEST Created: 2016-11-29 Updated: 2023-12-22 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | 11.5 |
| Type: | Task | Priority: | Major |
| Reporter: | Sergey Vojtovich | Assignee: | Marko Mäkelä |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | linux, performance | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Epic Link: | AliSQL patches | ||||||||||||||||||||||||
| Description |
|
https://github.com/alibaba/AliSQL/commit/4c9d1c72b9db5f7d2267906e0fa6d66948f5dc6c |
| Comments |
| Comment by Marko Mäkelä [ 2017-11-17 ] |
|
I think that wlad should review this for Windows and work with someone to evaluate the possible performance benefit on Linux. |
| Comment by Marko Mäkelä [ 2019-04-30 ] |
|
Sorry for letting this slip. The change does not apply cleanly to MariaDB 10.2 or later. I will port it, so that we can evaluate it. |
| Comment by Marko Mäkelä [ 2020-12-20 ] |
|
There has not been any progress on this yet, other than that It might make sense to always use buf_dblwr.add_to_batch() even when the doublewrite buffer is disabled, to have buf_flush_page() first fill a scatter-gather buffer, which would then be optimized (by combining adjacent writes) in buf_dblwr_t::flush_buffered_writes(). If the doublewrite buffer is disabled, the function would directly submit the final page write requests. |
| Comment by Marko Mäkelä [ 2021-02-26 ] |
|
As far as I can tell, this is only combining background read-ahead requests. Outside read-ahead, all reads are synchronous, and only page writes are asynchronous. I would like to see a benchmark that demonstrates the need for this. In Also, |
| Comment by Marko Mäkelä [ 2021-09-15 ] |
|
I wonder whether combining requests would make any sense at all with modern storage devices, which should have deep work queues and could combine requests at the low level by themselves. I do not know it, but I could believe that even on HDD a native command queue could implement the ‘elevator algorithm’ for optimizing the head movements. One reason against combining read requests would seem to be that if we completed the reads of multiple pages at once, then we would be validating page checksums within only one execution thread. If we received read completion callbacks for each individual page, then multiple checksums could be calculated in parallel and we could utilize the I/O capacity better. It still was nowhere near the maximum capacity of a fast NVMe when I tested |
| Comment by Michael Widenius [ 2021-09-15 ] |
|
Modern storage devices does bigger internal reads, but only 'around' the requested page, not forward from the current page. Another thing is that doing one kernel request instead of 64, is still much better! |
| Comment by Marko Mäkelä [ 2023-04-18 ] |
|
I agree that it could make sense to merge read I/O requests at least when initializing the buffer pool according to the ib_buffer_pool file. Each read request could comprise multiple adjacent pages (say, 64 pages or 1 megabyte per request). Multi-threaded processing would still be possible. |
| Comment by Vladislav Vaintroub [ 2023-05-29 ] |
|
I guess this all needs some experimentation to prove whether increased complexity here is justified. I'm not entirely convinced that submitting and processing 64x16K asynchronous IO requests in sorted order would be much slower than submitting 1x1MB request, and then processing 64x16k pages be it on NVME, SSD or harddisk . |
| Comment by Marko Mäkelä [ 2023-08-11 ] |
|
Recent experience in When it comes to page writes in buf_flush_page_cleaner(), possibly we could check if buf_dblwr_t::flush_buffered_writes_completed() could submit a single scatter-gather write request when a write of up to 128 pages has completed. Similarly, when the doublewrite buffer is disabled or not needed ( |