Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Add CPU_COUNT env variable / get MAX_THREADS for load_gen#2586

Merged
NateBrady23 merged 8 commits into
TechEmpower:masterfrom
NateBrady23:wrk
Apr 14, 2017
Merged

Add CPU_COUNT env variable / get MAX_THREADS for load_gen#2586
NateBrady23 merged 8 commits into
TechEmpower:masterfrom
NateBrady23:wrk

Conversation

@NateBrady23

@NateBrady23 NateBrady23 commented Mar 8, 2017

Copy link
Copy Markdown
Member

Removes the command line options for threads, concurrency_levels, and query_levels. The latter two remain in the benchmark.cfg file.

Note

WIP: Moving away from making a max_threads env variable available and instead will make a cpu_count variable available to frameworks. Will continue to use cpu_count*4 for the -t option of the wrk commands.

Comment thread toolset/run-tests.py Outdated
defaults['threads'] = 8
try:
maxThreads = multiprocessing.cpu_count()
defaults['threads'] = multiprocessing.cpu_count() * 2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this count the number of cpus on the application server and not the load server (where it is used)?

@NateBrady23

Copy link
Copy Markdown
Member Author

@msmith-techempower please review changes. works for me on vagrant with 2 virtual cores:

 Concurrency: 256 for gemini
 wrk -H 'Host: localhost' -H 'Accept: text/plain,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' -H 'Connection: keep-alive' --latency -d 60 -c 256 --timeout 8 -t 8 http://TFB-server:8080/plaintext -s ~/pipeline.lua -- 16

@NateBrady23 NateBrady23 changed the title Get threads programmatically Add CPU_COUNT env variable / get MAX_THREADS for load_gen Apr 13, 2017
Comment thread frameworks/C++/cutelyst/config.sh Outdated
uwsgi --ini ${IROOT}/config.ini --cutelyst-app ${IROOT}/cutelyst-benchmarks/src/libcutelyst_benchmarks.so ${PROCESS_OR_THREAD} $CPU_COUNT &
else
${CROOT}/bin/cutelyst-wsgi --ini ${CROOT}/config.ini -a ${CROOT}/benchmarks/src/libcutelyst_benchmarks.so ${PROCESS_OR_THREAD} $MAX_THREADS --socket-timeout 0 ${BALANCER} &
${IROOT}/bin/cutelyst-wsgi --ini ${IROOT}/config.ini -a ${IROOT}/cutelyst-benchmarks/src/libcutelyst_benchmarks.so ${PROCESS_OR_THREAD} $CPU_COUNT --socket-timeout 0 &

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This undid some other recent changes in the cutelyst config. I suggest starting over with a copy of this file from master, then doing a search and replace for MAX_THREADS with CPU_COUNT.

Comment thread frameworks/C++/wt/setup.sh Outdated
g++-4.8 -O3 -DNDEBUG -std=c++0x -L${BOOST_LIB} -I${BOOST_INC} -L${WT_LIB} -I${WT_INC} -o benchmark.wt benchmark.cpp -lwt -lwthttp -lwtdbo -lwtdbomysql -lboost_thread -lboost_system

./benchmark.wt -c wt_config.xml -t ${MAX_THREADS} --docroot . --http-address 0.0.0.0 --http-port 8080 --accesslog=- --no-compression
./benchmark.wt -c wt_config.xml -t ${CPU_COUNT} --docroot . --http-address 0.0.0.0 --http-port 8080 --accesslog=- --no-compression &

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove the trailing & again? I removed it intentionally here NateBrady23@84d97ea

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry about that. When I was fixing conflicts I missed that in the diff.

Comment thread frameworks/C++/wt/setup_postgres.sh Outdated
g++-4.8 -O3 -DNDEBUG -DBENCHMARK_USE_POSTGRES -std=c++0x -L${BOOST_LIB} -I${BOOST_INC} -L${WT_LIB} -I${WT_INC} -o benchmark_postgres.wt benchmark.cpp -lwt -lwthttp -lwtdbo -lwtdbopostgres -lboost_thread -lboost_system

./benchmark_postgres.wt -c wt_config.xml -t ${MAX_THREADS} --docroot . --http-address 0.0.0.0 --http-port 8080 --accesslog=- --no-compression
./benchmark_postgres.wt -c wt_config.xml -t ${CPU_COUNT} --docroot . --http-address 0.0.0.0 --http-port 8080 --accesslog=- --no-compression &

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto for this &

Comment thread toolset/run-tests.py

# Benchmark options
parser.add_argument('--concurrency-levels', default=[8, 16, 32, 64, 128, 256], help='Runs wrk benchmarker with different concurrency value (type int-sequence)', action=StoreSeqAction)
parser.add_argument('--query-levels', default=[1, 5,10,15,20], help='Database queries requested per HTTP connection, used during query test (type int-sequence)', action=StoreSeqAction)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this, concurrency_levels and query_levels will no longer be configurable, right? If so, how about removing those lines from benchmark.cfg.example?

@michaelhixson

Copy link
Copy Markdown
Contributor

frameworks/Dart/dart-raw/setup.sh uses MAX_THREADS and I don't see it here. Is it possible others were missed?

@NateBrady23

Copy link
Copy Markdown
Member Author

@michaelhixson Ok, I believe I've addressed everything. There might be another framework out there but I think I got them all. Some are defining there own MAX_THREADS variable so i couldn't just replace all. Didn't want those to lose their meaning.

@michaelhixson

Copy link
Copy Markdown
Contributor

LGTM then

@NateBrady23

Copy link
Copy Markdown
Member Author

@michaelhixson fyi, the concurrency and query levels need to stay in the cfg. I had forgotten that @msmith-techempower had wanted to just remove some extra noise from the cli args.

@NateBrady23
NateBrady23 merged commit c621b41 into TechEmpower:master Apr 14, 2017
@NateBrady23
NateBrady23 deleted the wrk branch May 23, 2017 20:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants