Concurrent performance supported by the HTTP server
liangchenBoom opened this issue · 0 comments
Hi, everyone. I'm a rookie, and I've gotten into some trouble.
I'm building a sample Http server like echo server example, then I use Jmeter with up to 64 concurrent requests to do concurrent http post tests. I saw the great concurrency performance in the graph below[1]. That's what I want.
So this is my structure,the sample http server on one server, jmeter as http client on another server, their hardware devices are Intel(R) Xeon(R) Gold 6151 CPU @ 3.00GHz with 36 physical cores, the ping between them is 0.045ms.
The sample http servercode is like this(from another issues):
void RequestHandler::onEOM() noexcept {
// give those separate worker threads the EventBase* from the RequestHandler thread
folly::EventBase* eventBase = folly::EventBaseManager::get()->getEventBase();
threadPool->add([downstream_, eventBase]() {
//do some work in there, note that there is very little work here, and it takes almost no time.
eventBase->runInEventBaseThread([&downstream_]() {
ResponseBuilder(downstream_).status(...).header(...).body("").sendWithEOM();
}
}
// the other code like echo server example
HTTPServerOptions options;
options.threads = static_cast<size_t>(FLAGS_threads);
options.idleTimeout = std::chrono::milliseconds(60000);
options.enableContentCompression = false;
options.handlerFactories =
RequestHandlerChain().addThen<EchoHandlerFactory>().build();
options.h2cEnabled = true;
}
The test method is to adjust FLAGS_threads and then use Jmeter to test different concurrent requests, record the best performance.
FLAGS_threads | 1 | 2 | 3 | 4 | 5 | 8 | 12 | 24 | 64 |
---|---|---|---|---|---|---|---|---|---|
ops/s | 8000 | 16000 | 24000 | 28000 | 29000 | 29000 | 27000 | 27000 | 26000 |
This is different from the data in [1]. Can someone help me out here?
Thanks for your help.
[1]