I've just committed to trunk a new implementation of a threaded rivet module. Actually it doesn't still work as a full refactoring of the current model, it has severe limitations in its features, most notably it runs only .tcl files and doesn't know anything of the Rivet command set. So it can just run scripts based on the Tcl core language, but I wanted at this stage to test the threaded model and see if it passes the tests the first naive implementation failed.
It seems that it's working well with Tcl 8.6.1 under the same conditions with which the other module failed. I tested it reducing greatly the number of threads and child processes started by the server. It was able to successfully process 2000 requests fired with a concurrency of 100 requests at a time. After a while the worker MPM complained for not having more threads available, but mod_rivet endured the test The module starts a pool of threads each in turn creating its own Tcl interpreter and Rivet channel. They wait on a queue (http://apr.apache.org/docs/apr-util/0.9/group__APR__Util__FIFO.html) to which Apache threads post requests to be processed. The number of threads created is on purpose kept fixed and very low (4). A whole problem arises about the policy to follow in order to manage those Tcl threads (meaning "threads running Tcl interpreters" in this case) but it will tacked when the code is more mature. To add some overhead to the module Tcl threads exit after only a few requests processed, they notify a supervisor thread which replaces them with newly created Tcl running threads. This was added to test the case when a thread exits, but I haven't figured out if Tcl exit command can be safely renamed to a new command that stops a thread, not the whole child process (and all of its threads alike!) Anyone wanting to test it is welcome. A typical configure command that builds the experimental module: ./configure --with-apache=/usr/local/apache2 --with-apxs=/usr/local/apache2/bin/apxs --with-rivet-core=experimental --with-rivet-channel=experimental --with-rivet-target-dir=/usr/local/lib/rivet2.2 --with-tcl=/usr/local/lib/tcl8.6/lib notice the --with-rivet-channel switch that points to a modified rivetChannel.c file -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
