Giter Club home page Giter Club logo

Comments (5)

mcollina avatar mcollina commented on May 18, 2024

I'm probably missing something, but why is the file descriptor needed in extreme mode? From what I understood it is needed to flush data before exit, does it mean that the data of the last push will be stored on a file?

You can use extreme mode only using a native (from core) stream, meaning a TCP/unix socket, a file, or stdout/sderr. Otherwise we cannot guarantee that a) if you process exit naturally, the log content will be on stdout/stderr b) you are not losing any log lines in case of a JS crash.

Anyway if I'm logging to a writable stream what should I initialize to this.fd? open a dummy file and get the descriptor? On the console seems to work also passing a random number (is there a way in node to safely get an unused fd other than the dummy file approach?). Is it the correct way to go or do I have to care about that file (or socket?) to retrieve the last push data in case of failures?

If you are logging to a writable stream, consider logging to a file, and then running a separate process to fetch and process that data. That is "the pino way", which will deliver high throughput.

We are still discussing those handlers, so feel free to join the discussion on #92.

Do you think we can improve the documentation? Would you like to send a PR?

from pino.

axyz avatar axyz commented on May 18, 2024

Thanks for the info, will try to reword on the doc to see if it gets clearer.

Anyway can I use the dummy file approach to test the difference in performance? Or there will be no
improvement if the data is processed in the same process?

moving the log handling on a separate process may be a risky refactor, but if the difference is notable I'd definitely would like to try it out as I will need to handle soon at least 10 times the current requests..

from pino.

mcollina avatar mcollina commented on May 18, 2024

The end result is about 10-20% faster in HTTP applications. It might be less, it really depends on your application, and what are the bottlenecks.

I would recommend you to benchmark both cases and check.

from pino.

mcollina avatar mcollina commented on May 18, 2024

Anyway can I use the dummy file approach to test the difference in performance? Or there will be no
improvement if the data is processed in the same process?

Yes you can. The two things are not depending on each other (yet, maybe it will change in the future, who knows).

from pino.

github-actions avatar github-actions commented on May 18, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from pino.

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.