Forum OpenACS Q&A: Re: Monitoring and Controlling Queries

Collapse
Posted by Don Baccus on
I can't think of any easy way to do this ... if PG provides a way to select the PID of the current running backend you could    use an nsv_array to store the handle's PID used when serving an expensive page, keying with user_id and a unique page identifier.  This would require manually allocating the handle rather than using our db_* API.

You'd then clear the array entry when you're done.

On entry you'd check to see if the page is already being processed for the user by looking for the nsv_array and issue a SIGUP to the handle's PID that you've stored.

Then go set up the bookkeeping once again.

Sounds like a hassle.  Better to write fast queries and buy adequate hardware IMO and adjust AOLserver configuration parameters (max and min thread mostly) appropriately.