Allow arbitrary number of TCP workers
This commit is contained in:
@@ -37,6 +37,10 @@ options:
|
|||||||
default: 8080
|
default: 8080
|
||||||
type: int
|
type: int
|
||||||
description: TCP port to listen on
|
description: TCP port to listen on
|
||||||
|
workers:
|
||||||
|
default: 0
|
||||||
|
type: int
|
||||||
|
description: Number of TCP workers to launch (0 for the number of system cores)
|
||||||
auth-type:
|
auth-type:
|
||||||
default: tempauth
|
default: tempauth
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ LOCALE=$(config-get locale)
|
|||||||
COMMON_NAME=$(config-get common-name)
|
COMMON_NAME=$(config-get common-name)
|
||||||
PPA=$(config-get swift-release)
|
PPA=$(config-get swift-release)
|
||||||
BINDPORT=$(config-get bind-port)
|
BINDPORT=$(config-get bind-port)
|
||||||
|
WORKERS=$(config-get workers)
|
||||||
AUTHTYPE=$(config-get auth-type)
|
AUTHTYPE=$(config-get auth-type)
|
||||||
KEYSTONE_AUTH_HOST=$(config-get keystone-auth-host)
|
KEYSTONE_AUTH_HOST=$(config-get keystone-auth-host)
|
||||||
KEYSTONE_AUTH_PORT=$(config-get keystone-auth-port)
|
KEYSTONE_AUTH_PORT=$(config-get keystone-auth-port)
|
||||||
@@ -15,8 +16,9 @@ KEYSTONE_ADMIN_TENANT_NAME=$(config-get keystone-admin-tenant-name)
|
|||||||
KEYSTONE_ADMIN_USER=$(config-get keystone-admin-user)
|
KEYSTONE_ADMIN_USER=$(config-get keystone-admin-user)
|
||||||
KEYSTONE_ADMIN_PASSWORD=$(config-get keystone-admin-password)
|
KEYSTONE_ADMIN_PASSWORD=$(config-get keystone-admin-password)
|
||||||
|
|
||||||
# Used in proxy-server.conf. Run one worker per cpu core for now
|
# Used in proxy-server.conf. Run one worker per cpu core by default.
|
||||||
CORES=$(cat /proc/cpuinfo | grep processor | wc -l)
|
CORES=$(cat /proc/cpuinfo | grep processor | wc -l)
|
||||||
|
[ "$WORKERS" = "0" ] && WORKERS="$CORES"
|
||||||
|
|
||||||
# TODO: Need to use different addresses for internal swift traffic
|
# TODO: Need to use different addresses for internal swift traffic
|
||||||
# as this the only security measure in place is network isolation
|
# as this the only security measure in place is network isolation
|
||||||
@@ -60,7 +62,7 @@ cat >/etc/swift/proxy-server.conf <<EOF
|
|||||||
cert_file = /etc/swift/cert.crt
|
cert_file = /etc/swift/cert.crt
|
||||||
key_file = /etc/swift/cert.key
|
key_file = /etc/swift/cert.key
|
||||||
bind_port = $BINDPORT
|
bind_port = $BINDPORT
|
||||||
workers = $CORES
|
workers = $WORKERS
|
||||||
user = swift
|
user = swift
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user