差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 次のリビジョン両方とも次のリビジョン | ||
python:moinmoin [2019/08/19 07:25] – ともやん | python:moinmoin [2019/09/13 10:33] – [ApacheBench してみる] ともやん | ||
---|---|---|---|
行 102: | 行 102: | ||
import fnmatch | import fnmatch | ||
from collections import Counter | from collections import Counter | ||
- | #try: | + | try: |
- | # | + | import virtualenv |
- | #except ImportError: | + | except ImportError: |
- | # | + | sys.exit(""" |
- | #Error: import virtualenv failed, either virtualenv is not installed (see installation docs) | + | Error: import virtualenv failed, either virtualenv is not installed (see installation docs) |
- | #or the virtual environment must be deactivated before rerunning quickinstall.py | + | or the virtual environment must be deactivated before rerunning quickinstall.py |
- | #""" | + | """ |
- | import venv | + | |
if sys.hexversion < 0x3050000: | if sys.hexversion < 0x3050000: | ||
行 462: | 行 461: | ||
if wiki_exists(): | if wiki_exists(): | ||
command = ' | command = ' | ||
- | print(' | + | print(' |
try: | try: | ||
subprocess.call(command, | subprocess.call(command, | ||
行 640: | 行 639: | ||
base, source_name = os.path.split(source) | base, source_name = os.path.split(source) | ||
executable = os.path.basename(sys.executable).split(' | executable = os.path.basename(sys.executable).split(' | ||
- | | + | venv = os.path.join(base, |
- | | + | venv = os.path.abspath(venv) |
- | | + | venv_home, venv_lib, venv_inc, venv_bin = virtualenv.path_locations(venv) |
- | venv_home = os.path.join(base, | + | |
- | venv_home = os.path.abspath(venv_home) | + | |
- | self.builder = venv.EnvBuilder(with_pip=True) | + | |
- | context = self.builder.ensure_directories(venv_home) | + | |
- | venv_home, venv_lib, venv_inc, venv_bin = ( | + | |
- | context.env_dir, | + | |
- | os.path.join(context.env_dir, | + | |
- | context.inc_path, | + | |
- | context.bin_path) | + | |
self.dir_venv = venv_home | self.dir_venv = venv_home | ||
self.dir_venv_bin = venv_bin | self.dir_venv_bin = venv_bin | ||
行 663: | 行 653: | ||
def do_venv(self): | def do_venv(self): | ||
- | | + | virtualenv.create_environment(self.dir_venv) |
- | self.builder.create(self.dir_venv) | + | |
def get_pip_version(self): | def get_pip_version(self): | ||
行 729: | 行 718: | ||
choices.add(name) | choices.add(name) | ||
args = sys.argv[:] | args = sys.argv[:] | ||
- | args[0] = os.path.basename(args[0]) | ||
if len(args) > 2 and args[-1] == ' | if len(args) > 2 and args[-1] == ' | ||
行 815: | 行 803: | ||
83 | 83 | ||
- | 119 Successfully installed Babel-2.7.0 Flask-1.1.1 Flask-Babel-0.12.2 Flask-Caching-1.7.2 Flask-Script-2.0.6 Flask-Theme-0.3.4 Jinja2-2.10.1 Markdown-3.1.1 MarkupSafe-1.1.1 Werkzeug-0.15.5 XStatic-1.0.2 XStatic-AnyWikiDraw-0.14.2 XStatic-Bootstrap-3.1.1.2 XStatic-CKEditor-3.6.4.0 XStatic-Font-Awesome-4.7.0.0 XStatic-JQuery.TableSorter-2.14.5.1 XStatic-Pygments-2.2.0.1 XStatic-TWikiDraw-moin-2004.10.23.2 XStatic-autosize-1.17.2.1 XStatic-jQuery-3.3.1.1 XStatic-jQuery-File-Upload-4.4.2 XStatic-svg-edit-moin-2012.11.27.1 blinker-1.4 chardet-3.0.4 click-7.0 docutils-0.15.2 emeraldtree-0.10.0 flatland-0.9.1 itsdangerous-1.1.0 moin passlib-1.7.1 pdfminer3-2018.12.3.0 pycryptodome-3.8.2 pygments-2.4.2 pytz-2019.2 setuptools-41.0.1 six-1.12.0 sortedcontainers-2.1.0 whoosh-2.7.4 | + | 119 Successfully installed Babel-2.7.0 Flask-1.1.1 Flask-Babel-0.12.2 Flask-Caching-1.7.2 Flask-Script-2.0.6 Flask-Theme-0.3.4 Jinja2-2.10.1 Markdown-3.1.1 MarkupSafe-1.1.1 Werkzeug-0.15.6 XStatic-1.0.2 XStatic-AnyWikiDraw-0.14.2 XStatic-Bootstrap-3.1.1.2 XStatic-CKEditor-3.6.4.0 XStatic-Font-Awesome-4.7.0.0 XStatic-JQuery.TableSorter-2.14.5.1 XStatic-Pygments-2.2.0.1 XStatic-TWikiDraw-moin-2004.10.23.2 XStatic-autosize-1.17.2.1 XStatic-jQuery-3.3.1.1 XStatic-jQuery-File-Upload-4.4.2 XStatic-svg-edit-moin-2012.11.27.1 blinker-1.4 chardet-3.0.4 click-7.0 docutils-0.15.2 emeraldtree-0.10.0 flatland-0.9.1 itsdangerous-1.1.0 moin passlib-1.7.1 pdfminer3-2018.12.3.0 pycryptodome-3.9.0 pygments-2.4.2 pytz-2019.2 setuptools-41.2.0 six-1.12.0 sortedcontainers-2.1.0 whoosh-2.7.4 |
- | 131 Successfully created or updated venv at c: | + | 131 Successfully created or updated venv at C: |
- | + | ||
- | > > > Type " | + | |
</ | </ | ||
</ | </ | ||
行 915: | 行 901: | ||
[[http:// | [[http:// | ||
{{: | {{: | ||
+ | |||
+ | ===== ApacheBench してみる ===== | ||
+ | ローカル簡易実行での ApacheBench の結果。\\ | ||
+ | <WRAP prewrap 100% #result> | ||
+ | < | ||
+ | > ab -n 1000 -c 100 http:// | ||
+ | This is ApacheBench, | ||
+ | Copyright 1996 Adam Twiss, Zeus Technology Ltd, http:// | ||
+ | Licensed to The Apache Software Foundation, http:// | ||
+ | |||
+ | Benchmarking localhost (be patient) | ||
+ | Completed 100 requests | ||
+ | Completed 200 requests | ||
+ | Completed 300 requests | ||
+ | Completed 400 requests | ||
+ | Completed 500 requests | ||
+ | Completed 600 requests | ||
+ | Completed 700 requests | ||
+ | Completed 800 requests | ||
+ | Completed 900 requests | ||
+ | Completed 1000 requests | ||
+ | Finished 1000 requests | ||
+ | |||
+ | |||
+ | Server Software: | ||
+ | Server Hostname: | ||
+ | Server Port: 8080 | ||
+ | |||
+ | Document Path: /Home | ||
+ | Document Length: | ||
+ | |||
+ | Concurrency Level: | ||
+ | Time taken for tests: | ||
+ | Complete requests: | ||
+ | Failed requests: | ||
+ | | ||
+ | Total transferred: | ||
+ | HTML transferred: | ||
+ | Requests per second: | ||
+ | Time per request: | ||
+ | Time per request: | ||
+ | Transfer rate: 48.51 [Kbytes/ | ||
+ | |||
+ | Connection Times (ms) | ||
+ | min mean[+/-sd] median | ||
+ | Connect: | ||
+ | Processing: | ||
+ | Waiting: | ||
+ | Total: | ||
+ | |||
+ | Percentage of the requests served within a certain time (ms) | ||
+ | 50% 35389 | ||
+ | 66% 37042 | ||
+ | 75% 37648 | ||
+ | 80% 38042 | ||
+ | 90% 38871 | ||
+ | 95% 39403 | ||
+ | 98% 39964 | ||
+ | 99% 40189 | ||
+ | | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== 参考文献 ===== | ||
+ | [[https:// | ||