Эх сурвалжийг харах

H2O: Reduce the number of threads in the physical hardware environment again (#2780)

This is an experimental change that tests the behaviour of the framework
with a low number of worker threads (8).
Anton Kirilov 8 жил өмнө
parent
commit
7719a00ba3

+ 7 - 8
frameworks/C/h2o/setup.sh

@@ -6,16 +6,15 @@ H2O_APP_HOME="${IROOT}/h2o_app"
 BUILD_DIR="${H2O_APP_HOME}_build"
 BUILD_DIR="${H2O_APP_HOME}_build"
 H2O_APP_PROFILE_PORT=54321
 H2O_APP_PROFILE_PORT=54321
 H2O_APP_PROFILE_URL="http://127.0.0.1:$H2O_APP_PROFILE_PORT"
 H2O_APP_PROFILE_URL="http://127.0.0.1:$H2O_APP_PROFILE_PORT"
-NUM_PROC=$(nproc)
-PHYSICAL_ENVIRONMENT_THREADS=30
+PHYSICAL_ENVIRONMENT_THREADS=8
 
 
 # A hacky way to detect whether we are running in the physical hardware or the cloud environment.
 # A hacky way to detect whether we are running in the physical hardware or the cloud environment.
-if [[ "$NUM_PROC" -gt 16 ]]; then
+if [[ "$CPU_COUNT" -gt 16 ]]; then
 	CLOUD_ENVIRONMENT=false
 	CLOUD_ENVIRONMENT=false
 	# In the physical hardware environment the number of threads used by the application is not
 	# 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
 	# 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.
 	# adjust the maximum number of database connections per thread accordingly.
-	DB_CONN=4
+	DB_CONN=15
 else
 else
 	CLOUD_ENVIRONMENT=true
 	CLOUD_ENVIRONMENT=true
 	DB_CONN=16
 	DB_CONN=16
@@ -24,9 +23,9 @@ fi
 build_h2o_app()
 build_h2o_app()
 {
 {
 	cmake -DCMAKE_INSTALL_PREFIX="$H2O_APP_HOME" -DCMAKE_BUILD_TYPE=Release \
 	cmake -DCMAKE_INSTALL_PREFIX="$H2O_APP_HOME" -DCMAKE_BUILD_TYPE=Release \
-		-DCMAKE_PREFIX_PATH="${H2O_HOME};${MUSTACHE_C_HOME};${YAJL_HOME}" \
-		-DCMAKE_C_FLAGS="-march=native $1" "$TROOT"
-	make -j "$(nproc)"
+	      -DCMAKE_PREFIX_PATH="${H2O_HOME};${MUSTACHE_C_HOME};${YAJL_HOME}" \
+	      -DCMAKE_C_FLAGS="-march=native $1" "$TROOT"
+	make -j "$CPU_COUNT"
 }
 }
 
 
 run_curl()
 run_curl()
@@ -64,7 +63,7 @@ generate_profile_data
 make clean
 make clean
 rm -f CMakeCache.txt
 rm -f CMakeCache.txt
 build_h2o_app "-fprofile-use"
 build_h2o_app "-fprofile-use"
-make -j "$(nproc)" install
+make -j "$CPU_COUNT" install
 popd
 popd
 rm -rf "$BUILD_DIR"
 rm -rf "$BUILD_DIR"
 echo "Maximum database connections per thread: $DB_CONN"
 echo "Maximum database connections per thread: $DB_CONN"