cpp: TNonBlockingServer overload handling and optimizations
authorDavid Reiss <dreiss@apache.org>
Tue, 9 Mar 2010 05:19:25 +0000 (05:19 +0000)
committerDavid Reiss <dreiss@apache.org>
Tue, 9 Mar 2010 05:19:25 +0000 (05:19 +0000)
commit01fe15322f55a9aec5de6807fe0d4c54db7d79f6
tree2f95d72f6b8f0fd8f544ce46367f1aeacf4069f9
parente574a065a9ed100bda718582dc3378abc2933e78
cpp: TNonBlockingServer overload handling and optimizations

- Establish a mechanism for TNonBlockingServer to handle overloads by
  limiting the number of connections accepted or in-process.

- Provide a framework for further work in handling server overloads.

- Limit memory consumption of connection object pool.

- Drop connections when overloaded.

- Add overload-handling behavior allowing pending tasks to be dropped
  from the front of the task queue (short of the ability to terminate
  running tasks, these are the oldest tasks in the system and thus the
  most likely to be beyond their freshness date).  This reduces the
  chance of spending valuable CPU time processing a request that the
  client has already timed out.

- Uses a single persistent pipe() to communicate task completion instead
  of constructing and monitoring a new socketpair() for every task in
  the system.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920664 13f79535-47bb-0310-9956-ffa450edef68
lib/cpp/src/concurrency/ThreadManager.cpp
lib/cpp/src/concurrency/ThreadManager.h
lib/cpp/src/server/TNonblockingServer.cpp
lib/cpp/src/server/TNonblockingServer.h