0
0
Ruby on Railsframework~10 mins

Puma server configuration in Ruby on Rails - Interactive Code Practice

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

Complete the code to set the Puma server port to 3000.

Ruby on Rails
port [1]
Drag options to blanks, or click blank then click option'
A80
B8080
C5000
D3000
Attempts:
3 left
💡 Hint
Common Mistakes
Using a port number that is already in use by another service.
Forgetting to set the port in the Puma config file.
2fill in blank
medium

Complete the code to specify the number of Puma worker processes as 2.

Ruby on Rails
workers [1]
Drag options to blanks, or click blank then click option'
A2
B4
C8
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Setting workers to 0 or a negative number.
Confusing workers with threads.
3fill in blank
hard

Fix the error in the code to correctly set the minimum number of threads to 1.

Ruby on Rails
threads [1], 5
Drag options to blanks, or click blank then click option'
A1
B5
C0
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Setting minimum threads to 0 causing Puma to not handle requests.
Swapping minimum and maximum thread numbers.
4fill in blank
hard

Complete the code to configure Puma to preload the application and bind to a Unix socket.

Ruby on Rails
preload_app! 
bind '[1]'
Drag options to blanks, or click blank then click option'
Atcp://0.0.0.0:3000
Bunix:///tmp/puma.sock
C127.0.0.1:9292
Dssl://localhost:443
Attempts:
3 left
💡 Hint
Common Mistakes
Using TCP binding syntax when Unix socket is required.
Forgetting to call preload_app! as a method.
5fill in blank
hard

Fill all three blanks to configure Puma with 3 workers, thread count between 2 and 8, and a port of 4000.

Ruby on Rails
workers [1]
threads [2], [3]
port 4000
Drag options to blanks, or click blank then click option'
A3
B2
C8
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up minimum and maximum thread numbers.
Setting workers or threads to zero or negative values.