Skip to content

Commit a543932

Browse files
Merge pull request #1149 from IABTechLab/ant-UID2-4430-vsockpx-thread-count
UID2-4430 Automatic allocation of cores to vsockpx and operator vertx
2 parents 2aba623 + 62421ce commit a543932

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

scripts/aws/eks-pod/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function setup_vsockproxy() {
2727
echo "setup_vsockproxy"
2828
VSOCK_PROXY=${VSOCK_PROXY:-/home/vsockpx}
2929
VSOCK_CONFIG=${VSOCK_CONFIG:-/home/proxies.host.yaml}
30-
VSOCK_THREADS=${VSOCK_THREADS:-$(( $(nproc) * 2 )) }
30+
VSOCK_THREADS=${VSOCK_THREADS:-$(( ( $(nproc) + 1 ) / 2 )) }
3131
VSOCK_LOG_LEVEL=${VSOCK_LOG_LEVEL:-3}
3232
echo "starting vsock proxy at $VSOCK_PROXY with $VSOCK_THREADS worker threads..."
3333
$VSOCK_PROXY -c $VSOCK_CONFIG --workers $VSOCK_THREADS --log-level $VSOCK_LOG_LEVEL --daemon

scripts/aws/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ifconfig lo 127.0.0.1
1616

1717
# -- start vsock proxy
1818
echo "Starting vsock proxy..."
19-
/app/vsockpx --config /app/proxies.nitro.yaml --daemon --workers $(( $(nproc) * 2 )) --log-level 3
19+
/app/vsockpx --config /app/proxies.nitro.yaml --daemon --workers $(( ( $(nproc) + 3 ) / 4 )) --log-level 3
2020

2121
# -- load config from identity service
2222
echo "Loading config from identity service via proxy..."

scripts/aws/make_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def apply_override(config, overrides, key, type):
2626
config['optout_api_token'] = overrides['api_token']
2727

2828
# number of threads
29-
config['service_instances'] = thread_count
29+
config['service_instances'] = int((thread_count + 1) * 2 / 3)
3030

3131
# environment
3232
if overrides.get('environment') == 'integ':

scripts/aws/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function update_allocation() {
8181
function setup_vsockproxy() {
8282
VSOCK_PROXY=${VSOCK_PROXY:-/usr/bin/vsockpx}
8383
VSOCK_CONFIG=${VSOCK_CONFIG:-/etc/uid2operator/proxy.yaml}
84-
VSOCK_THREADS=${VSOCK_THREADS:-$(( $(nproc) * 2 )) }
84+
VSOCK_THREADS=${VSOCK_THREADS:-$(( ( $(nproc) + 1 ) / 2 )) }
8585
VSOCK_LOG_LEVEL=${VSOCK_LOG_LEVEL:-3}
8686
echo "starting vsock proxy at $VSOCK_PROXY with $VSOCK_THREADS worker threads..."
8787
$VSOCK_PROXY -c $VSOCK_CONFIG --workers $VSOCK_THREADS --log-level $VSOCK_LOG_LEVEL --daemon

0 commit comments

Comments
 (0)