loki查询超时配置优化

loki查询超时优化

问题

#使用grafana查询loki显示超时

在这里插入图片描述

配置

#新配置
	auth_enabled: false
    ingester:
      chunk_idle_period: 3m      # 如果块没有达到最大的块大小,那么在刷新之前,块应该在内存中不更新多长时间
      chunk_block_size: 262144
      chunk_retain_period: 1m      # 块刷新后应该在内存中保留多长时间
      max_transfer_retries: 0      # Number of times to try and transfer chunks when leaving before falling back to flushing to the store. Zero = no transfers are done.
      lifecycler:       #配置ingester的生命周期,以及在哪里注册以进行发现
        ring:
          kvstore:
            store: inmemory      # 用于ring的后端存储,支持consul、etcd、inmemory
          replication_factor: 1      # 写入和读取的ingesters数量,至少为1(为了冗余和弹性,默认情况下为3)
    limits_config:
      enforce_metric_name: false
      reject_old_samples: true      # 旧样品是否会被拒绝
      reject_old_samples_max_age: 168h      # 拒绝旧样本的最大时限
      ingestion_rate_mb: 1024
      ingestion_burst_size_mb: 2048
      max_query_parallelism: 64
      max_streams_per_user: 500000
      max_concurrent_tail_requests: 20
      retention_period: 15d
    schema_config:      # 配置从特定时间段开始应该使用哪些索引模式
      configs:
      - from: 2020-10-24      # 创建索引的日期。如果这是唯一的schema_config,则使用过去的日期,否则使用希望切换模式时的日期
        store: boltdb-shipper      # 索引使用哪个存储,如:cassandra, bigtable, dynamodb,或boltdb
        object_store: filesystem      # 用于块的存储,如:gcs, s3, inmemory, filesystem, cassandra,如果省略,默认值与store相同
        schema: v11
        index:      # 配置如何更新和存储索引
          prefix: index_      # 所有周期表的前缀
          period: 24h      # 表周期
    server:
      grpc_server_max_recv_msg_size: 20388078
      grpc_server_max_send_msg_size: 20388078
      graceful_shutdown_timeout: 600s # 配置优雅停机的超时时间为60秒。
      http_server_read_timeout: 600s # 配置HTTP服务器读取超时时间为60秒。
      http_server_write_timeout: 600s # 配置HTTP服务器写入超时时间为60秒。
      http_listen_port: 3100
    storage_config:      # 为索引和块配置一个或多个存储
      boltdb_shipper:
        active_index_directory: /data/loki/boltdb-shipper-active
        cache_location: /data/loki/boltdb-shipper-cache
        cache_ttl: 24h         
        shared_store: filesystem
      filesystem:
        directory: /data/loki/chunks
    chunk_store_config:      # 配置如何缓存块,以及在将它们保存到存储之前等待多长时间
      max_look_back_period: 360h      #限制查询数据的时间,默认是禁用的,这个值应该小于或等于table_manager.retention_period中的值
      cache_lookups_older_than: 24h
      chunk_cache_config:
        enable_fifocache: true
        fifocache:
          max_size_bytes: 2048000000
    table_manager:
      retention_deletes_enabled: true      # 日志保留周期开关,用于表保留删除
      retention_period: 168h       # 日志保留周期,保留期必须是索引/块的倍数
    compactor:
      working_directory: /data/loki/boltdb-shipper-compactor
      shared_store: filesystem
####################################
#新加区域
    querier:
      max_concurrent: 25
      query_timeout: 5m		#查询超时时间
      extra_query_delay: 30s
      engine:
        timeout: 5m
        max_look_back_period: 2m
      query_ingesters_within: 3h
    query_range:
      split_queries_by_interval: 5m
      max_retries: 5
      cache_results: true
      parallelise_shardable_queries: true
#缓存
      results_cache:
        cache:
          enable_fifocache: true
          fifocache:
            max_size_items: 2048000000
            validity: 48h
####################################

解决

查询超时已解决,不过查询速度比较慢。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值