mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 19:12:03 +00:00
Merge pull request #10444 from ClickHouse/server-memory-profiler
Simple server wide memory profiler
This commit is contained in:
commit
fd27ce619b
@ -617,9 +617,19 @@ int Server::main(const std::vector<std::string> & /*args*/)
|
|||||||
/// Look at compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
|
/// Look at compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
|
||||||
///
|
///
|
||||||
#if USE_UNWIND && !WITH_COVERAGE && !defined(SANITIZER)
|
#if USE_UNWIND && !WITH_COVERAGE && !defined(SANITIZER)
|
||||||
/// QueryProfiler cannot work reliably with any other libunwind or without PHDR cache.
|
/// Profilers cannot work reliably with any other libunwind or without PHDR cache.
|
||||||
if (hasPHDRCache())
|
if (hasPHDRCache())
|
||||||
|
{
|
||||||
global_context->initializeTraceCollector();
|
global_context->initializeTraceCollector();
|
||||||
|
|
||||||
|
/// Set up server-wide memory profiler (for total memory tracker).
|
||||||
|
UInt64 total_memory_profiler_step = config().getUInt64("total_memory_profiler_step", 0);
|
||||||
|
if (total_memory_profiler_step)
|
||||||
|
{
|
||||||
|
total_memory_tracker.setOrRaiseProfilerLimit(total_memory_profiler_step);
|
||||||
|
total_memory_tracker.setProfilerStep(total_memory_profiler_step);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Describe multiple reasons when query profiler cannot work.
|
/// Describe multiple reasons when query profiler cannot work.
|
||||||
|
@ -107,6 +107,12 @@
|
|||||||
-->
|
-->
|
||||||
<max_server_memory_usage_to_ram_ratio>0.9</max_server_memory_usage_to_ram_ratio>
|
<max_server_memory_usage_to_ram_ratio>0.9</max_server_memory_usage_to_ram_ratio>
|
||||||
|
|
||||||
|
<!-- Simple server-wide memory profiler. Collect a stack trace at every peak allocation step (in bytes).
|
||||||
|
Data will be stored in system.trace_log table with query_id = empty string.
|
||||||
|
Zero means disabled. Minimal effective value is 4 MiB.
|
||||||
|
-->
|
||||||
|
<total_memory_profiler_step>4194304</total_memory_profiler_step>
|
||||||
|
|
||||||
<!-- Set limit on number of open files (default: maximum). This setting makes sense on Mac OS X because getrlimit() fails to retrieve
|
<!-- Set limit on number of open files (default: maximum). This setting makes sense on Mac OS X because getrlimit() fails to retrieve
|
||||||
correct maximum value. -->
|
correct maximum value. -->
|
||||||
<!-- <max_open_files>262144</max_open_files> -->
|
<!-- <max_open_files>262144</max_open_files> -->
|
||||||
|
Loading…
Reference in New Issue
Block a user