0
0
Nginxdevops~10 mins

sendfile and tcp_nopush in Nginx - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable zero-copy file transfer in nginx.

Nginx
sendfile [1];
Drag options to blanks, or click blank then click option'
Aon
Boff
Cauto
Denable
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'off' disables sendfile, which is the default but slower.
Using 'enable' is not a valid nginx option.
2fill in blank
medium

Complete the code to enable tcp_nopush in nginx for better packet handling.

Nginx
tcp_nopush [1];
Drag options to blanks, or click blank then click option'
Aoff
Bon
Cfalse
Ddisable
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'off' disables tcp_nopush, which may reduce performance.
Using 'disable' or 'false' are not valid nginx options.
3fill in blank
hard

Fix the error in the nginx configuration to properly enable sendfile.

Nginx
sendfile [1];
Drag options to blanks, or click blank then click option'
Ayes
Benable
Ctrue
Don
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enable' or 'true' instead of 'on' causes nginx to fail parsing the config.
4fill in blank
hard

Fill both blanks to configure nginx for optimal file sending with sendfile and tcp_nopush.

Nginx
sendfile [1];
tcp_nopush [2];
Drag options to blanks, or click blank then click option'
Aon
Boff
Attempts:
3 left
💡 Hint
Common Mistakes
Turning off either sendfile or tcp_nopush reduces performance benefits.
5fill in blank
hard

Fill all three blanks to complete the nginx configuration snippet for efficient file serving.

Nginx
server {
    listen 80;
    root /var/www/html;
    sendfile [1];
    tcp_nopush [2];
    keepalive_timeout [3];
}
Drag options to blanks, or click blank then click option'
Aon
C65
D30
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'off' disables performance features.
Setting keepalive_timeout too low can reduce connection reuse.