python:moinmoin

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
python:moinmoin [2019/08/13 00:24] – [空の Wiki を作成] ともやんpython:moinmoin [2021/05/31 13:48] ともやん
行 1: 行 1:
-<ifauth !@loggedinusers><html> 
-<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> 
-<script> 
-     (adsbygoogle = window.adsbygoogle || []).push({ 
-          google_ad_client: "ca-pub-0791334967460971", 
-          enable_page_level_ads: true 
-     }); 
-</script></html></ifauth> 
-<html> 
-  <style> 
-    #result pre { 
-      height: 200px; 
-      overflow: scroll; 
-      overflow-x: hidden; 
-    } 
-  </style> 
-</html> 
 ====== MoinMoin ====== ====== MoinMoin ======
-{{:python:moinmoin_logo.png?100|MoinMoin Logo}}\\+{{python:moinmoin_logo.png?100|MoinMoin Logo}}\\
 \\ \\
 本家: [[https://moinmo.in/|MoinMoinWiki - MoinMoin]]\\ 本家: [[https://moinmo.in/|MoinMoinWiki - MoinMoin]]\\
行 33: 行 16:
 [[https://github.com/moinwiki/moin|GitHub - moinwiki/moin: MoinMoin Wiki Development (2.0+)]] より、ソースコードをダウンロードする。\\ [[https://github.com/moinwiki/moin|GitHub - moinwiki/moin: MoinMoin Wiki Development (2.0+)]] より、ソースコードをダウンロードする。\\
 <code> <code>
-git clone https://github.com/moinwiki/moin.git+git clone --depth 1 https://github.com/moinwiki/moin.git
 </code> </code>
  
 ==== quickinstall.py を venv を利用するようにハックする ==== ==== quickinstall.py を venv を利用するようにハックする ====
 GitHub からダウンロードした **quickinstall.py** をリネームする。\\ GitHub からダウンロードした **quickinstall.py** をリネームする。\\
 +
 **Linux**\\ **Linux**\\
 +<WRAP prewrap 100%>
 <code> <code>
 $ cd moin $ cd moin
 $ mv quickinstall.py quickinstall.py.org $ mv quickinstall.py quickinstall.py.org
 </code> </code>
 +</WRAP>
 +
 **Windows**\\ **Windows**\\
 +<WRAP prewrap 100%>
 <code> <code>
 > cd moin > cd moin
 > ren quickinstall.py quickinstall.py.org > ren quickinstall.py quickinstall.py.org
 </code> </code>
 +</WRAP>
 +
 以下の **quickinstall.py** を **moin** ディレクトリにダウンロードする。(**quickinstall.py** を差し替える)\\ 以下の **quickinstall.py** を **moin** ディレクトリにダウンロードする。(**quickinstall.py** を差し替える)\\
 +<WRAP prewrap 100%>
 <code> <code>
 $ curl -O https://www.tomoyan.net/_media/python/quickinstall.py $ curl -O https://www.tomoyan.net/_media/python/quickinstall.py
 $ chmod 775 quickinstall.py $ chmod 775 quickinstall.py
 </code> </code>
-<WRAP prewrap 100% #result>+</WRAP> 
 +<WRAP prewrap 100% #mincode_long>
 <file python moin/quickinstall.py> <file python moin/quickinstall.py>
 #!/usr/bin/python #!/usr/bin/python
行 110: 行 102:
 import fnmatch import fnmatch
 from collections import Counter from collections import Counter
-#try: +try: 
-   import virtualenv +    import virtualenv 
-#except ImportError: +except ImportError: 
-   sys.exit(""" +    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:
行 470: 行 461:
         if wiki_exists():         if wiki_exists():
             command = '{0}moin index-create -i{1} moin index-build'.format(ACTIVATE, SEP)             command = '{0}moin index-create -i{1} moin index-build'.format(ACTIVATE, SEP)
-            print('Rebuilding indexes...(ignore log messages from rst parser)...')+            print('Rebuilding indexes...')
             try:             try:
                 subprocess.call(command, shell=True)                 subprocess.call(command, shell=True)
行 648: 行 639:
         base, source_name = os.path.split(source)         base, source_name = os.path.split(source)
         executable = os.path.basename(sys.executable).split('.exe')[0]         executable = os.path.basename(sys.executable).split('.exe')[0]
-        #venv = os.path.join(base, '{0}-venv-{1}'.format(source_name, executable)) +        venv = os.path.join(base, '{0}-venv-{1}'.format(source_name, executable)) 
-        #venv = os.path.abspath(venv) +        venv = os.path.abspath(venv) 
-        #venv_home, venv_lib, venv_inc, venv_bin = virtualenv.path_locations(venv+        venv_home, venv_lib, venv_inc, venv_bin = virtualenv.path_locations(venv)
-        venv_home = os.path.join(base, '{0}-venv-{1}'.format(source_name, executable)) +
-        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, 'Lib') if sys.platform == 'win32' else os.path.join(context.env_dir, 'lib'), +
-            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
行 671: 行 653:
  
     def do_venv(self):     def do_venv(self):
-        #virtualenv.create_environment(self.dir_venv) +        virtualenv.create_environment(self.dir_venv)
-        self.builder.create(self.dir_venv)+
  
     def get_pip_version(self):     def get_pip_version(self):
行 737: 行 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] == '--help':     if len(args) > 2 and args[-1] == '--help':
行 823: 行 803:
  
 83       Successfully uninstalled setuptools-40.8.0 83       Successfully uninstalled setuptools-40.8.0
-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.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.pygments-2.4.2 pytz-2019.2 setuptools-41.0.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.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.pygments-2.4.2 pytz-2019.2 setuptools-41.2.six-1.12.0 sortedcontainers-2.1.0 whoosh-2.7.4 
-131 Successfully created or updated venv at c:\My_Projects\moin-venv-python +131 Successfully created or updated venv at C:\My_Projects\moin-venv-python
- +
-> > > Type "m" for menu < < <+
 </code> </code>
 </WRAP> </WRAP>
行 923: 行 901:
 [[http://localhost:8080]] にブラウザーでアクセスする。\\ [[http://localhost:8080]] にブラウザーでアクセスする。\\
 {{:python:moinmoin2.png?800|MoinMoin 2}}\\ {{:python:moinmoin2.png?800|MoinMoin 2}}\\
 +
 +===== ApacheBench してみる =====
 +ローカル簡易実行での ApacheBench の結果。\\
 +**Web Server:** Werkzeug/0.15.6\\
 +**Wiki App:** MoinMoin2\\
 +**Lang:** Python 3.7.4\\
 +**Web Interface:** WSGI\\
 +<WRAP prewrap 100% #result>
 +<code>
 +> ab -n 1000 -c 100 http://localhost:8080/Home
 +This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
 +Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
 +Licensed to The Apache Software Foundation, http://www.apache.org/
 +
 +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:        Werkzeug/0.15.6
 +Server Hostname:        localhost
 +Server Port:            8080
 +
 +Document Path:          /Home
 +Document Length:        17256 bytes
 +
 +Concurrency Level:      100
 +Time taken for tests:   350.456 seconds
 +Complete requests:      1000
 +Failed requests:        527
 +   (Connect: 0, Receive: 0, Length: 527, Exceptions: 0)
 +Total transferred:      17410304 bytes
 +HTML transferred:       17125304 bytes
 +Requests per second:    2.85 [#/sec] (mean)
 +Time per request:       35045.644 [ms] (mean)
 +Time per request:       350.456 [ms] (mean, across all concurrent requests)
 +Transfer rate:          48.51 [Kbytes/sec] received
 +
 +Connection Times (ms)
 +              min  mean[+/-sd] median   max
 +Connect:        0    0   0.5      0       1
 +Processing:   357 34234 4558.1  35388   40767
 +Waiting:      300 34203 4557.3  35359   40723
 +Total:        357 34234 4558.1  35389   40767
 +
 +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
 + 100%  40767 (longest request)
 +</code>
 +</WRAP>
 +
 +1 秒間に平均どれくらいのリクエストをさばけるか?\\
 +<code>
 +Requests per second:    2.85 [#/sec] (mean)
 +</code>
 +1リクエストの平均応答時間は?\\
 +<code>
 +Time per request:       350.456 [ms] (mean, across all concurrent requests)
 +</code>
 +
 +**Web Server:** Apache/2.4.25\\
 +**Wiki App:** DokuWiki Release 2018-04-22b "Greebo"\\
 +**Lang:** PHP 7.3.3\\
 +**Web Interface:** FastCGI\\
 +<WRAP prewrap 100% #result>
 +<code>
 +abs -n 1000 -c 100 https://wiki.monsters-g.local:1443/start
 +This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
 +Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
 +Licensed to The Apache Software Foundation, http://www.apache.org/
 +
 +Benchmarking wiki.monsters-g.local (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:        Apache/2.4.25
 +Server Hostname:        wiki.monsters-g.local
 +Server Port:            1443
 +SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256
 +Server Temp Key:        ECDH P-256 256 bits
 +TLS Server Name:        wiki.monsters-g.local
 +
 +Document Path:          /start
 +Document Length:        19763 bytes
 +
 +Concurrency Level:      100
 +Time taken for tests:   62.989 seconds
 +Complete requests:      1000
 +Failed requests:        0
 +Total transferred:      20331000 bytes
 +HTML transferred:       19763000 bytes
 +Requests per second:    15.88 [#/sec] (mean)
 +Time per request:       6298.879 [ms] (mean)
 +Time per request:       62.989 [ms] (mean, across all concurrent requests)
 +Transfer rate:          315.21 [Kbytes/sec] received
 +
 +Connection Times (ms)
 +              min  mean[+/-sd] median   max
 +Connect:        7 1872 602.1   2033    3737
 +Processing:   100 3565 7886.9    620   58699
 +Waiting:       99 3563 7887.1    619   58698
 +Total:        284 5437 7678.7   2713   58830
 +
 +Percentage of the requests served within a certain time (ms)
 +  50%   2713
 +  66%   3079
 +  75%   3954
 +  80%   5102
 +  90%  11795
 +  95%  23513
 +  98%  33594
 +  99%  40993
 + 100%  58830 (longest request)
 +</code>
 +</WRAP>
 +
 +<code>
 +Requests per second:    15.88 [#/sec] (mean)
 +Time per request:       62.989 [ms] (mean, across all concurrent requests)
 +</code>
 +
 +===== 参考文献 =====
 +[[https://moin-20.readthedocs.io/en/latest/|Introducing MoinMoin — MoinMoin 0.1.dev194+gfdb6906 documentation]]\\
  
  • python/moinmoin.txt
  • 最終更新: 2021/07/05 02:40
  • by ともやん