Comments (4)
@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.
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.
@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.
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)
- Datagram Unix socket doesn't work HOT 4
- Multiple logs exist in a single line log when use syslog-ng
- Would u develop lua-resty-logger as lib writes logs into local files HOT 1
- Sent log data to logstash, log loss occurred?
- using periodic_flush, reload nginx error: *1046335 open socket #4 left in connection 8
- logger-socket would automatically shut down socket ?
- whats wrong with logging in content_by_lua? HOT 2
- Multi-node acceptance of data HOT 2
- can filter nginx request_method like head?
- can send msg by long connection socket ? why reconect socket in every flusing ? HOT 1
- send msg by tcp ,the numer of msgs received more than sends. HOT 1
- lua-resty-logger-socket请求出现错误
- log message be dropped and socket:setkeepalive error HOT 1
- Test case failures on rhel7.6 ppc64le platform HOT 1
- How can I send log to rsyslog with log severity
- _do_flush函数connect没有close的疑问
- Unable to use this plugin for log into local server log files
- request help: use this lib in nginx stream subsystem
- Only users who are on the same network can communicate on socket.io
- When log messages are generated too quickly, problems may arise
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua-resty-logger-socket.