Coder Social home page Coder Social logo

当把flush_limit设置为1的时候,在高并发的情况也会存在日志丢失的情况。 about openresty-best-practices HOT 3 CLOSED

moonbingbing avatar moonbingbing commented on July 27, 2024
当把flush_limit设置为1的时候,在高并发的情况也会存在日志丢失的情况。

from openresty-best-practices.

Comments (3)

agentzh avatar agentzh commented on July 27, 2024 1

@JoyChou93 当你把 flush_limit 置得很小时,发送请求的频度会提高很多倍。而当你的接收后端来不及接收和处理这么密集的发送请求时,openresty 一侧就只能积压日志,积压到 buffer 的上限,自然只能丢弃日志了。所以当你设置 flush_limit 为 1 时,最好清楚自己在做什么……

from openresty-best-practices.

JoyChou93 avatar JoyChou93 commented on July 27, 2024

@agentzh 我把flush_limit设置为4096,在log阶段 用resty-logger记录日志,高并发的情况,也会丢失日志。ab -n 30000 -c 100

from openresty-best-practices.

agentzh avatar agentzh commented on July 27, 2024

@JoyChou93 你应该先确定你的日志接收端的吞吐能力的极限。如果对端来不及接收,肯定必须得丢。如果你认为是 lua-resty-logger-socket 的 bug,那么你需要提供足够的细节和证据。

from openresty-best-practices.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.