Sergey Brester
June 27, 2019 02:48PM
Hmm...

From _The Linux Programming Interface: A Linux and UNIX System
Programming Handbook_ [2]:

Nonblocking mode can be used with devices (e.g., terminals and
pseudoterminals), pipes, FIFOs, and sockets. (Because file descriptors
for pipes and sockets are not obtained using open(), we must enable this
flag using the fcntl() F_SETFL operation described in Section 5.3.)

So basically if a "sharing" of standard handles is properly implemented
between master/workers and a line buffering is good enough for the
logging, you can "write to terminal in non-blocking manner."

Additionally note the stdout can be mapped to systemd journals (which
are files and channel will be to pipe), if nginx would running as
systemd service unit.

Regards,
Serg.

27.06.2019 19:35, Valentin V. Bartenev wrote:

> Afaik, there's no way in Linux systems to write to terminal in
> non-blocking manner. As the result, writing log can block the
> whole nginx worker process and cause DoS.
>
> IMHO, it's not a good idea to make your web-application depend
> on logging capabilities.
>
> wbr, Valentin V. Bartenev
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.orghttp://mailman.nginx.org/mailman/listinfo/nginx-devel [1]


Links:
------
[1] http://mailman.nginx.org/mailman/listinfo/nginx-devel
[2]
https://books.google.de/books?id=Ps2SH727eCIC&lpg=PA103&ots=kMHcB5EQya&dq=From%20The%20Linux%20Programming%20Interface%3A%20A%20Linux%20and%20UNIX%20System%20Programming%20Handbook%3A%20Nonblocking%20mode%20can%20be%20used%20with%20devices%20(e.g.%2C%20terminals%20and%20pseudoterminals)%2C%20pipes%2C%20FIFOs%2C%20and%20sockets.%20(Because%20file%20descriptors%20for%20pipes%20and%20sockets%20are%20not%20obtained%20using%20open()%2C%20we%20must%20enable%20The%20Linux%20Programming%20Interface%3A%20A%20Linux%20and%20UNIX%20System%20Programming%20Handbook&hl=de&pg=PA103#v=onepage&q&f=false_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Default log file locations

Peter Bittner 316 June 27, 2019 01:14PM

Re: Default log file locations

Valentin V. Bartenev 149 June 27, 2019 01:36PM

Re: Default log file locations

Peter Bittner 145 June 27, 2019 01:46PM

Re: Default log file locations

Valentin V. Bartenev 133 June 27, 2019 02:20PM

Re: Default log file locations

Sergey Brester 164 June 27, 2019 02:48PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 209
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready