Thank you for the prompt reply.
The query takes about 1-2 seconds per server. Considering this is running on 10 severs for example, without threads it could take up to 20 seconds for a full query.
I do use threads and have been able to get it down to about 5-8 seconds, but again this is quite slow.
Also locate looks very fast, however I'm unsure how to prevent it from recursing.