{"id":13440463,"url":"https://github.com/centminmod/centminmodbench","last_synced_at":"2025-03-23T02:32:36.017Z","repository":{"id":20508920,"uuid":"23787528","full_name":"centminmod/centminmodbench","owner":"centminmod","description":"For CentOS/Redhat/Oracle Linux - centminmodbench.sh custom system benchmark script for Centmin Mod LEMP web stack users","archived":false,"fork":false,"pushed_at":"2022-01-03T00:50:06.000Z","size":10205,"stargazers_count":26,"open_issues_count":0,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-12T02:46:06.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://community.centminmod.com/threads/centminmodbench-sh-benchmark-script-for-centmin-mod-lemp-servers.1298/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/centminmod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-08T10:55:46.000Z","updated_at":"2023-12-14T14:12:52.000Z","dependencies_parsed_at":"2022-09-09T12:01:46.238Z","dependency_job_id":null,"html_url":"https://github.com/centminmod/centminmodbench","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmodbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmodbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmodbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmodbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centminmod","download_url":"https://codeload.github.com/centminmod/centminmodbench/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221842685,"owners_count":16890178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:22.981Z","updated_at":"2024-10-28T14:46:06.493Z","avatar_url":"https://github.com/centminmod.png","language":"Shell","funding_links":[],"categories":["Shell","Linux/VPS Benchmarking"],"sub_categories":["Utils"],"readme":"centminmodbench.sh\n===============\ncentminmodbench.sh Github short url link: http://bench.centminmod.com\n\nCustom system benchmark script for Centmin Mod LEMP web stack users. \n\nDevelopment is ongoing so please test only on test servers and not production live servers.\n\n*Current Test Suite*\n\n* disk dd, ioping, fio\n* ping, mtr \n* memory bandwidth testing tmpfs ramdisk with disk dd and ioping\n* single threaded wget bandwidth benchmarks\n* parallel multi threaded axel bandwidth benchmarks [Centmin Mod stack only]\n* OpenSSL system benchmark \n* test system entropy_avail (entropy pool availability - closer to 4096 bits = better randomness and SSL related performance vs closer to 0 kernel block at generating random data = poorer SSL performance) [mentioned](https://community.centminmod.com/threads/centmin-mod-nginx-vhost-spdy-ssl-generator-testing.990/)\n* rngtest suite - check the randomness of data (currently disabled by default / not yet developed)\n* Nginx static OpenSSL benchmarks  [Centmin Mod stack only]\n* mysqlslap http://dev.mysql.com/doc/refman/5.6/en/mysqlslap.html\n* PHP (php-fpm) Zend/bench.php \u0026 Zend/micro_bench.php [Centmin Mod stack only]\n* UnixBench 5.1.3 (currently disabled by default)\n* ServerBear.com tests (currently disabled by default / not yet developed)\n* compression/decompression tests (not yet developed)\n\nTo run type in SSH window as root user:\n\n    curl -sL https://github.com/centminmod/centminmodbench/raw/master/centminmodbench.sh | bash\n\nIf you want to download to server and run in SSH window as root user:\n\n    mkdir -p /root/tools\n    cd /root/tools\n    yum -y install wget\n    wget -O centminmodbench.sh https://github.com/centminmod/centminmodbench/raw/master/centminmodbench.sh\n    chmod +x centminmodbench.sh\n\nIf you want to enable UnixBench\n\n    sed -i \"s|RUN_UNIXBENCH=.*|RUN_UNIXBENCH='y'|\" /root/tools/centminmodbench.sh\n\nTo run script locally in SSH window as root user type:\n\n    /root/tools/centminmodbench.sh\n\nIf you don't want SSH session's connection drop out to abort your benchmark run you can run the script via screen window by installing screen via YUM and then launch centminmodbench.sh via screen\n\n    yum -y install screen\n    screen -dmS bench \n    screen -r bench\n    /root/tools/centminmodbench.sh\n\nIf your SSH session drops out, the script is still running via the screen session called bench. You can use this command to view available sessions:\n\n     screen -ls\n\nSample output\n\n    There is a screen on:\n            2136.bench      (Detached)\n    1 Socket in /var/run/screen/S-root.\n\nTo reattach the session named bench to continue with the benchmark or find the completed benchmark output, type:\n\n    screen -r bench\n\nTo update script\n\n    wget -O /root/tools/centminmodbench.sh https://github.com/centminmod/centminmodbench/raw/master/centminmodbench.sh\n\nTo remove centminmodbench.sh and log files\n\n    /root/tools/centminmodbench.sh cleanup\n\nOr manually remove the following directories and file\n\n    /home/centminmodbench\n    /home/centminmodbench_logs\n    /home/mysqlslap\n    /home/phpbench_logs\n    /root/tools/centminmodbench.sh\n\nDefault log directories include:\n\n* BENCHDIR='/home/centminmodbench' (source downloads location)\n* LOGDIR='/home/centminmodbench_logs' (benchmark results logs)\n* MYSQLSLAP_DIR='/home/mysqlslap' (mysqlslap results logs)\n* PHPBENCHLOGDIR='/home/phpbench_logs' (PHP-FPM benchmark logs)\n\nVariables you can alter within centminmodbench.sh. Note the bandwidth tests can be set regionally as well, so if you have no need for Asia tests, you can turn the Asian specific bandwidth tests off etc. UnixBench is turned off by default during testing of this script as it adds up to 30-60 minutes to test runs as seen at https://community.centminmod.com/threads/centminmodbench-sh-benchmark-script-for-centmin-mod-lemp-servers.1298/#post-5880.\n\n    SEVERBEAR='n'\n    OPENSSLBENCH='y'\n    OPENSSL_NONSYSTEM='y'\n    RUN_DISKDD='y'\n    RUN_DISKIOPING='y'\n    RUN_DISKFIO='y'\n    RUN_AXELBENCH='y'\n    RUN_BANDWIDTHBENCH='y'\n    RUN_VULTRTESTS='y'\n    EUROPE_BANDWIDTHTESTS='y'\n    ASIA_BANDWIDTHTESTS='y'\n    AUSTRALIA_BANDWIDTHTESTS='y'\n    USA_BANDWIDTHTESTS='y'\n    RUN_PINGTESTS='y'\n    RUN_MYSQLSLAP='y'\n    RUN_PHPTESTS='y'\n    RUN_UNIXBENCH='n'\n    RUN_MTRTESTS='y'\n    MTR_PACKETS='10'\n    UNIXBENCH_VER='5.1.3'\n\nCentmin Mod Install + Benchmark Extended\n===============\n\nIf you want to automate both Centmin Mod installation + centminmodbench.sh run + extended Nginx HTTP/2 HTTPS RSA 2048 bit + ECDSA 256bit SSL certificated based [h2load](https://nghttp2.org/documentation/h2load-howto.html) tests, zcat/pzcat log processing tests and redis benchmark tests, you can use the below commands. The Nginx HTTP/2 HTTPS h2load tests will test 4 sets of SSL Ciphers for `ECDHE-RSA-AES128-GCM-SHA256`, `ECDHE-RSA-AES256-GCM-SHA384`, `ECDHE-ECDSA-AES128-GCM-SHA256` and `ECDHE-ECDSA-AES256-GCM-SHA384`. This test may take over 60-120 minutes to complete depending on your server hardware specs i.e. number of cpu cores, cpu clock speed, memory bandwidth speed, disk I/O performance and network connectivity speed etc. As such test should be run in screen session so it survives SSH session disconnection. All of the scripts output and benchmark results will be logged into a file at `/root/centminlogs/centminmod-benchmark-all-${DT}.log` where `${DT}` is date timestamp.\n\n    mkdir -p /root/tools\n    cd /root/tools\n    yum -y install wget\n    wget -O installnbench2.sh https://github.com/centminmod/centminmodbench/raw/master/installnbench2.sh\n    chmod +x installnbench2.sh\n    yum -y install screen\n    screen -dmS installnbench\n    screen -r installnbench\n    time /root/tools/installnbench2.sh\n\nIf your SSH session drops out, the script is still running via the screen session called bench. You can use this command to view available sessions:\n\n     screen -ls\n\nSample output\n\n    There is a screen on:\n            2136.installnbench      (Detached)\n    1 Socket in /var/run/screen/S-root.\n\nTo reattach the session named bench to continue with the benchmark or find the completed benchmark output, type:\n\n    screen -r installnbench\n\nTo update script\n\n    wget -O /root/tools/installnbench2.sh https://github.com/centminmod/centminmodbench/raw/master/installnbench2.sh\n\nBenchmark Extended Only\n===============\n\nIf you want to automate on existing Centmin Mod installs both centminmodbench.sh run + extended Nginx HTTP/2 HTTPS RSA 2048 bit + ECDSA 256bit SSL certificated based [h2load](https://nghttp2.org/documentation/h2load-howto.html) tests, zcat/pzcat log processing tests and redis benchmark tests, you can use the below commands. The Nginx HTTP/2 HTTPS h2load tests will test 4 sets of SSL Ciphers for `ECDHE-RSA-AES128-GCM-SHA256`, `ECDHE-RSA-AES256-GCM-SHA384`, `ECDHE-ECDSA-AES128-GCM-SHA256` and `ECDHE-ECDSA-AES256-GCM-SHA384`. This test may take over 60-120 minutes to complete depending on your server hardware specs i.e. number of cpu cores, cpu clock speed, memory bandwidth speed, disk I/O performance and network connectivity speed etc. As such test should be run in screen session so it survives SSH session disconnection. All of the scripts output and benchmark results will be logged into a file at `/root/centminlogs/centminmod-fullbench-all-${DT}.log` where `${DT}` is date timestamp.\n\n    mkdir -p /root/tools\n    yum -y install wget\n    cd /root/tools\n    wget -O fullbench.sh https://github.com/centminmod/centminmodbench/raw/master/fullbench.sh\n    chmod +x fullbench.sh\n    yum -y install screen\n    screen -dmS fullbench\n    screen -r fullbench\n    time /root/tools/fullbench.sh\n\nIf your SSH session drops out, the script is still running via the screen session called bench. You can use this command to view available sessions:\n\n     screen -ls\n\nSample output\n\n    There is a screen on:\n            2136.fullbench      (Detached)\n    1 Socket in /var/run/screen/S-root.\n\nTo reattach the session named bench to continue with the benchmark or find the completed benchmark output, type:\n\n    screen -r fullbench\n\nTo update script\n\n    wget -O /root/tools/fullbench.sh https://github.com/centminmod/centminmodbench/raw/master/fullbench.sh\n\nNginx HTTP/2 HTTPS h2load Benchmarks\n===============\n\n* If you want to run on existing Centmin Mod Nginx installs an extended Nginx HTTP/2 HTTPS RSA 2048 bit + ECDSA 256bit SSL certificated based [h2load](https://nghttp2.org/documentation/h2load-howto.html) tests, you can use the below commands.\n* h2load HTTP/2 HTTPS load test tool will be run single threaded so tests only 1 cpu core of the system.\n* https_bench.sh will create a dummy Nginx HTTP/2 HTTPS vhost called http2.domain.com and setup both self-signed RSA 2048bit and ECDSA 256bit SSL certificates on the dummy Nginx vhost to run h2load HTTP/2 HTTPS load tests against. After https_bench.sh completes, it will automatically remove the http2.domain.com dummy Nginx vhost site and all SSL certificates.\n* The Nginx HTTP/2 HTTPS h2load tests will test 4 sets of SSL Ciphers for `ECDHE-RSA-AES128-GCM-SHA256`, `ECDHE-RSA-AES256-GCM-SHA384`, `ECDHE-ECDSA-AES128-GCM-SHA256` and `ECDHE-ECDSA-AES256-GCM-SHA384`. \n* This test will test gzip (and brotli if Nginx support is detected) HTTP compression load tests using h2load HTTP/2 HTTPS tester tool. \n* These test should be run in screen session so it survives SSH session disconnection. \n* All of the scripts output and benchmark results will be logged into a file at `/root/centminlogs/h2load-nginx-https-${DT}.log` where `${DT}` is date timestamp.\n\n### h2load HTTP/2 HTTPS load test configurations\n\nThere's 8x h2load test configurations in total:\n\n* h2load --ciphers=ECDHE-RSA-AES128-GCM-SHA256 -H 'Accept-Encoding: gzip' -c100 -n1000 https://http2.domain.com\n* h2load --ciphers=ECDHE-RSA-AES256-GCM-SHA384 -H 'Accept-Encoding: gzip' -c100 -n1000 https://http2.domain.com\n* h2load --ciphers=ECDHE-ECDSA-AES128-GCM-SHA256 -H 'Accept-Encoding: gzip' -c100 -n1000 https://http2.domain.com\n* h2load --ciphers=ECDHE-ECDSA-AES256-GCM-SHA384 -H 'Accept-Encoding: gzip' -c100 -n1000 https://http2.domain.com\n* h2load --ciphers=ECDHE-RSA-AES128-GCM-SHA256 -H 'Accept-Encoding: gzip' -c300 -n6000 https://http2.domain.com\n* h2load --ciphers=ECDHE-RSA-AES256-GCM-SHA384 -H 'Accept-Encoding: gzip' -c300 -n6000 https://http2.domain.com\n* h2load --ciphers=ECDHE-ECDSA-AES128-GCM-SHA256 -H 'Accept-Encoding: gzip' -c300 -n6000 https://http2.domain.com\n* h2load --ciphers=ECDHE-ECDSA-AES256-GCM-SHA384 -H 'Accept-Encoding: gzip' -c300 -n6000 https://http2.domain.com\n\n#### Install Commands\n\nNote: if you already have a Nginx vhost called `http2.domain.com`, you can edit `/root/tools/https_bench.sh` script's variable `vhostname=http2.domain.com` changing it before running `https_bench.sh`.\n\n    mkdir -p /root/tools\n    cd /root/tools\n    yum -y install wget\n    wget -O https_bench.sh https://github.com/centminmod/centminmodbench/raw/master/https_bench.sh\n    chmod +x https_bench.sh\n    yum -y install screen\n    screen -dmS httpsbench\n    screen -r httpsbench\n    time /root/tools/https_bench.sh\n\nIf your SSH session drops out, the script is still running via the screen session called bench. You can use this command to view available sessions:\n\n     screen -ls\n\nSample output\n\n    There is a screen on:\n            2136.httpsbench      (Detached)\n    1 Socket in /var/run/screen/S-root.\n\nTo reattach the session named bench to continue with the benchmark or find the completed benchmark output, type:\n\n    screen -r httpsbench\n\nTo update script\n\n    wget -O /root/tools/https_bench.sh https://github.com/centminmod/centminmodbench/raw/master/https_bench.sh\n\n#### Disable Auto Removal Of http2.domain.com\n\n`https_bench.sh` script by default auto removes the test HTTP/2 HTTPS site `http2.domain.com` at end of script run. But if you want to do further manual tests on that site you can disable the auto removal routine. \n\nTo disable auto removal routine, edit `/root/tools/https_bench.sh` variable `HTTPS_BENCHCLEANUP='y'` change it to `HTTPS_BENCHCLEANUP='n'` by overriding it in a separately created file persistent config file at `/root/tools/https_bench.ini`\n\n    echo \"HTTPS_BENCHCLEANUP='n'\" \u003e /root/tools/https_bench.ini\n\nSetting `HTTPS_BENCHCLEANUP='n'` will disable auto removal of test `http2.domain.com` nginx vhost site leaving it available after `https_bench.sh` run for manual testing\nthen run it `https_bench.sh` once to create test `http2.domain.com` site. Note `http2.domain.com` is setup with self-signed untrusted SSL certificates.\n\nIf you also want to disable sar stats logging\n\n    echo \"SARSTATS='n'\" \u003e\u003e /root/tools/https_bench.ini\n\n#### Example Nginx HTTP/2 HTTPS h2load benchmarks\n\nIntel Core i7 4790K CentOS 7.5 64bit with Centmin Mod Nginx 1.13.12 compiled with GCC 8.1.0 Compiler\n\n`ECDHE-RSA-AES128-GCM-SHA256` and `ECDHE-RSA-AES256-GCM-SHA384` ssl cipher tests\n\n```\nh2load --ciphers=ECDHE-RSA-AES128-GCM-SHA256 -H 'Accept-Encoding: gzip' -c300 -n6000 https://http2.domain.com\nTLS Protocol: TLSv1.2\nCipher: ECDHE-RSA-AES128-GCM-SHA256\nServer Temp Key: ECDH P-256 256 bits\nApplication protocol: h2\n\nfinished in 360.06ms, 16664.12 req/s, 38.56MB/s\nrequests: 6000 total, 6000 started, 6000 done, 6000 succeeded, 0 failed, 0 errored, 0 timeout\nstatus codes: 6000 2xx, 0 3xx, 0 4xx, 0 5xx\ntraffic: 13.88MB (14558700) total, 1.79MB (1878000) headers (space savings 15.41%), 11.98MB (12558000) data\n                     min         max         mean         sd        +/- sd\ntime for request:      768us     51.35ms      8.34ms      4.70ms    86.87%\ntime for connect:   101.90ms    180.62ms    146.54ms     14.58ms    80.67%\ntime to 1st byte:   142.49ms    187.30ms    161.65ms      9.33ms    58.67%\nreq/s           :      55.80       75.02       64.10        4.57    64.67%\n-------------------------------------------------------------------------------------------\n\nh2load --ciphers=ECDHE-RSA-AES256-GCM-SHA384 -H 'Accept-Encoding: gzip' -c300 -n6000 https://http2.domain.com\nTLS Protocol: TLSv1.2\nCipher: ECDHE-RSA-AES256-GCM-SHA384\nServer Temp Key: ECDH P-256 256 bits\nApplication protocol: h2\n\nfinished in 361.96ms, 16576.65 req/s, 38.34MB/s\nrequests: 6000 total, 6000 started, 6000 done, 6000 succeeded, 0 failed, 0 errored, 0 timeout\nstatus codes: 6000 2xx, 0 3xx, 0 4xx, 0 5xx\ntraffic: 13.88MB (14552700) total, 1.79MB (1872000) headers (space savings 15.68%), 11.98MB (12558000) data\n                     min         max         mean         sd        +/- sd\ntime for request:      335us     48.39ms      9.21ms      4.48ms    83.15%\ntime for connect:    94.94ms    184.70ms    148.47ms     14.47ms    81.67%\ntime to 1st byte:   143.36ms    195.41ms    166.62ms     10.77ms    55.33%\nreq/s           :      55.65       68.78       60.21        2.68    74.00%\n```\n\n`ECDHE-ECDSA-AES128-GCM-SHA256` and `ECDHE-ECDSA-AES256-GCM-SHA384` ssl ciphers tests\n\n```\nh2load --ciphers=ECDHE-ECDSA-AES128-GCM-SHA256 -H 'Accept-Encoding: gzip' -c300 -n6000 https://http2.domain.com\nTLS Protocol: TLSv1.2\nCipher: ECDHE-ECDSA-AES128-GCM-SHA256\nServer Temp Key: ECDH P-256 256 bits\nApplication protocol: h2\n\nfinished in 374.88ms, 16005.08 req/s, 37.04MB/s\nrequests: 6000 total, 6000 started, 6000 done, 6000 succeeded, 0 failed, 0 errored, 0 timeout\nstatus codes: 6000 2xx, 0 3xx, 0 4xx, 0 5xx\ntraffic: 13.88MB (14558700) total, 1.79MB (1878000) headers (space savings 15.41%), 11.98MB (12558000) data\n                     min         max         mean         sd        +/- sd\ntime for request:     1.32ms     61.08ms      9.21ms      9.02ms    96.58%\ntime for connect:   101.72ms    173.85ms    139.61ms     27.55ms    48.00%\ntime to 1st byte:   162.83ms    185.36ms    176.00ms      7.35ms    68.00%\nreq/s           :      53.90       75.51       62.17        5.27    68.67%\n-------------------------------------------------------------------------------------------\n\nh2load --ciphers=ECDHE-ECDSA-AES256-GCM-SHA384 -H 'Accept-Encoding: gzip' -c300 -n6000 https://http2.domain.com\nTLS Protocol: TLSv1.2\nCipher: ECDHE-ECDSA-AES256-GCM-SHA384\nServer Temp Key: ECDH P-256 256 bits\nApplication protocol: h2\n\nfinished in 368.49ms, 16282.84 req/s, 37.68MB/s\nrequests: 6000 total, 6000 started, 6000 done, 6000 succeeded, 0 failed, 0 errored, 0 timeout\nstatus codes: 6000 2xx, 0 3xx, 0 4xx, 0 5xx\ntraffic: 13.88MB (14558700) total, 1.79MB (1878000) headers (space savings 15.41%), 11.98MB (12558000) data\n                     min         max         mean         sd        +/- sd\ntime for request:      514us     66.87ms      9.40ms     10.47ms    96.15%\ntime for connect:    94.87ms    173.58ms    136.49ms     30.58ms    51.33%\ntime to 1st byte:   161.75ms    184.13ms    176.00ms      7.00ms    71.67%\nreq/s           :      55.38       71.86       61.91        4.31    58.67%\n```\n\nGoogle Spreadsheet Template\n===============\n\nTo tabulate your own results, I created a Google Spreadsheet template you can download and customise for your own usage. It's currently prefilled with columns for 3 clouding hosting providers, DigitalOcean, Linode and Vultr.\n\nhttps://docs.google.com/spreadsheets/d/1DnL5hzG4MrfDj10T5fiLLxnw0YKbbFrTVACy5xtW_H4/edit?usp=sharing\n\nDigitalOcean vs Linode vs Vultr Benchmarks\n===============\nUsing centminmodbench.sh, I tested 48GB RAM, 16 CPU core VPS servers for DigitalOcean, Linode and Vultr and posted results at https://community.centminmod.com/threads/digitalocean-vs-linode-vs-vultr-48gb-16-cpus-centminmodbench-sh-results.1389/\n\nDedicated Server Benchmarks\n===============\nSome sample centminmodbench.sh results from dedicated servers at https://community.centminmod.com/threads/centminmodbench-sh-for-dedicated-servers.1394/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fcentminmodbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentminmod%2Fcentminmodbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fcentminmodbench/lists"}