roadrunner
roadrunner copied to clipboard
[💡FEATURE REQUEST]: Extend http server configuration options
Extend http section with http server configuration options, such as: read-write timeouts, header size etc..
We can extend HTTP/FCGI server options with the following:
ReadTimeout: config,
ReadHeaderTimeout: config,
WriteTimeout: config,
IdleTimeout: config,
MaxHeaderBytes: config,
HTTP2 server:
MaxHandlers: config,
MaxConcurrentStreams: config,
MaxReadFrameSize: config,
PermitProhibitedCipherSuites: config,
IdleTimeout: config,
MaxUploadBufferPerConnection: config,
MaxUploadBufferPerStream: config,
We can extend HTTP/FCGI server options with the following:
ReadTimeout: config, ReadHeaderTimeout: config, WriteTimeout: config, IdleTimeout: config, MaxHeaderBytes: config,HTTP2 server:
MaxHandlers: config, MaxConcurrentStreams: config, MaxReadFrameSize: config, PermitProhibitedCipherSuites: config, IdleTimeout: config, MaxUploadBufferPerConnection: config, MaxUploadBufferPerStream: config,
why is config there? is it an abstract type?
why is config there?
It's just a placeholder for GitHub, which means, that value should be taken from the config.
@48d90782 do i understand correctly, we extends FCGIConfig and HTTP2Config? also we need to add options to server config for Fcgi and HTTP2? is that right way?
@ohDaddyPlease Let me explain, it's my bad :)
We extend the http section in the .rr.yaml (which is located in the root). You need to add, right after the http section, configuration options for the http (yaml), and http2 options, right after the http2 key in the http. It should look like the following:
http:
address: 127.0.0.1:44933
max_request_size: 1024
read_timeout: 10s #seconds
read_header_timeout: 10s #seconds,
write_timeout: 10s #seconds,
idle_timeout: 10s #seconds,
max_header_bytes: 1000,
middleware: [ "gzip", "headers" ]
uploads:
forbid: [ ".php", ".exe", ".bat" ]
trusted_subnets:
[
"10.0.0.0/8",
"127.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"::1/128",
"fc00::/7",
"fe80::/10",
]
pool:
num_workers: 6
max_jobs: 0
allocate_timeout: 60s
destroy_timeout: 60s
supervisor:
# WatchTick defines how often to check the state of worker (seconds)
watch_tick: 1
# TTL defines maximum time worker is allowed to live (seconds)
ttl: 0
# IdleTTL defines maximum duration worker can spend in idle mode. Disabled when 0 (seconds)
idle_ttl: 100
# ExecTTL defines maximum lifetime per job (seconds)
exec_ttl: 10
# MaxWorkerMemory limits memory per worker (MB)
max_worker_memory: 100
http2:
enabled: false
h2c: false
max_concurrent_streams: 128
max_handlers: config,
max_read_frame_size: config,
permit_prohibited_cipher_suites: bool,
idle_timeout: config,
max_upload_buffer_per_connection: config,
max_upload_buffer_per_stream: config,
Default values should be taken from the http.Server standard library, and should be set by the InitDefaults method (config.go).
Then, these values should be set:
- for the http2: https://github.com/spiral/roadrunner/blob/2.0/plugins/http/config.go#L80
- for the http: https://github.com/spiral/roadrunner/blob/2.0/plugins/http/config.go#L38 Also, values should be documented in the roadrunner-dev repository and structure fields should also have comments (yaml too)
@ohDaddyPlease Do you have any plans to work on this ticket?