Hi everybody,

while Scala isn''t natively supported by Thrift, maybe someone has seen the same problem I'm facing. I have got a very simple Thrift service which is doing some processing (100 to 1000ms) and then returns the result back to the client. When benchmarking I noticed that when adding more concurrent clients the performance degraded: while one client was getting 10 req/sec, two were getting 5 req/sec, and so on. So the server is handling the requests sequential for some reason. I have tried all implementations (TThreadPoolServer, TNonblockingServer, THsHaServer) with the same results. The implementation is quite vanilla:

// Includes here...

class ServiceHandler() extends service.Iface {
        override def call_function(String: foo) : String = {
                Thread.sleep(100)
                return "result"
        }
}

object server {
 def main(args: Array[String]) {
   val processor = new service.Processor(new ServiceHandler())
   val socket = new TNonblockingServerSocket(9090)
   val server = new TNonblockingServer(processor, socket)
   server.serve()
}

Java 1.6.0_16, Scala 2.7.5, same results on Mac and Linux.

Any hints what I might be running into here?

Regards
Sebastian

Reply via email to