Snippets

xchandan Web App Deploy

Updated by xchandan

File results.txt Modified

  • Ignore whitespace
  • Hide word diff
   95%     83
   98%     94
   99%    221
- 100%    305 (longest request)
+ 100%    305 (longest request)
+ 
+ 
+ AIOHTTP
+ =======
+ 
+ Server Software:        Python/3.7
+Server Hostname:        localhost
+Server Port:            8181
+
+Document Path:          /
+Document Length:        120000 bytes
+
+Concurrency Level:      100
+Time taken for tests:   64.111 seconds
+Complete requests:      100000
+Failed requests:        0
+Total transferred:      12015500000 bytes
+HTML transferred:       12000000000 bytes
+Requests per second:    1559.79 [#/sec] (mean)
+Time per request:       64.111 [ms] (mean)
+Time per request:       0.641 [ms] (mean, across all concurrent requests)
+Transfer rate:          183024.12 [Kbytes/sec] received
+
+Connection Times (ms)
+              min  mean[+/-sd] median   max
+Connect:        0    1   1.6      1      38
+Processing:    29   63  38.8     51     359
+Waiting:       15   51  32.5     43     354
+Total:         32   64  39.3     52     360
+
+Percentage of the requests served within a certain time (ms)
+  50%     52
+  66%     53
+  75%     60
+  80%     63
+  90%     68
+  95%    192
+  98%    221
+  99%    241
+ 100%    360 (longest request)
+ 
+ 
+ GOLANG
+ ======
+ 
+ Server Software:        
+Server Hostname:        localhost
+Server Port:            8181
+
+Document Path:          /
+Document Length:        120000 bytes
+
+Concurrency Level:      100
+Time taken for tests:   14.104 seconds
+Complete requests:      100000
+Failed requests:        0
+Total transferred:      12009700000 bytes
+HTML transferred:       12000000000 bytes
+Requests per second:    7090.42 [#/sec] (mean)
+Time per request:       14.104 [ms] (mean)
+Time per request:       0.141 [ms] (mean, across all concurrent requests)
+Transfer rate:          831580.41 [Kbytes/sec] received
+
+Connection Times (ms)
+              min  mean[+/-sd] median   max
+Connect:        0    2   2.1      1      19
+Processing:     0   12   6.2     12      67
+Waiting:        0    5   5.1      3      57
+Total:          0   14   6.8     14      67
+
+Percentage of the requests served within a certain time (ms)
+  50%     14
+  66%     17
+  75%     19
+  80%     20
+  90%     22
+  95%     25
+  98%     29
+  99%     32
+ 100%     67 (longest request)
+ 
+ 
+ NGINX Static file
+ =================
+ 
+ Server Software:        nginx/1.10.3
+Server Hostname:        localhost
+Server Port:            80
+
+Document Path:          /data
+Document Length:        120000 bytes
+
+Concurrency Level:      100
+Time taken for tests:   7.007 seconds
+Complete requests:      100000
+Failed requests:        0
+Total transferred:      12026200000 bytes
+HTML transferred:       12000000000 bytes
+Requests per second:    14271.03 [#/sec] (mean)
+Time per request:       7.007 [ms] (mean)
+Time per request:       0.070 [ms] (mean, across all concurrent requests)
+Transfer rate:          1676037.87 [Kbytes/sec] received
+
+Connection Times (ms)
+              min  mean[+/-sd] median   max
+Connect:        0    1   0.6      1      10
+Processing:     1    6   1.0      6      17
+Waiting:        0    1   0.6      1      11
+Total:          3    7   1.3      7      19
+
+Percentage of the requests served within a certain time (ms)
+  50%      7
+  66%      7
+  75%      7
+  80%      7
+  90%      8
+  95%      8
+  98%     11
+  99%     15
+ 100%     19 (longest request)
+ 

File server-aiohttp.py Added

  • Ignore whitespace
  • Hide word diff
+from aiohttp import web
+import logging
+
+logging.basicConfig(level=logging.INFO)
+
+LOG = logging.getLogger(__name__)
+
+msg = "Hello World!"*10000
+
+async def handle(request):
+    return web.Response(text=msg)
+
+app = web.Application()
+app.add_routes([web.get('/', handle),])
+
+LOG.info("Starting aiohttp server ...")
+web.run_app(app, host='0.0.0.0', port=8181, access_log=LOG)

File server.go Added

  • Ignore whitespace
  • Hide word diff
+package main
+                                                                                                      
+import (
+    "fmt"
+    "log"                                                                                             
+    "net/http"
+    "strings"                                                                                         
+    "time"
+)
+    
+var msg = strings.Repeat("Hello World!", 10000)                                                       
+                                                                                                      
+func handler(w http.ResponseWriter, r *http.Request) {                                                
+    fmt.Println(time.Now(), r.Method, r.URL.Path, r.RemoteAddr, r.UserAgent())                        
+    fmt.Fprintf(w, msg)
+}
+
+func main() {
+    http.HandleFunc("/", handler)
+    log.Fatal(http.ListenAndServe(":8181", nil))
+}
Updated by xchandan

File results.md Deleted

  • Ignore whitespace
  • Hide word diff
-TEST
-====
-
-ab -c100 -n100000 http://localhost:8181/
-
-
-FLASK_APP
-=========
-
-Server Software:        Werkzeug/0.15.1
-Server Hostname:        localhost
-Server Port:            8181
-
-Document Path:          /
-Document Length:        120000 bytes
-
-Concurrency Level:      100
-Time taken for tests:   172.248 seconds
-Complete requests:      100000
-Failed requests:        0
-Total transferred:      12015800000 bytes
-HTML transferred:       12000000000 bytes
-Requests per second:    580.56 [#/sec] (mean)
-Time per request:       172.248 [ms] (mean)
-Time per request:       1.722 [ms] (mean, across all concurrent requests)
-Transfer rate:          68123.93 [Kbytes/sec] received
-
-Connection Times (ms)
-              min  mean[+/-sd] median   max
-Connect:        0    0   0.7      0      40
-Processing:     2  172 211.6    112    1347
-Waiting:        2  171 210.1    112    1344
-Total:          4  172 211.7    112    1347
-
-Percentage of the requests served within a certain time (ms)
-  50%    112
-  66%    115
-  75%    118
-  80%    121
-  90%    137
-  95%    851
-  98%    997
-  99%   1053
- 100%   1347 (longest request)
-
-
-Gevent
-======
-
-Server Software:        
-Server Hostname:        localhost
-Server Port:            8181
-
-Document Path:          /
-Document Length:        120000 bytes
-
-Concurrency Level:      100
-Time taken for tests:   70.692 seconds
-Complete requests:      100000
-Failed requests:        0
-Total transferred:      12013900000 bytes
-HTML transferred:       12000000000 bytes
-Requests per second:    1414.58 [#/sec] (mean)
-Time per request:       70.692 [ms] (mean)
-Time per request:       0.707 [ms] (mean, across all concurrent requests)
-Transfer rate:          165963.58 [Kbytes/sec] received
-
-Connection Times (ms)
-              min  mean[+/-sd] median   max
-Connect:        0    0   0.2      0      22
-Processing:     1   71  20.1     67     305
-Waiting:        1   70  20.0     67     305
-Total:          3   71  20.1     67     305
-
-Percentage of the requests served within a certain time (ms)
-  50%     67
-  66%     68
-  75%     69
-  80%     70
-  90%     77
-  95%     83
-  98%     94
-  99%    221
- 100%    305 (longest request)

File results.txt Added

  • Ignore whitespace
  • Hide word diff
+TEST
+====
+
+ab -c100 -n100000 http://localhost:8181/
+
+
+FLASK_APP
+=========
+
+Server Software:        Werkzeug/0.15.1
+Server Hostname:        localhost
+Server Port:            8181
+
+Document Path:          /
+Document Length:        120000 bytes
+
+Concurrency Level:      100
+Time taken for tests:   172.248 seconds
+Complete requests:      100000
+Failed requests:        0
+Total transferred:      12015800000 bytes
+HTML transferred:       12000000000 bytes
+Requests per second:    580.56 [#/sec] (mean)
+Time per request:       172.248 [ms] (mean)
+Time per request:       1.722 [ms] (mean, across all concurrent requests)
+Transfer rate:          68123.93 [Kbytes/sec] received
+
+Connection Times (ms)
+              min  mean[+/-sd] median   max
+Connect:        0    0   0.7      0      40
+Processing:     2  172 211.6    112    1347
+Waiting:        2  171 210.1    112    1344
+Total:          4  172 211.7    112    1347
+
+Percentage of the requests served within a certain time (ms)
+  50%    112
+  66%    115
+  75%    118
+  80%    121
+  90%    137
+  95%    851
+  98%    997
+  99%   1053
+ 100%   1347 (longest request)
+
+
+Gevent
+======
+
+Server Software:        
+Server Hostname:        localhost
+Server Port:            8181
+
+Document Path:          /
+Document Length:        120000 bytes
+
+Concurrency Level:      100
+Time taken for tests:   70.692 seconds
+Complete requests:      100000
+Failed requests:        0
+Total transferred:      12013900000 bytes
+HTML transferred:       12000000000 bytes
+Requests per second:    1414.58 [#/sec] (mean)
+Time per request:       70.692 [ms] (mean)
+Time per request:       0.707 [ms] (mean, across all concurrent requests)
+Transfer rate:          165963.58 [Kbytes/sec] received
+
+Connection Times (ms)
+              min  mean[+/-sd] median   max
+Connect:        0    0   0.2      0      22
+Processing:     1   71  20.1     67     305
+Waiting:        1   70  20.0     67     305
+Total:          3   71  20.1     67     305
+
+Percentage of the requests served within a certain time (ms)
+  50%     67
+  66%     68
+  75%     69
+  80%     70
+  90%     77
+  95%     83
+  98%     94
+  99%    221
+ 100%    305 (longest request)
Created by xchandan

File results.md Added

  • Ignore whitespace
  • Hide word diff
+TEST
+====
+
+ab -c100 -n100000 http://localhost:8181/
+
+
+FLASK_APP
+=========
+
+Server Software:        Werkzeug/0.15.1
+Server Hostname:        localhost
+Server Port:            8181
+
+Document Path:          /
+Document Length:        120000 bytes
+
+Concurrency Level:      100
+Time taken for tests:   172.248 seconds
+Complete requests:      100000
+Failed requests:        0
+Total transferred:      12015800000 bytes
+HTML transferred:       12000000000 bytes
+Requests per second:    580.56 [#/sec] (mean)
+Time per request:       172.248 [ms] (mean)
+Time per request:       1.722 [ms] (mean, across all concurrent requests)
+Transfer rate:          68123.93 [Kbytes/sec] received
+
+Connection Times (ms)
+              min  mean[+/-sd] median   max
+Connect:        0    0   0.7      0      40
+Processing:     2  172 211.6    112    1347
+Waiting:        2  171 210.1    112    1344
+Total:          4  172 211.7    112    1347
+
+Percentage of the requests served within a certain time (ms)
+  50%    112
+  66%    115
+  75%    118
+  80%    121
+  90%    137
+  95%    851
+  98%    997
+  99%   1053
+ 100%   1347 (longest request)
+
+
+Gevent
+======
+
+Server Software:        
+Server Hostname:        localhost
+Server Port:            8181
+
+Document Path:          /
+Document Length:        120000 bytes
+
+Concurrency Level:      100
+Time taken for tests:   70.692 seconds
+Complete requests:      100000
+Failed requests:        0
+Total transferred:      12013900000 bytes
+HTML transferred:       12000000000 bytes
+Requests per second:    1414.58 [#/sec] (mean)
+Time per request:       70.692 [ms] (mean)
+Time per request:       0.707 [ms] (mean, across all concurrent requests)
+Transfer rate:          165963.58 [Kbytes/sec] received
+
+Connection Times (ms)
+              min  mean[+/-sd] median   max
+Connect:        0    0   0.2      0      22
+Processing:     1   71  20.1     67     305
+Waiting:        1   70  20.0     67     305
+Total:          3   71  20.1     67     305
+
+Percentage of the requests served within a certain time (ms)
+  50%     67
+  66%     68
+  75%     69
+  80%     70
+  90%     77
+  95%     83
+  98%     94
+  99%    221
+ 100%    305 (longest request)

File server-gevent.py Added

  • Ignore whitespace
  • Hide word diff
+from gevent import monkey
+monkey.patch_all()
+
+#from gevent.pool import Pool
+from gevent.pywsgi import WSGIServer
+from api import app
+
+#http_server = WSGIServer(('', 8181), app, spawn=Pool(10))
+http_server = WSGIServer(('', 8181), app)
+http_server.serve_forever()
+
+# python server-gevent.py

File server.py Added

  • Ignore whitespace
  • Hide word diff
+import requests
+
+from flask import Flask
+app = Flask(__name__)
+
+msg = "Hello World!"*10000
+
+@app.route("/")
+def hello():
+    #requests.get('http://127.0.0.1:9191')
+    return msg
+
+if __name__ == '__main__':
+    app.run('127.0.0.1', 8181)
+
+
+# FLASK_APP=api.py flask run -p 8181
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.