davidmoreno / onion

C library to create simple HTTP servers and Web Applications.
http://www.coralbits.com/libonion/
Other
2.02k stars 252 forks source link

Benchmarks + Threading model #245

Closed alexe100 closed 5 years ago

alexe100 commented 5 years ago

Hi! I am using onion in a commercial web service and it is doing great... As number of customers are growing i am worried about the used threading model (due to pull approach) and benchmarks (number of request per second). My questions are:

  1. After compiling and running onion service, how can I check with threading model is being used?
  2. Do you have some test benchmarks in order to give us a number of requests onion can dispatch per second?

Thanks a lot Great software!

Alex

davidmoreno commented 5 years ago

Hi,

  1. At run time you can check the onion flags onion_flags(onion) and check if it is in O_POLL, O_POLL, O_THREADED..
  2. I have very informal benchmarks, normaly done with ab or wrk, but it is very specific to what do the handler do. A simple "hello world" is super fast, but normally your handler does a lot more, and normally there is the bottleneck, not in onion.

For specific numbers, I just ran the hello example and got 145016.35 req/sec on my Intel i7 6900. But it just returns "hello world" (with keep alive, 20 concurrent requests, not special care for stoping music not browsers...).

Thanks for using Onion!