Giter Site home page Giter Site logo

Comments (4)

agentzh avatar agentzh commented on July 26, 2024

@robholland Unix domain sockets are not free of overhead. Writing to such sockets also involve an expensive send system call. If every request trigger such an expensive system call, it will have a big impact on the system's overall throughput. And you can always disable the buffering yourself by configuring flush_limit = 1 in your own Lua code anyway :)

from lua-resty-logger-socket.

robholland avatar robholland commented on July 26, 2024

The trouble is, certainly with syslog, it's not valid to write more than exactly one log message per packet. So saving up such calls doesn't gain you anything I don't think, you still need to make the same number of syscalls.

from lua-resty-logger-socket.

agentzh avatar agentzh commented on July 26, 2024

@robholland Sorry, I was talking about the stream typed unix domain sockets. If you are using unix domain sockets of the datagram type, then you have to issue separate send system call to send each message in individual datagram. So this mode could be quite expensive. (Also, ngx_lua does not support datagram unix domain socket pooling, so it could also require an extra socket system call at least).

Even for datagram typed unix domain socket, message buffering can save a lot of ngx.timer.at calls and their associated light threads' overhead, and also approximate socket pooling.

from lua-resty-logger-socket.

robholland avatar robholland commented on July 26, 2024

Ok, so it should be left as it was in the patch buffering wise, and allow people to control it with flush limit = 1 as they like.

Unfortunately datagram based sockets are the only option for logging to /dev/log on some linux distributions.

Closing, thanks.

from lua-resty-logger-socket.

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.