Zoltán Borók-Nagy created IMPALA-15837:
------------------------------------------

             Summary: impalad aborts when the buffer pool exceeds 
vm.max_map_count on large-memory hosts
                 Key: IMPALA-15837
                 URL: https://issues.apache.org/jira/browse/IMPALA-15837
             Project: IMPALA
          Issue Type: Bug
          Components: Backend
            Reporter: Zoltán Borók-Nagy


With --madvise_huge_pages=true (the default) and TCMalloc, 
SystemAllocator::AllocateViaMalloc() calls madvise(MADV_HUGEPAGE) on each 
buffer that is a multiple of 2 MB, and Free() calls madvise(MADV_NOHUGEPAGE). 
Each call on part of a larger TCMalloc mapping splits a kernel VMA, so the 
process gains about one mapping per buffer. Linux caps a process at 
vm.max_map_count mappings, 65530 by default, which about 128 GB of 2 MB buffers 
reaches. Past that every mmap() in the process fails: the embedded JVM could 
not commit memory or start threads ("pthread_create failed (EAGAIN)"), and 
impalad aborted instead of failing the query.

Example on master: 3 executors with 247 GB RAM and mem_limit=160G, TPC-DS 
SF10000 q4 with COMPUTE_PROCESSING_COST=true. All three impalads aborted; the 
JVM error report listed 65,520 mappings, 63,883 of them anonymous rw. With 
vm.max_map_count raised to 1048576 the query passed and peaked at 102,427 
mappings (135 GB RSS). With --madvise_huge_pages=false it peaked at about 5,100 
mappings at 136-140 GB RSS and ran in 414 s, against 441-597 s in four runs 
with the default, so the splits also cost time.

Could the buffer pool avoid per-buffer VMA splits, for example by advising 
whole TCMalloc spans or a dedicated arena once, or by not calling 
MADV_NOHUGEPAGE on free? Until then, impalad could warn at startup when 
vm.max_map_count is low for its mem_limit, and the docs could list the setting 
next to the THP recommendations.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to