James Bromberger wrote:
> ... and pretty quickly
> we're spiraling down into oblivion; each extra
> thread is delaying the first one from coming up
> with a result as the system sinks under load.
Have you actually witnessed this happen or is this a theory?
> So, is it feasible fo rthe QCache to be extended
> so that, when the first thread looks at the cache,
> it inserts a placeholder into the QCache with a
> mark showing that it is now executing this query,
> and permitting other subsequent threads to see
> that they should wait for a few milliseconds and
> check the cache again to see if the result has
> been returns and the cache now populated? Sort of
> like a semaphore to prevent spiralling into a
> deadlock of resources. Perhaps have a timestamp as
> to when the lookup started, so we can see if it
> was recent (within 60 (configurable) seconds?) in
> case the executing thread was killed, to prevent a
> stale cache.
Sure. Issue a LOCK TABLES explicitly before the execution of the first thread. I believe that would force a wait of the other threads until the first has completed, at which point the query cache would contain the desired result set and things would proceed smoothly.
Jay Pipes
Community Relations Manager, North America, MySQL Inc.
Got Cluster?
http://www.mysql.com/cluster
Personal:
http://jpipes.com