|
@@ -6,17 +6,17 @@ H2O_APP_HOME="${IROOT}/h2o_app"
|
|
|
BUILD_DIR="${H2O_APP_HOME}_build"
|
|
|
H2O_APP_PROFILE_PORT=54321
|
|
|
H2O_APP_PROFILE_URL="http://127.0.0.1:$H2O_APP_PROFILE_PORT"
|
|
|
-PHYSICAL_ENVIRONMENT_THREADS="$CPU_COUNT"
|
|
|
+NUM_WORKERS="$CPU_COUNT"
|
|
|
|
|
|
# A hacky way to detect whether we are running in the physical hardware or the cloud environment.
|
|
|
if [[ "$CPU_COUNT" -gt 16 ]]; then
|
|
|
- CLOUD_ENVIRONMENT=false
|
|
|
+ USE_PROCESSES=false
|
|
|
# In the physical hardware environment the number of threads used by the application is not
|
|
|
# the same as the number of logical CPU cores that the database server has, so we need to
|
|
|
# adjust the maximum number of database connections per thread accordingly.
|
|
|
DB_CONN=1
|
|
|
else
|
|
|
- CLOUD_ENVIRONMENT=true
|
|
|
+ USE_PROCESSES=false
|
|
|
DB_CONN=16
|
|
|
fi
|
|
|
|
|
@@ -69,10 +69,13 @@ popd
|
|
|
rm -rf "$BUILD_DIR"
|
|
|
echo "Maximum database connections per thread: $DB_CONN"
|
|
|
|
|
|
-if "$CLOUD_ENVIRONMENT"; then
|
|
|
- run_h2o_app 0 "${H2O_APP_HOME}/bin" "${H2O_APP_HOME}/share/h2o_app"
|
|
|
-else
|
|
|
- for ((i = 0; i < PHYSICAL_ENVIRONMENT_THREADS; i++)); do
|
|
|
+if "$USE_PROCESSES"; then
|
|
|
+ echo "Running $NUM_WORKERS h2o_app processes..."
|
|
|
+
|
|
|
+ for ((i = 0; i < NUM_WORKERS; i++)); do
|
|
|
run_h2o_app "$i" "${H2O_APP_HOME}/bin" "${H2O_APP_HOME}/share/h2o_app" -t1
|
|
|
done
|
|
|
+else
|
|
|
+ echo "Running h2o_app multithreaded..."
|
|
|
+ run_h2o_app 0 "${H2O_APP_HOME}/bin" "${H2O_APP_HOME}/share/h2o_app"
|
|
|
fi
|