Comments (7)
This sounds like a great feature. Holding up any thread to block on expensive I/O operations is a bad idea. There should be a way to set things up so a background thread handles all I/O.
from glog.
FWIW I ended up implementing this using existing public glog APIs, in case anyone's interested in borrowing the code for their projects (or for distribution as part of glog)
https://github.com/apache/kudu/blob/master/src/kudu/util/async_logger.h
https://github.com/apache/kudu/blob/master/src/kudu/util/async_logger.cc
https://github.com/apache/kudu/blob/master/src/kudu/util/logging.cc#L129 (EnableAsyncLogging)
from glog.
An additional enhancement with caveats is to replace the mutex with a lock-free queue, there is discussion by the author of g3log here:
https://kjellkod.wordpress.com/2015/06/30/the-worlds-fastest-logger-vs-g3log/
from glog.
@toddlipcon :hi,have you benchmark kudu's async_logger?with native glog?
from glog.
I didn't do throughput benchmarks, but the async logging solved a lot of blocking issues that we saw before where critical parts of our code would get "stuck" for several hundred milliseconds. Throughput is likely improved as well, but that's rarely a consideration for our app, so we didn't test it.
from glog.
Hi @sergiud @toddlipcon Since the ticket is closed, did we add Asynchronous/double-buffering support in glog ? It doesn't appear so, but can you please confirm.
from glog.
No support was added. The issue was closed due to inactivity. I'll reopen it.
from glog.
Related Issues (20)
- How to encrypt logs HOT 1
- [proposal] Provide pre-defined JSON log sink in glog HOT 2
- [Emscripten][Ubuntu 22.04.3 LTS] Use of undeclared identifier 'SYS_write' HOT 3
- building phase in Ubuntu 23.10 : /usr/bin/ld: /usr/local/lib/libgflags.a(gflags.cc.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPI HOT 3
- windows mingw64 compile fail HOT 4
- error in including <glog/logging.h> after installing glog according to the official tutorial HOT 2
- namespace "google" has no member "InitGoogleLogging" HOT 1
- FetchContent support HOT 4
- Customizing the Log Line Prefix HOT 2
- Can not build app integrating glog using CMake . HOT 3
- It throws StackOverflowError when executing Runtime.exec() by JNI after glog initialized. HOT 5
- Can LOG(FATAL) insert `__builtin_unreachable()` after `Fail()` ? HOT 2
- meet ASAN check failed when LOG(WARNING) HOT 6
- Can glog support compress log files? HOT 1
- glog.ini logfile_mode set error HOT 1
- why FLAGS_log_file_header is not exist in release version 0.6.0 ? HOT 1
- cmake: dbghelp is incorrectly detected when building static libraris with Xcode generator HOT 1
- make error relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' HOT 2
- Support Unicode in paths HOT 6
- LoongArch undefined reference error HOT 8
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 glog.