Based upon your description, if you haven't considered this already, your might consider having the server maintain a thread pool and request queue. Each incoming request gets placed into the queue, and the worker threads process each request in turn. If there is nothing left in the queue, the threads can wait (when something is placed into the queue the threads can be notified). This gives you control over how many processes run at a given time, and allow you to run multiple requests in parallel. BioJava has implementations of these algorithms already, but if you are required to write them yourself I would say don't peak (I've never been a fan of Biojava, but it comes in handy sometimes). If your requirement is to do pairwise alignments of all sequences in the database to find the top hits, this is exactly what the BLAST algorithm excels at (pairwise algorithms don't scale well, and doing many against a database of sequences is exactly what blast does, only orders of magnitude faster)