intel / asynch_mode_nginx

Other
210 stars 60 forks source link

Unable to load module #50

Closed cody0704 closed 2 years ago

cody0704 commented 2 years ago

Redhat cannot be installed from the source code, but because the default is already 1.1.1g, there is no need to update openssl

OpenSSL

Confirm that openssl can use QAT

$ openssl speed rsa2048 
$ openssl speed -engine qatengine rsa2048
$ openssl speed -engine qatengine -async_jobs 8 rsa2048
sign verify sign/s verify/s
cpu rsa 2048 bits 0.000637s 0.000029s 1570.4 34797.8
openssl 1.1.1g qat sync rsa 2048 bits 0.0000495s 0.000096s 2018.4 10426.2
openssl 1.1.1g qat async rsa 2048 bits 0.000055s 0.000009s 18213.1 116548.2

Nginx

Install

asynch_mode_nginx needs to specify the location of openssl lib, but I don’t know

$ ./configure --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf \
--without-http_rewrite_module --with-http_ssl_module --with-http_stub_status_module \
--with-http_v2_module --with-stream --with-stream_ssl_module \
--add-dynamic-module=modules/nginx_qat_module/ \
--with-cc-opt="-DNGX_SECURE_MEM -I/opt/QAT/quickassist/include -I/opt/QAT/quickassist/include/dc 
-Wno-error=deprecated-declarations"

Check module

$ ll /etc/nginx/modules/
-rwxr-xr-x 1 root root 88096 Sep  6 06:40 ngx_ssl_engine_qat_module.so

Config

load_module modules/ngx_ssl_engine_qat_module.so;
ssl_engine {
    use_engine qatengine;
    default_algorithms RSA,EC,DH,PKEY_CRYPTO;
    qat_engine {
            qat_offload_mode async;
            qat_notify_mode poll;
            qat_poll_mode heuristic;
            qat_sw_fallback on;
    }
}

Nginx config test

$ /etc/nginx/sbin/nginx -t

nginx: [emerg] dlopen() "/usr/lib/nginx/modules/ngx_stream_module.so" failed (/usr/lib/nginx/modules/ngx_stream_module.so: cannot open shared object file: No such file or directory) in /etc/nginx/conf/nginx.conf:12
nginx: configuration file /etc/nginx/conf/nginx.conf test failed

Does the installation method need to be modified?

cody0704 commented 2 years ago

Reinstallation is normal thank you all

zhangp8x commented 2 years ago

@cody0704

Any questions, please feel free to contact us.

BRs