• Clickhosue & ck & ch DB::Exception: Memory limit (total) exceeded


    1.异常信息

    <Error> ConfigReloader: void DB::ConfigReloader::run(): Code: 241, e.displayText() = DB::Exception: Memory limi  t (total) exceeded: would use 19.24 GiB (attempt to allocate chunk of 5242880 bytes), maximum: 18.63 GiB, Stack trace (when copying this message, alway  s include the lines below):
    0.  Poco::Exception::Exception(std::1::basic_string<char, std::1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x18e02790 in /usr/b  in/clickhouse
    1.  DB::Exception::Exception(std::1::basic_string<char, std::1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0xe72fdad in /usr/bin/  clickhouse
    2.  ? @ 0xe71dee0 in /usr/bin/clickhouse
    3.  MemoryTracker::alloc(long) @ 0xe71c798 in /usr/bin/clickhouse
    4.  operator new[](unsigned%20long) @ 0xe71af6c in /usr/bin/clickhouse
    5.  Poco::XML::NamePool::NamePool(unsigned long) @ 0x18d84fca in /usr/bin/clickhouse
    

    2.解决

    1.config.xml
    	修改每个节点上的config.xml配置文件里的服务器使用最大RAM量
    		<max_server_memory_usage>xxx</max_server_memory_usage>
    2.users.xml
    	修改每个节点上的users.xml配置文件里的,用于在单个服务器上运行查询的最大RAM量
    		<max_memory_usage>xxx</max_memory_usage>
    

    3.扩展

    1.max_memory_usage
    	含义:用于在单个服务器上运行查询的最大RAM量
    	默认值: 10G
    	内存的使用也受限于这两个参数
    		1)max_memory_usage_for_user
    			用于在单个服务器上运行用户查询的最大RAM量
    			默认值定义在 Settings.h (https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.h)
    			默认值是0, max_memory_usage_for_user = 0 表示不受限
    		2)max_server_memory_usage
            	详见 2
            	
    2.max_server_memory_usage
    	含义:限制ClickHouse服务器节点的总RAM使用量
    	默认值: 0 默认情况下的计算公式如下:
    		max_server_memory_usage = memory_amount(内存总量) * max_server_memory_usage_to_ram_ratio(占比分数值)
    		
    		
    3.max_server_memory_usage_to_ram_ratio
    	含义:定义可用于Clickhouse服务器的总物理RAM量的一部分。如果想要服务器利用更多资源(限制ck应用在内存占用),则会将内存减少到适当的数量
    	默认值:0 表示Clickhouse服务器可以使用所有可用的RAM
    	官方建议:
    		在具有低RAM和交换容量的主机上,可能需要将max_server_memory_usage_to_ram_ratio设置为大于1
    	
    
  • 相关阅读:
    pytorch实现rnn并且对mnist进行分类
    python中的list按照某一列进行排序的方法
    pytorch实现style transfer
    Pytorch基本变量类型FloatTensor与Variable
    Linux上统计文件夹下文件个数以及目录个数
    python调用caffe实现预测
    python调用caffe环境配置
    JS实现唤起手机APP应用,如果本地没有则跳转到下载地址
    PHP开发中使用的工具
    Linux安装redis服务
  • 原文地址:https://www.cnblogs.com/worldline/p/14577316.html
Copyright © 2020-2023  润新知