cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
20.25k stars 1.1k forks source link

example of web server uses only single thread, show examples that uses all thread in multi threaded of... #253

Open sprappcom opened 1 month ago

sprappcom commented 1 month ago

show examples that uses all thread in multi threaded of:

  1. one process per cpu core (like nginx)
  2. 1 process used by all cpu cores (pls advice on the maximum cores recommended for use with pingora, in golang, optimum cores are 16-24 while 192 cores suffer performance degradation which is the same as using 24 cores actually)
eaufavor commented 1 month ago

See https://github.com/cloudflare/pingora/blob/main/docs/user_guide/conf.md You can config the number of threads to use.

sprappcom commented 1 month ago

@eaufavor how to hard code pingora to use all threads with the hello world example?

eaufavor commented 1 month ago

use all threads

Do you mean let the hello world service use all the threads given or automatically set the thread number to the number of CPUs on a machine?

The service does the former automatically without any configuration needed. The latter is a feature request, which we can add easily.

sprappcom commented 1 month ago

@eaufavor the latter.

eaufavor commented 4 weeks ago

Okay. That makes sense as a feature request.