Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent performance supported by the HTTP server #482

Closed
liangchenBoom opened this issue Feb 5, 2024 · 0 comments
Closed

Concurrent performance supported by the HTTP server #482

liangchenBoom opened this issue Feb 5, 2024 · 0 comments

Comments

@liangchenBoom
Copy link

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]image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant