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

remove $CPU_COUNT (#3474)

* remove $CPU_COUNT

* remove $CPU_COUNT from toolset

* fix dart stream
Nate 7 жил өмнө
parent
commit
8d10136e89
58 өөрчлөгдсөн 62 нэмэгдсэн , 74 устгасан
  1. 1 1
      frameworks/C++/cutelyst/cutelyst-benchmark-app.dockerfile
  2. 1 3
      frameworks/C++/cutelyst/cutelyst-framework.dockerfile
  3. 1 2
      frameworks/C++/cutelyst/cutelyst-nginx-my.dockerfile
  4. 1 2
      frameworks/C++/cutelyst/cutelyst-nginx-pg.dockerfile
  5. 1 2
      frameworks/C++/cutelyst/cutelyst-nginx.dockerfile
  6. 1 2
      frameworks/C++/cutelyst/cutelyst-pf-my-nodelay.dockerfile
  7. 1 2
      frameworks/C++/cutelyst/cutelyst-pf-my.dockerfile
  8. 1 2
      frameworks/C++/cutelyst/cutelyst-pf-nodelay.dockerfile
  9. 1 2
      frameworks/C++/cutelyst/cutelyst-pf-pg-nodelay.dockerfile
  10. 1 2
      frameworks/C++/cutelyst/cutelyst-pf-pg.dockerfile
  11. 1 2
      frameworks/C++/cutelyst/cutelyst-thread-my-nodelay.dockerfile
  12. 1 2
      frameworks/C++/cutelyst/cutelyst-thread-my.dockerfile
  13. 1 2
      frameworks/C++/cutelyst/cutelyst-thread-nodelay.dockerfile
  14. 1 2
      frameworks/C++/cutelyst/cutelyst-thread-pg-nodelay.dockerfile
  15. 1 2
      frameworks/C++/cutelyst/cutelyst-thread-pg.dockerfile
  16. 1 2
      frameworks/C++/cutelyst/cutelyst-thread.dockerfile
  17. 1 2
      frameworks/C++/cutelyst/cutelyst.dockerfile
  18. 1 1
      frameworks/C++/luna/luna-epoll.dockerfile
  19. 1 1
      frameworks/C++/luna/luna.dockerfile
  20. 1 1
      frameworks/C++/poco/poco.dockerfile
  21. 1 1
      frameworks/C++/silicon/silicon.dockerfile
  22. 1 1
      frameworks/C++/wt/wt-postgres.dockerfile
  23. 1 1
      frameworks/C++/wt/wt.dockerfile
  24. 2 0
      frameworks/CSharp/aspnet/run.sh
  25. 1 1
      frameworks/CSharp/evhttp-sharp/evhttp-sharp.dockerfile
  26. 2 0
      frameworks/CSharp/nancy/run.sh
  27. 2 0
      frameworks/CSharp/servicestack/run.sh
  28. 1 1
      frameworks/Dart/dart/dart.dockerfile
  29. 1 1
      frameworks/Dart/redstone/redstone-mongodb.dockerfile
  30. 1 1
      frameworks/Dart/redstone/redstone.dockerfile
  31. 1 0
      frameworks/Dart/start/nginx-conf.sh
  32. 1 0
      frameworks/Dart/start/start-servers.sh
  33. 3 3
      frameworks/Dart/start/start.dockerfile
  34. 1 0
      frameworks/Dart/stream/nginx-conf.sh
  35. 1 0
      frameworks/Dart/stream/start-servers.sh
  36. 3 3
      frameworks/Dart/stream/stream.dockerfile
  37. 1 1
      frameworks/Haskell/servant/servant.dockerfile
  38. 1 1
      frameworks/Haskell/spock/spock.dockerfile
  39. 1 1
      frameworks/Haskell/wai/wai.dockerfile
  40. 1 1
      frameworks/Haskell/yesod/yesod-mongodb-raw.dockerfile
  41. 1 1
      frameworks/Haskell/yesod/yesod-postgres.dockerfile
  42. 1 1
      frameworks/Haskell/yesod/yesod.dockerfile
  43. 1 1
      frameworks/Lua/openresty/openresty.dockerfile
  44. 1 1
      frameworks/Perl/dancer/dancer.dockerfile
  45. 1 1
      frameworks/Perl/kelp/kelp-mongodb.dockerfile
  46. 1 1
      frameworks/Perl/kelp/kelp.dockerfile
  47. 1 1
      frameworks/Perl/plack/plack.dockerfile
  48. 1 1
      frameworks/Perl/web-simple/web-simple.dockerfile
  49. 1 1
      frameworks/Python/bottle/bottle-nginx-uwsgi.dockerfile
  50. 1 1
      frameworks/Python/flask/flask-nginx-uwsgi.dockerfile
  51. 1 1
      frameworks/Python/uwsgi/uwsgi-nginx-uwsgi.dockerfile
  52. 1 1
      frameworks/Python/uwsgi/uwsgi.dockerfile
  53. 1 1
      frameworks/Python/weppy/weppy-nginx-uwsgi.dockerfile
  54. 1 1
      frameworks/Ur/urweb/urweb-mysql.dockerfile
  55. 1 1
      frameworks/Ur/urweb/urweb.dockerfile
  56. 0 2
      toolset/run-tests.py
  57. 0 2
      toolset/setup/docker/base.dockerfile
  58. 0 1
      toolset/utils/docker_helper.py

+ 1 - 1
frameworks/C++/cutelyst/cutelyst-benchmark-app.dockerfile

@@ -16,4 +16,4 @@ RUN cd ${TROOT} && \
     cd build && \
     cmake ${TROOT} \
     -DCMAKE_BUILD_TYPE=Release && \
-    make -j ${CPU_COUNT}
+    make

+ 1 - 3
frameworks/C++/cutelyst/cutelyst-framework.dockerfile

@@ -11,6 +11,4 @@ RUN wget https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O c
     -DPLUGIN_UWSGI=on \
     -DPLUGIN_VIEW_GRANTLEE=on \
     -DUSE_JEMALLOC=on && \
-    make -j ${CPU_COUNT} && \
-    make install
-
+    make && make install

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-nginx-my.dockerfile

@@ -1,6 +1,5 @@
 FROM tfb/cutelyst-nginx-base:latest
 
-ENV C_PROCESSES=${CPU_COUNT}
 ENV C_THREADS=1
 ENV CPU_AFFINITY=1
 ENV DRIVER=QMYSQL
@@ -11,7 +10,7 @@ CMD nginx -c /nginx.conf && uwsgi \
     --ini /cutelyst_socket.ini \
     --plugin /usr/lib/uwsgi/plugins/cutelyst2_plugin.so \
     --cutelyst-app ${CUTELYST_APP} \
-    --processes=${C_PROCESSES} \
+    --processes=$(nproc) \
     --threads=${C_THREADS} \
     --cpu-affinity=${CPU_AFFINITY} \
     --reuse-port

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-nginx-pg.dockerfile

@@ -1,6 +1,5 @@
 FROM tfb/cutelyst-nginx-base:latest
 
-ENV C_PROCESSES=${CPU_COUNT}
 ENV C_THREADS=1
 ENV CPU_AFFINITY=1
 ENV DRIVER=QPSQL
@@ -11,7 +10,7 @@ CMD nginx -c /nginx.conf && uwsgi \
     --ini /cutelyst_socket.ini \
     --plugin /usr/lib/uwsgi/plugins/cutelyst2_plugin.so \
     --cutelyst-app ${CUTELYST_APP} \
-    --processes=${C_PROCESSES} \
+    --processes=$(nproc) \
     --threads=${C_THREADS} \
     --cpu-affinity=${CPU_AFFINITY} \
     --reuse-port

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-nginx.dockerfile

@@ -1,6 +1,5 @@
 FROM tfb/cutelyst-nginx-base:latest
 
-ENV C_PROCESSES=${CPU_COUNT}
 ENV C_THREADS=1
 ENV CPU_AFFINITY=1
 
@@ -8,7 +7,7 @@ CMD nginx -c /nginx.conf && uwsgi \
     --ini /cutelyst_socket.ini \
     --plugin /usr/lib/uwsgi/plugins/cutelyst2_plugin.so \
     --cutelyst-app ${CUTELYST_APP} \
-    --processes=${C_PROCESSES} \
+    --processes=$(nproc) \
     --threads=${C_THREADS} \
     --cpu-affinity=${CPU_AFFINITY} \
     --reuse-port

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-pf-my-nodelay.dockerfile

@@ -1,6 +1,5 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
-ENV C_PROCESSES=${CPU_COUNT}
 ENV C_THREADS=1
 ENV CPU_AFFINITY=1
 ENV DRIVER=QMYSQL
@@ -11,7 +10,7 @@ RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=${DBHOST}|g" /cutelyst.ini
 CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
-    --processes=${C_PROCESSES} \
+    --processes=$(nproc) \
     --threads=${C_THREADS} \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-pf-my.dockerfile

@@ -1,6 +1,5 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
-ENV C_PROCESSES=${CPU_COUNT}
 ENV C_THREADS=1
 ENV CPU_AFFINITY=1
 ENV DRIVER=QMYSQL
@@ -11,7 +10,7 @@ RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=${DBHOST}|g" /cutelyst.ini
 CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
-    --processes=${C_PROCESSES} \
+    --processes=$(nproc) \
     --threads=${C_THREADS} \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-pf-nodelay.dockerfile

@@ -1,13 +1,12 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
-ENV C_PROCESSES=${CPU_COUNT}
 ENV C_THREADS=1
 ENV CPU_AFFINITY=1
 
 CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
-    --processes=${C_PROCESSES} \
+    --processes=$(nproc) \
     --threads=${C_THREADS} \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-pf-pg-nodelay.dockerfile

@@ -1,6 +1,5 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
-ENV C_PROCESSES=${CPU_COUNT}
 ENV C_THREADS=1
 ENV CPU_AFFINITY=1
 ENV DRIVER=QPSQL
@@ -11,7 +10,7 @@ RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=${DBHOST}|g" /cutelyst.ini
 CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
-    --processes=${C_PROCESSES} \
+    --processes=$(nproc) \
     --threads=${C_THREADS} \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-pf-pg.dockerfile

@@ -1,6 +1,5 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
-ENV C_PROCESSES=${CPU_COUNT}
 ENV C_THREADS=1
 ENV CPU_AFFINITY=1
 ENV DRIVER=QPSQL
@@ -10,7 +9,7 @@ RUN sed -i "s|Driver=.*|Driver=${DRIVER}|g" /cutelyst.ini
 CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
-    --processes=${C_PROCESSES} \
+    --processes=$(nproc) \
     --threads=${C_THREADS} \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-thread-my-nodelay.dockerfile

@@ -1,7 +1,6 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
 ENV C_PROCESSES=1
-ENV C_THREADS=${CPU_COUNT}
 ENV CPU_AFFINITY=1
 ENV DRIVER=QMYSQL
 
@@ -11,7 +10,7 @@ CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
     --processes=${C_PROCESSES} \
-    --threads=${C_THREADS} \
+    --threads=$(nproc) \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \
     --reuse-port \

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-thread-my.dockerfile

@@ -1,7 +1,6 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
 ENV C_PROCESSES=1
-ENV C_THREADS=${CPU_COUNT}
 ENV CPU_AFFINITY=1
 ENV DRIVER=QMYSQL
 
@@ -11,7 +10,7 @@ CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
     --processes=${C_PROCESSES} \
-    --threads=${C_THREADS} \
+    --threads=$(nproc) \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \
     --reuse-port

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-thread-nodelay.dockerfile

@@ -1,14 +1,13 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
 ENV C_PROCESSES=1
-ENV C_THREADS=${CPU_COUNT}
 ENV CPU_AFFINITY=1
 
 CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
     --processes=${C_PROCESSES} \
-    --threads=${C_THREADS} \
+    --threads=$(nproc) \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \
     --reuse-port \

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-thread-pg-nodelay.dockerfile

@@ -1,7 +1,6 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
 ENV C_PROCESSES=1
-ENV C_THREADS=${CPU_COUNT}
 ENV CPU_AFFINITY=1
 ENV DRIVER=QPSQL
 
@@ -11,7 +10,7 @@ CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
     --processes=${C_PROCESSES} \
-    --threads=${C_THREADS} \
+    --threads=$(nproc) \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \
     --reuse-port \

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-thread-pg.dockerfile

@@ -1,7 +1,6 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
 ENV C_PROCESSES=1
-ENV C_THREADS=${CPU_COUNT}
 ENV CPU_AFFINITY=1
 ENV DRIVER=QPSQL
 
@@ -11,7 +10,7 @@ CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
     --processes=${C_PROCESSES} \
-    --threads=${C_THREADS} \
+    --threads=$(nproc) \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \
     --reuse-port

+ 1 - 2
frameworks/C++/cutelyst/cutelyst-thread.dockerfile

@@ -1,14 +1,13 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
 ENV C_PROCESSES=1
-ENV C_THREADS=${CPU_COUNT}
 ENV CPU_AFFINITY=1
 
 CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
     --processes=${C_PROCESSES} \
-    --threads=${C_THREADS} \
+    --threads=$(nproc) \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \
     --reuse-port

+ 1 - 2
frameworks/C++/cutelyst/cutelyst.dockerfile

@@ -1,13 +1,12 @@
 FROM tfb/cutelyst-benchmark-app:latest
 
-ENV C_PROCESSES=${CPU_COUNT}
 ENV C_THREADS=1
 ENV CPU_AFFINITY=1
 
 CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
-    --processes=${C_PROCESSES} \
+    --processes=$(nproc) \
     --threads=${C_THREADS} \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \

+ 1 - 1
frameworks/C++/luna/luna-epoll.dockerfile

@@ -1,3 +1,3 @@
 FROM tfb/luna-base:latest
 
-CMD /luna/bin/lunabench_epoll 8080 $((2 * $CPU_COUNT))
+CMD /luna/bin/lunabench_epoll 8080 $((2 * $(nproc)))

+ 1 - 1
frameworks/C++/luna/luna.dockerfile

@@ -1,3 +1,3 @@
 FROM tfb/luna-base:latest
 
-CMD /luna/bin/lunabench_default 8080 $((2 * $CPU_COUNT))
+CMD /luna/bin/lunabench_default 8080 $((2 * $(nproc)))

+ 1 - 1
frameworks/C++/poco/poco.dockerfile

@@ -24,4 +24,4 @@ COPY ./benchmark.cpp ./
 
 RUN  g++-4.8 -O3 -DNDEBUG -std=c++0x -o poco benchmark.cpp -I$POCO_HOME/Foundation/include -I$POCO_HOME/Util/include -I$POCO_HOME/Net/include -L$POCO_HOME/lib/Linux/x86_64 -lPocoNet -lPocoUtil -lPocoFoundation -lPocoXML -lPocoJSON
 
-CMD ./poco 8080 $CPU_COUNT
+CMD ./poco 8080 $(nproc)

+ 1 - 1
frameworks/C++/silicon/silicon.dockerfile

@@ -4,4 +4,4 @@ RUN cd build && \
     cmake .. -DCMAKE_CXX_COMPILER=clang++-3.9 && \
     make silicon_tpc_mysql
 
-CMD /build/silicon_tpc_mysql ${DBHOST} 8080 ${CPU_COUNT}
+CMD /build/silicon_tpc_mysql ${DBHOST} 8080 $(nproc)

+ 1 - 1
frameworks/C++/wt/wt-postgres.dockerfile

@@ -23,4 +23,4 @@ RUN g++-6 \
 
 ENV DBHOST=TFB-database
 
-CMD ./te-benchmark-pg.wt -c wt_config.xml -t ${CPU_COUNT} --docroot . --approot . --http-listen 0.0.0.0:8080 --accesslog=- --no-compression
+CMD ./te-benchmark-pg.wt -c wt_config.xml -t $(nproc) --docroot . --approot . --http-listen 0.0.0.0:8080 --accesslog=- --no-compression

+ 1 - 1
frameworks/C++/wt/wt.dockerfile

@@ -22,4 +22,4 @@ RUN g++-6 \
 
 ENV DBHOST=TFB-database
 
-CMD ./te-benchmark.wt -c wt_config.xml -t ${CPU_COUNT} --docroot . --approot . --http-listen 0.0.0.0:8080 --accesslog=- --no-compression
+CMD ./te-benchmark.wt -c wt_config.xml -t $(nproc) --docroot . --approot . --http-listen 0.0.0.0:8080 --accesslog=- --no-compression

+ 2 - 0
frameworks/CSharp/aspnet/run.sh

@@ -1,5 +1,7 @@
 #!/bin/bash
 
+CPU_COUNT=$(nproc)
+
 # one fastcgi instance for each thread
 # load balanced by nginx
 port_start=9001

+ 1 - 1
frameworks/CSharp/evhttp-sharp/evhttp-sharp.dockerfile

@@ -8,4 +8,4 @@ RUN xbuild src/EvHttpSharpBenchmark.csproj /p:Configuration=Release
 
 ENV MONO_GC_PARAMS nursery-size=64m
 
-CMD mono -O=all src/bin/Release/EvHttpSharpBenchmark.exe 127.0.0.1 8085 ${CPU_COUNT}
+CMD mono -O=all src/bin/Release/EvHttpSharpBenchmark.exe 127.0.0.1 8085 $(nproc)

+ 2 - 0
frameworks/CSharp/nancy/run.sh

@@ -1,5 +1,7 @@
 #!/bin/bash
 
+CPU_COUNT=$(nproc)
+
 # one fastcgi instance for each thread
 # load balanced by nginx
 port_start=9001

+ 2 - 0
frameworks/CSharp/servicestack/run.sh

@@ -1,5 +1,7 @@
 #!/bin/bash
 
+CPU_COUNT=$(nproc)
+
 # one fastcgi instance for each thread
 # load balanced by nginx
 port_start=9001

+ 1 - 1
frameworks/Dart/dart/dart.dockerfile

@@ -4,4 +4,4 @@ COPY ./ ./
 
 RUN pub upgrade
 
-CMD dart server.dart -a 0.0.0.0 -p 8080 -d $MAX_CONCURRENCY -i $CPU_COUNT
+CMD dart server.dart -a 0.0.0.0 -p 8080 -d $MAX_CONCURRENCY -i $(nproc)

+ 1 - 1
frameworks/Dart/redstone/redstone-mongodb.dockerfile

@@ -4,4 +4,4 @@ COPY ./ ./
 
 RUN pub upgrade
 
-CMD dart server.dart -a 0.0.0.0 -p 8080 -d ${CPU_COUNT} -i ${CPU_COUNT}
+CMD dart server.dart -a 0.0.0.0 -p 8080 -d $(nproc) -i $(nproc)

+ 1 - 1
frameworks/Dart/redstone/redstone.dockerfile

@@ -4,4 +4,4 @@ COPY ./ ./
 
 RUN pub upgrade
 
-CMD dart server.dart -a 0.0.0.0 -p 8080 -d ${CPU_COUNT} -i ${CPU_COUNT}
+CMD dart server.dart -a 0.0.0.0 -p 8080 -d $(nproc) -i $(nproc)

+ 1 - 0
frameworks/Dart/start/nginx-conf.sh

@@ -3,6 +3,7 @@
 #
 # create nginx configuration
 #
+CPU_COUNT=$(nproc)
 conf+="user root;\n"
 conf+="worker_processes ${CPU_COUNT};\n"
 conf+="error_log stderr;\n"

+ 1 - 0
frameworks/Dart/start/start-servers.sh

@@ -3,6 +3,7 @@
 #
 # start dart servers
 #
+CPU_COUNT=$(nproc)
 current=9001
 end=$(($current+$CPU_COUNT))
 while [ $current -lt $end ]; do

+ 3 - 3
frameworks/Dart/start/start.dockerfile

@@ -14,6 +14,6 @@ RUN pub upgrade
 
 RUN chmod -R 777 /start
 
-RUN ./nginx-conf.sh
-
-CMD  ./start-servers.sh && sleep 20 && nginx -c /start/nginx.conf -g "daemon off;"
+CMD ./nginx-conf.sh && \
+    ./start-servers.sh && \
+    sleep 20 && nginx -c /start/nginx.conf -g "daemon off;"

+ 1 - 0
frameworks/Dart/stream/nginx-conf.sh

@@ -3,6 +3,7 @@
 #
 # create nginx configuration
 #
+CPU_COUNT=$(nproc)
 conf+="user root;\n"
 conf+="worker_processes ${CPU_COUNT};\n"
 conf+="error_log stderr;\n"

+ 1 - 0
frameworks/Dart/stream/start-servers.sh

@@ -3,6 +3,7 @@
 #
 # start dart servers
 #
+CPU_COUNT=$(nproc)
 current=9001
 end=$(($current+$CPU_COUNT))
 while [ $current -lt $end ]; do

+ 3 - 3
frameworks/Dart/stream/stream.dockerfile

@@ -14,6 +14,6 @@ RUN pub upgrade
 
 RUN chmod -R 777 /stream
 
-RUN ./nginx-conf.sh
-
-CMD  ./start-servers.sh && sleep 20 && nginx -c /stream/nginx.conf -g "daemon off;"
+CMD ./nginx-conf.sh && \
+    ./start-servers.sh && \
+    sleep 20 && nginx -c /stream/nginx.conf -g "daemon off;"

+ 1 - 1
frameworks/Haskell/servant/servant.dockerfile

@@ -5,4 +5,4 @@ COPY ./ ./
 RUN stack --allow-different-user setup
 RUN stack --allow-different-user build
 
-CMD stack --allow-different-user exec servant-exe -- TFB-database +RTS -A32m -N${CPU_COUNT}
+CMD stack --allow-different-user exec servant-exe -- TFB-database +RTS -A32m -N$(nproc)

+ 1 - 1
frameworks/Haskell/spock/spock.dockerfile

@@ -4,4 +4,4 @@ COPY ./ ./
 
 RUN stack --allow-different-user build --install-ghc
 
-CMD stack --allow-different-user exec spock-exe -- +RTS -A32m -N${CPU_COUNT}
+CMD stack --allow-different-user exec spock-exe -- +RTS -A32m -N$(nproc)

+ 1 - 1
frameworks/Haskell/wai/wai.dockerfile

@@ -4,4 +4,4 @@ COPY ./ ./
 
 RUN cd bench && stack --allow-different-user build --install-ghc
 
-CMD cd bench && stack --allow-different-user exec bench -- ${CPU_COUNT} TFB-database +RTS -A32m -N${CPU_COUNT}
+CMD cd bench && stack --allow-different-user exec bench -- $(nproc) TFB-database +RTS -A32m -N$(nproc)

+ 1 - 1
frameworks/Haskell/yesod/yesod-mongodb-raw.dockerfile

@@ -1,3 +1,3 @@
 FROM tfb/yesod-mongodb-base:latest
 
-CMD stack --allow-different-user exec yesod-mysql-mongo -- ${CPU_COUNT} TFB-database +RTS -A32m -N${CPU_COUNT}
+CMD stack --allow-different-user exec yesod-mysql-mongo -- $(nproc) TFB-database +RTS -A32m -N$(nproc)

+ 1 - 1
frameworks/Haskell/yesod/yesod-postgres.dockerfile

@@ -4,4 +4,4 @@ COPY ./yesod-postgres ./
 
 RUN stack --allow-different-user build --install-ghc
 
-CMD stack --allow-different-user exec yesod-postgres -- ${CPU_COUNT} TFB-database +RTS -A32m -N${CPU_COUNT}
+CMD stack --allow-different-user exec yesod-postgres -- $(nproc) TFB-database +RTS -A32m -N$(nproc)

+ 1 - 1
frameworks/Haskell/yesod/yesod.dockerfile

@@ -1,3 +1,3 @@
 FROM tfb/yesod-mongodb-base:latest
 
-CMD stack --allow-different-user exec yesod-mysql-mongo -- ${CPU_COUNT} TFB-database +RTS -A32m -N${CPU_COUNT}
+CMD stack --allow-different-user exec yesod-mysql-mongo -- $(nproc) TFB-database +RTS -A32m -N$(nproc)

+ 1 - 1
frameworks/Lua/openresty/openresty.dockerfile

@@ -9,4 +9,4 @@ RUN sed -i 's|DBHOSTNAME|'"${DBHOST}"'|g' app.lua
 
 RUN luarocks install lua-resty-template
 
-CMD nginx -c /openresty/nginx.conf -g "worker_processes '"${CPU_COUNT}"';"
+CMD nginx -c /openresty/nginx.conf -g "worker_processes '"$(nproc)"';"

+ 1 - 1
frameworks/Perl/dancer/dancer.dockerfile

@@ -25,4 +25,4 @@ RUN cpanm --notest --no-man-page \
       [email protected]
 
 CMD nginx -c /dancer/nginx.conf && \
-    plackup -E production -s Starman --workers=${CPU_COUNT} -l /tmp/perl-dancer.sock -a ./app.pl
+    plackup -E production -s Starman --workers=$(nproc) -l /tmp/perl-dancer.sock -a ./app.pl

+ 1 - 1
frameworks/Perl/kelp/kelp-mongodb.dockerfile

@@ -5,4 +5,4 @@ ENV MONGO=1
 RUN sleep 10
 
 CMD nginx -c /kelp/nginx.conf && \
-    plackup -E production -s Starman --workers=${CPU_COUNT} -l /tmp/perl-kelp.sock -a ./app.pl
+    plackup -E production -s Starman --workers=$(nproc) -l /tmp/perl-kelp.sock -a ./app.pl

+ 1 - 1
frameworks/Perl/kelp/kelp.dockerfile

@@ -1,4 +1,4 @@
 FROM tfb/kelp-base:latest
 
 CMD nginx -c /kelp/nginx.conf && \
-    plackup -E production -s Starman --workers=${CPU_COUNT} -l /tmp/perl-kelp.sock -a ./app.pl
+    plackup -E production -s Starman --workers=$(nproc) -l /tmp/perl-kelp.sock -a ./app.pl

+ 1 - 1
frameworks/Perl/plack/plack.dockerfile

@@ -28,4 +28,4 @@ add ./nginx.conf /plack/
 CMD nginx -c /plack/nginx.conf && \
     start_server --backlog=16384 --pid-file=/plack/app.pid --path=/tmp/perl-plack.sock -- plackup \
     -E production -s Starlet --max-keepalive-reqs 1000 --max-reqs-per-child 50000 \
-    --min-reqs-per-child 40000 --max-workers=${CPU_COUNT} -a /plack/app.psgi
+    --min-reqs-per-child 40000 --max-workers=$(nproc) -a /plack/app.psgi

+ 1 - 1
frameworks/Perl/web-simple/web-simple.dockerfile

@@ -26,5 +26,5 @@ ADD ./app.pl /simple/
 ADD ./nginx.conf /simple/
 
 CMD nginx -c /simple/nginx.conf && \
-    plackup -E production -s Starman --workers=${CPU_COUNT} \
+    plackup -E production -s Starman --workers=$(nproc) \
     -l /tmp/perl-simple.sock -a /simple/app.pl

+ 1 - 1
frameworks/Python/bottle/bottle-nginx-uwsgi.dockerfile

@@ -15,4 +15,4 @@ RUN pip3 install --install-option="--prefix=${PY3_ROOT}" -r /bottle/requirements
 
 RUN sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' /bottle/nginx.conf
 
-CMD nginx -c /bottle/nginx.conf && uwsgi --ini /bottle/uwsgi.ini --processes $((CPU_COUNT*3)) --wsgi app:app
+CMD nginx -c /bottle/nginx.conf && uwsgi --ini /bottle/uwsgi.ini --processes $(($(nproc)*3)) --wsgi app:app

+ 1 - 1
frameworks/Python/flask/flask-nginx-uwsgi.dockerfile

@@ -15,4 +15,4 @@ RUN pip3 install --install-option="--prefix=${PY3_ROOT}" -r /flask/requirements.
 
 RUN sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' /flask/nginx.conf
 
-CMD nginx -c /flask/nginx.conf && uwsgi --ini /flask/uwsgi.ini --processes $((CPU_COUNT*3)) --wsgi app:app
+CMD nginx -c /flask/nginx.conf && uwsgi --ini /flask/uwsgi.ini --processes $(($(nproc)*3)) --wsgi app:app

+ 1 - 1
frameworks/Python/uwsgi/uwsgi-nginx-uwsgi.dockerfile

@@ -15,4 +15,4 @@ RUN pip install --install-option="--prefix=${PY2_ROOT}" -r /uw/requirements.txt
 
 RUN sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' /uw/nginx.conf
 
-CMD nginx -c /uw/nginx.conf && uwsgi --ini uwsgi.ini --processes $CPU_COUNT --gevent 1000 --wsgi hello
+CMD nginx -c /uw/nginx.conf && uwsgi --ini uwsgi.ini --processes $(nproc) --gevent 1000 --wsgi hello

+ 1 - 1
frameworks/Python/uwsgi/uwsgi.dockerfile

@@ -6,4 +6,4 @@ WORKDIR /uw
 
 RUN pip install --install-option="--prefix=${PY2_ROOT}" -r /uw/requirements.txt
 
-CMD uwsgi --master -L -l 5000 --gevent 1000 --http :8080 --http-keepalive --http-processes $CPU_COUNT -p $CPU_COUNT -w hello --add-header "Connection: keep-alive" --pidfile /tmp/uwsgi.pid
+CMD uwsgi --master -L -l 5000 --gevent 1000 --http :8080 --http-keepalive --http-processes $(nproc) -p $(nproc) -w hello --add-header "Connection: keep-alive" --pidfile /tmp/uwsgi.pid

+ 1 - 1
frameworks/Python/weppy/weppy-nginx-uwsgi.dockerfile

@@ -15,4 +15,4 @@ RUN pip install --install-option="--prefix=${PY2_ROOT}" -r /weppy/requirements.t
 
 RUN sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' /weppy/nginx.conf
 
-CMD nginx -c /weppy/nginx.conf && uwsgi --ini /weppy/uwsgi.ini --processes $CPU_COUNT --wsgi app:app
+CMD nginx -c /weppy/nginx.conf && uwsgi --ini /weppy/uwsgi.ini --processes $(nproc) --wsgi app:app

+ 1 - 1
frameworks/Ur/urweb/urweb-mysql.dockerfile

@@ -2,4 +2,4 @@ FROM tfb/urweb-base:latest
 
 RUN urweb -dbms mysql -db "dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass host=TFB-database" bench
 
-CMD ./bench.exe -q -k -t $((2 * ${CPU_COUNT}))
+CMD ./bench.exe -q -k -t $((2 * $(nproc)))

+ 1 - 1
frameworks/Ur/urweb/urweb.dockerfile

@@ -2,4 +2,4 @@ FROM tfb/urweb-base:latest
 
 RUN urweb -db "dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass host=TFB-database" bench
 
-CMD ./bench.exe -q -k -t $((2 * ${CPU_COUNT}))
+CMD ./bench.exe -q -k -t $((2 * $(nproc)))

+ 0 - 2
toolset/run-tests.py

@@ -80,8 +80,6 @@ def main(argv=None):
     os.environ['TFB_DISTRIB_ID'], os.environ[
         'TFB_DISTRIB_RELEASE'], os.environ[
             'TFB_DISTRIB_CODENAME'] = platform.linux_distribution()
-    # App server cpu count
-    os.environ['CPU_COUNT'] = str(multiprocessing.cpu_count())
 
     conf_parser = argparse.ArgumentParser(
         description=__doc__,

+ 0 - 2
toolset/setup/docker/base.dockerfile

@@ -23,10 +23,8 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8 
 ENV DEBIAN_FRONTEND noninteractive
 
-ARG CPU_COUNT
 ARG MAX_CONCURRENCY
 ARG TFB_DATABASE
 
-ENV CPU_COUNT=$CPU_COUNT
 ENV MAX_CONCURRENCY=$MAX_CONCURRENCY
 ENV DBHOST=$TFB_DATABASE

+ 0 - 1
toolset/utils/docker_helper.py

@@ -61,7 +61,6 @@ def build(benchmarker_config, test_names, build_log_dir=os.devnull):
         log_prefix = "%s: " % test.name
 
         docker_buildargs = {
-            'CPU_COUNT': str(multiprocessing.cpu_count()),
             'MAX_CONCURRENCY': str(max(benchmarker_config.concurrency_levels)),
             'TFB_DATABASE': str(benchmarker_config.database_host)
         }