-
Notifications
You must be signed in to change notification settings - Fork 32
Nginx QAT #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ssherman8
wants to merge
9
commits into
intel:main
Choose a base branch
from
ssherman8:nginx_qat
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Nginx QAT #48
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
71c44d4
Add NGINX with Intel QAT optimization guide
ssherman8 31f9ccf
Update README.md
ssherman8 0442936
Update results chart and reconcile Details references
ssherman8 527e773
Restructure nginx guide into QAT subdirectory
ssherman8 1839d02
Address review feedback on QAT detection and CPS test script
ssherman8 a80678d
Document kernel driver requirements and build environment variables
ssherman8 a343391
Merge remote-tracking branch 'upstream/main' into nginx_qat
ssherman8 d244f64
Added link to NGINX optimization landing page
ssherman8 34f9b01
Add license pointers and drop out-of-tree QAT configuration references
ssherman8 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| #!/bin/bash | ||
| # For use with intel/asynch_mode_nginx, which is licensed under the | ||
| # BSD 3-Clause License. | ||
| # See https://github.com/intel/asynch_mode_nginx/blob/master/LICENSE | ||
|
|
||
| ###################################### | ||
| ############# USER INPUT ############# | ||
| ###################################### | ||
| ip_address="$1" | ||
| _time=10 | ||
| clients=200 | ||
| port=443 | ||
| cipher=AES128-SHA | ||
| ###################################### | ||
| ############# USER INPUT ############# | ||
| ###################################### | ||
|
|
||
| helpAndError () { | ||
| echo "This script is used to run the ConnectionsPerSecond(CPS) testing HTTPS." | ||
| echo "To use this script: ./connection_test.sh <ip_address>" | ||
| echo "To do a dry-run, use the emulation flag:" | ||
| echo "./connection_test.sh <ip_address> --emulation" | ||
| exit 0 | ||
| } | ||
|
|
||
| # Check for h flag or no command line args | ||
| if [[ -z $ip_address || $@ == *-h* || $@ == *--help* ]]; then | ||
| helpAndError | ||
| fi | ||
|
|
||
| # Check for emulation flag | ||
| emulation=0 | ||
| if [[ $@ == **emulation** ]] | ||
| then | ||
| emulation=1 | ||
|
|
||
| fi | ||
|
|
||
| # cmd1 is the first part of the commandline and cmd2 is the second part | ||
| # The total commandline will be cmd1 + $ip_address:$port + cmd2 | ||
| cmd1="openssl s_time -connect" | ||
| cmd2="-new -cipher $cipher -time $_time" | ||
|
|
||
| # Print out variables to check | ||
| printf " IP Addresses: $ip_address\n" | ||
| printf " Time: $_time\n" | ||
| printf " Clients: $clients\n" | ||
| printf " Port: $port\n" | ||
| printf " Cipher: $cipher\n" | ||
|
|
||
| # Remove previous .test files | ||
| rm -rf ./.test_* | ||
|
|
||
| # Get starttime | ||
| starttime=$(date +%s) | ||
|
|
||
| # Kick off the tests after checking for emulation | ||
| if [[ $emulation -eq 1 ]] | ||
| then | ||
| for (( i = 0; i < ${clients}; i++ )); do | ||
| printf "$cmd1 $ip_address:$(($port)) $cmd2 > .test_$(($port))_$i &\n" | ||
| done | ||
| exit 0 | ||
| else | ||
| for (( i = 0; i < ${clients}; i++ )); do | ||
| $cmd1 $ip_address:$(($port)) $cmd2 > .test_$(($port))_$i & | ||
| done | ||
| fi | ||
|
|
||
| waitstarttime=$(date +%s) | ||
|
|
||
| # wait until all processes complete | ||
| # The clients are child processes of this script, so wait returns once every | ||
| # one of them has exited. | ||
| wait | ||
|
|
||
| sumTotal=$(cat ./.test_$(($port))* | awk '(/^[0-9]* connections in [0-9]* real/){ total += $1/$4 } END {print total}') | ||
| printf "Connections per second: $sumTotal CPS\n" | ||
| printf "Finished in %d seconds (%d seconds waiting for procs to start)\n" $(($(date +%s) - $starttime)) $(($waitstarttime - $starttime)) | ||
| rm -rf ./.test_* | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # Based on the configuration samples in intel/asynch_mode_nginx, which is | ||
| # licensed under the BSD 3-Clause License. | ||
| # See https://github.com/intel/asynch_mode_nginx/blob/master/LICENSE | ||
|
|
||
| # NGINX.CONF with QAT (for GNR with QAT test case) | ||
|
|
||
| worker_processes 48; | ||
| error_log logs/error.log; | ||
| pid logs/nginx.pid; | ||
| worker_rlimit_nofile 102400; | ||
|
|
||
| load_module modules/ngx_http_qatzip_filter_module.so; | ||
| load_module modules/ngx_ssl_engine_qat_module.so; | ||
|
|
||
| events { | ||
| use epoll; | ||
| worker_connections 102400; | ||
| accept_mutex off; | ||
| } | ||
|
|
||
| # Enable QAT engine in heuristic mode. | ||
| ssl_engine { | ||
| use_engine qatengine; | ||
| default_algorithms ALL; | ||
| #default_algorithms RSA,EC,DH,DSA; | ||
| qat_engine { | ||
| qat_offload_mode async; | ||
| qat_notify_mode poll; | ||
| qat_poll_mode heuristic; | ||
| qat_sw_fallback off; | ||
| } | ||
| } | ||
|
|
||
| http { | ||
| include mime.types; | ||
| default_type application/octet-stream; | ||
| gzip on; | ||
| gzip_min_length 128; | ||
| gzip_comp_level 1; | ||
| gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/json application/xml application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml; | ||
| gzip_vary on; | ||
| gzip_disable "msie6"; | ||
| gzip_http_version 1.0; | ||
|
|
||
| qatzip_sw failover; | ||
| qatzip_min_length 128; | ||
| qatzip_comp_level 9; | ||
| qatzip_buffers 16 8k; | ||
| qatzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/json application/xml application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml application/octet-stream image/jpeg; | ||
| qatzip_chunk_size 64k; | ||
| qatzip_stream_size 256k; | ||
| qatzip_sw_threshold 256; | ||
|
|
||
| # HTTPS server | ||
| # | ||
| server { | ||
| listen 443 ssl asynch; | ||
| server_name localhost; | ||
|
|
||
| ssl_protocols TLSv1.2; | ||
|
|
||
| ssl_certificate /usr/local/nginx_qat_module/certs/server.crt; | ||
| ssl_certificate_key /usr/local/nginx_qat_module/certs/server.key; | ||
| access_log off; | ||
| } | ||
| } |
44 changes: 44 additions & 0 deletions
44
software/nginx/QAT/supporting_files/nginx_without_qat.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Based on the configuration samples in intel/asynch_mode_nginx, which is | ||
| # licensed under the BSD 3-Clause License. | ||
| # See https://github.com/intel/asynch_mode_nginx/blob/master/LICENSE | ||
|
|
||
| worker_processes 48; | ||
| error_log logs/error.log; | ||
| pid logs/nginx.pid; | ||
| worker_rlimit_nofile 102400; | ||
|
|
||
| #load_module modules/ngx_http_qatzip_filter_module.so; | ||
| #load_module modules/ngx_ssl_engine_qat_module.so; | ||
|
|
||
| events { | ||
| use epoll; | ||
| worker_connections 102400; | ||
| accept_mutex off; | ||
| } | ||
|
|
||
|
|
||
| http { | ||
| include mime.types; | ||
| default_type application/octet-stream; | ||
| gzip on; | ||
| gzip_min_length 128; | ||
| gzip_comp_level 1; | ||
| gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/json application/xml application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml; | ||
| gzip_vary on; | ||
| gzip_disable "msie6"; | ||
| gzip_http_version 1.0; | ||
|
|
||
|
|
||
| # HTTPS server | ||
| # | ||
| server { | ||
| listen 443 ssl asynch; | ||
| server_name localhost; | ||
|
|
||
| ssl_protocols TLSv1.2; | ||
|
|
||
| ssl_certificate /usr/local/nginx_qat_module/certs/server.crt; | ||
| ssl_certificate_key /usr/local/nginx_qat_module/certs/server.key; | ||
| access_log off; | ||
| } | ||
| } |
|
adgubrud marked this conversation as resolved.
ssherman8 marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # NGINX Optimization Guides | ||
|
|
||
| This section contains optimization guides for [NGINX](https://nginx.org/) on Intel hardware. | ||
|
|
||
| NGINX is the world's most popular webserver. It is free and open source software, distributed under the terms of a simplified 2-clause BSD-like license. Because a web tier spends much of its time on TLS handshakes and on compressing responses, it benefits from offloading that cryptography and compression work off the CPU cores and onto dedicated accelerators. | ||
|
|
||
| ## Available Guides | ||
|
|
||
| | Guide | Description | | ||
| | --- | --- | | ||
| | [NGINX with Intel® QAT](QAT/README.md) | Offload TLS handshake cryptography and compression to Intel® QuickAssist Technology (Intel® QAT) using async-mode-nginx, including hardware and software prerequisites, configuration, and Connections Per Second (CPS) benchmark results. | | ||
|
|
||
| ## References | ||
|
|
||
| asynch_mode_nginx: https://github.com/intel/asynch_mode_nginx | ||
|
|
||
| NGINX: https://nginx.org/ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.