On 06.06.19 18:26, Andrew Piskorski wrote:
From inside NaviServer, I'd like to repeatedly write data to some
files in the background,
I assume you want to consume data from remote?
No, the data isn't being uploaded by clients, it's received or
generated server-side. Think a streaming data feed from some other
server. The nssock module isn't involved at all, so I don't think
there's any way for me to use its spoolerthreads or maxupload feature
here.
In OpenACS there is the background writer, which works via a separate
tclthead (using the tcl thread library, called "AsyncDiskWriter" see
[1], used
e.g. in [2]) which was to avoid blocking the server when the file-system
blocks. File system blocks were an issue years ago in Linux, but i have
not noticed this problem lately (maybe because of the "asynclogwriter"
in NaviServer (see sample config file for OpenACS in the NaviServer distro),
or due to the mentioned AsyncDiskWriter.
I am rather planing to reduce the usage of the Tcl-based
AsyncDiskWriter, since this depends on select() in current Tcl
implementations, which will run into problems when there are
more than 1024 fds are open. It is however quite easy to
provide a Tcl Interface to NsAsyncWrite() in NaviServer,
to implement this when needed, sine the base infrastructure is
already there.
The main question is, why are you interested in async writes?
-g
[1]
https://github.com/openacs/xotcl-core/blob/oacs-5-10/tcl/bgdelivery-procs.tcl#L228
[2]
https://github.com/openacs/xotcl-request-monitor/blob/master/tcl/throttle_mod-procs.tcl#L68
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel