I did not want to add a load balancer in between the Client and the Tika servers. This is just another chance to have timeouts, point of failure, etc.
So instead I have set up a single jetty management server endpoint. It manages the forked tika server instances. It has just one rest method: /get-tika-server-endpoint - GET - Returns a single tika server endpoint that can be used for parsing. So the client will request a Tika server URL from the management server, then will use this endpoint URL and parse using it. I would like to have a reaper daemon that checks all the tika servers last parse time and will kill un-used processes. Then I would make it so the /get-tika-server-endpoint method would start the tika server in the case that it was returning one that is not running. On Thu, Jul 9, 2020 at 8:44 AM Tim Allison <[email protected]> wrote: > I think this is unrelated, but I want to communicate it: in spawnChild > mode, the child _should_ terminate if the parent terminates. If you aren't > seeing this behavior and you're on > 1.23, let us know. > > Given that the child process _is the server_, it would have to be up to get > the request to turn back on. > > We could add a "last time accessed" end point if that would help... > > If we had that, you'd probably also want to know what the load was in the > last x minutes so that you could decide whether or not to add more servers. > > Are you putting your tika-servers behind a load-balancer? > > On Wed, Jul 8, 2020 at 9:55 PM Nicholas DiPiazza < > [email protected]> wrote: > > > Does the tika "spawnChild" option allow for idle tika child processes to > be > > killed and respawned when needed? > > > > We fire up about 5 of these things when our major indexing and parsing > > begins, but the processes will remain up even after indexing ends. > > > > Is there a way to tell the child processes to die after a certain amount > of > > idle time, then spin back up when needed? > > > > Or is there some "last time accessed" that stores a timestamp of the last > > time an API resource was accessed? I could accomplish a reaper daemon > that > > kills the idle processes that way too. > > > > -Nicholas > > >
