[RFC] The nginx way of handling optimizations for hw architectures

Joe Konno joe.konno at linux.intel.com
Tue Nov 19 21:01:03 UTC 2019


Hey all,

I'm requesting comment/input on how nginx would like to do architecture
detection at build time as well as at run time. This is for the purposes
of optimizing nginx for specific hardware (see my e-mail address for
what specific hardware I hope to optimize for). ^_^

For build time, I see nginx has '--with-cpu-opt'. Does the community use
that configure flag much (if at all)? I could see adding some host
detection facilities. But, for OSes who build and/or package for
multiple architectures, the limitations of such detection become
immediately apparent.

Bear with me as I get architecture-specific, but for run time, I do see
a core function using (the first leaf of) CPUID output to determine a
cache line size. Other leaves of the CPUID instruction could be used, at
run time /or/ configure/build time, to determine which optimized
function(s) to use given the host CPU's capabilities.

There are a few ways to handle optimizations at the instruction set
level, so I am looking for guidance on the "nginx way" of doing such
things. Is there a line between what optimizations should be determined
at build time? At run time? The Development Guide doesn't say much about
this-- or I missed it-- so any hints/clues are appreciated.

^_^

-- 
Cheers


More information about the nginx-devel mailing list