mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
6fba6f7ddd
Reading files using mmap() does not have any significant benefits over plain read() [1]. [1]: https://gist.github.com/azat/3d6c8d82bdd91e7a38d997fd6bcfd574 And not only it does not have significant benefits, it also has some issues, due to max_server_memory_usage (default to 90% of available RAM), since when you read files with mmap() eventually process RSS may exceed max_server_memory_usage, and in this case any allocation will fail (with "Memory limit exceeded (total)") error (yes kernel will unload pages, but likely it will happens after queries will starting to fail), like in this test [2]. [2]: https://gist.github.com/azat/4813489828162e6c2ce131963c6a1acb TL;DR; Note that there was also an idea to take those mmap()'ed regions in memory tracking (#23211), but there are some drawbacks (since accounting mmap() is tricky, first of all you need to account only once per inode for file and plus kernel can unload some pages and those memory will not be used by the server anymore). And as an adddition to #23211 there was #23212, that adds max_bytes_to_use_mmap_io, but since mmap is not a subject for memory accounting there is no need in it. |
||
---|---|---|
.. | ||
config.d | ||
users.d | ||
client_config.xml |