Você pode verificar se o nginx foi criado com o OpenSSL executando nginx -V
.
[root@saurok ~]# nginx -V
nginx version: nginx/1.8.0
built by gcc 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)
built with OpenSSL 1.0.1k-fips 8 Jan 2015
TLS SNI support enabled
...
Você pode verificar se o OpenSSL usa o Intel AES-NI executando os benchmarks internos do OpenSSL.
Compare a saída de openssl speed aes-128-cbc
com openssl speed -evp aes-128-cbc
. O primeiro pula a aceleração de hardware, mesmo que presente, enquanto o segundo usa aceleração, se disponível. Exceto pelo índice de referência, ele será usado automaticamente se presente .
Por exemplo:
[root@saurok ~]# openssl speed aes-128-cbc
Doing aes-128 cbc for 3s on 16 size blocks: 32797518 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 64 size blocks: 9030109 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 256 size blocks: 2311493 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 1024 size blocks: 582201 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 8192 size blocks: 72836 aes-128 cbc's in 3.00s
OpenSSL 1.0.1k-fips 8 Jan 2015
built on: Thu Aug 13 12:19:54 2015
options:bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx)
compiler: -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-128 cbc 174920.10k 192642.33k 197247.40k 198724.61k 198890.84k
em comparação com
[root@saurok ~]# openssl speed -evp aes-128-cbc
Doing aes-128-cbc for 3s on 16 size blocks: 169042680 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 64 size blocks: 45311567 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 256 size blocks: 11536773 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 1024 size blocks: 2897474 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 8192 size blocks: 362685 aes-128-cbc's in 3.00s
OpenSSL 1.0.1k-fips 8 Jan 2015
built on: Thu Aug 13 12:19:54 2015
options:bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx)
compiler: -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-128-cbc 901560.96k 966646.76k 984471.30k 989004.46k 990371.84k
Como você pode ver, o último é muito mais rápido, indicando que a aceleração de hardware está em uso.