in reply to Daemonizing (or otherwise speeding up) a high-overhead script?

Any client/server architecture you fancy will handle this. Long-running server processes to avoid the on-request startup costs and listening for occasional client connections. Since it's already a Catalyst app I don't see why you wouldn't initiate the jobs via web requests. Now, having said that ...

has a very high startup overhead, thanks to a large number of database connections that have to be set up at the start of every run. It takes about 30 seconds or so before it starts to respond ... Assume there's no way to reduce the startup costs.

Mounting my high horse I will assert that there is a way to reduce the startup costs, particularly if they are just setting up a large number of database connections. These can be done in parallel and that will save stacks of time because most of the latency will be due to the network and the server side processing of the authnz and setting it all up on the far end. Everyone will have their own yardstick but I expect most will agree that 30 seconds is far too long as an init phase. A little work to refactor that init phase should pay off handsomely.


🦛

  • Comment on Re: Daemonizing (or otherwise speeding up) a high-overhead script?