@@ -34,6 +34,10 @@ pub struct HttpServerConfig {
3434
3535 /// Request payload size in MB
3636 pub payload_request_size : u32 ,
37+
38+ /// Number of worker threads for the actix-web server.
39+ /// If not specified, defaults to the number of logical CPU cores.
40+ pub worker_count : Option < usize > ,
3741}
3842
3943impl Default for HttpServerConfig {
@@ -44,6 +48,7 @@ impl Default for HttpServerConfig {
4448 certificate : None ,
4549 insecure_http : DEFAULT_INSECURE_HTTP ,
4650 payload_request_size : DEFAULT_PAYLOAD_REQUEST_SIZE ,
51+ worker_count : None ,
4752 }
4853 }
4954}
@@ -165,6 +170,7 @@ mod tests {
165170 certificate: Some ( "/etc/kbs-cert.pem" . into( ) ) ,
166171 insecure_http: false ,
167172 payload_request_size: DEFAULT_PAYLOAD_REQUEST_SIZE ,
173+ worker_count: None ,
168174 } ,
169175 admin: AdminConfig {
170176 auth_public_key: Some ( PathBuf :: from( "/etc/kbs-admin.pub" ) ) ,
@@ -214,6 +220,7 @@ mod tests {
214220 certificate: None ,
215221 insecure_http: DEFAULT_INSECURE_HTTP ,
216222 payload_request_size: DEFAULT_PAYLOAD_REQUEST_SIZE ,
223+ worker_count: None ,
217224 } ,
218225 admin: AdminConfig {
219226 auth_public_key: None ,
@@ -251,6 +258,7 @@ mod tests {
251258 certificate: Some ( "/etc/kbs-cert.pem" . into( ) ) ,
252259 insecure_http: false ,
253260 payload_request_size: DEFAULT_PAYLOAD_REQUEST_SIZE ,
261+ worker_count: None ,
254262 } ,
255263 admin: AdminConfig {
256264 auth_public_key: Some ( PathBuf :: from( "/etc/kbs-admin.pub" ) ) ,
@@ -289,6 +297,7 @@ mod tests {
289297 certificate: None ,
290298 insecure_http: true ,
291299 payload_request_size: DEFAULT_PAYLOAD_REQUEST_SIZE ,
300+ worker_count: None ,
292301 } ,
293302 admin: AdminConfig {
294303 auth_public_key: Some ( PathBuf :: from( "/opt/confidential-containers/kbs/user-keys/public.pub" ) ) ,
@@ -330,6 +339,7 @@ mod tests {
330339 certificate: None ,
331340 insecure_http: true ,
332341 payload_request_size: DEFAULT_PAYLOAD_REQUEST_SIZE ,
342+ worker_count: None ,
333343 } ,
334344 admin: AdminConfig {
335345 auth_public_key: Some ( "/kbs/kbs.pem" . into( ) ) ,
@@ -365,6 +375,7 @@ mod tests {
365375 certificate: None ,
366376 insecure_http: true ,
367377 payload_request_size: DEFAULT_PAYLOAD_REQUEST_SIZE ,
378+ worker_count: None ,
368379 } ,
369380 admin: AdminConfig {
370381 auth_public_key: Some ( "/kbs/kbs.pem" . into( ) ) ,
0 commit comments