|
1 | 1 |
|
2 | 2 | # Test Document |
3 | 3 |
|
| 4 | +> CPU Intel(R) Core(TM) Ultra 9 185H (2.30 GHz) |
| 5 | +> Wsl Memory limit 8G |
| 6 | +> Windows 11 + Wsl2 |
| 7 | +
|
4 | 8 | `cd docker && mkdir -p geoipupdate_data` |
5 | 9 |
|
6 | 10 | ## Download maxmind database file |
7 | 11 | ```bash |
8 | 12 | cat geo-env |
9 | 13 | # Change to your account GEOIPUPDATE_LICENSE_KEY GEOIPUPDATE_ACCOUNT_ID |
10 | 14 | #vi geo-env |
11 | | -docker run --env-file geo-env --rm --entrypoint /bin/sh -it -v $(pwd)/geoipupdate_data:/tmp/ ghcr.io/maxmind/geoipupdate |
| 15 | +docker run --env-file geo-env --rm --name geoipupdate -v $(pwd)/geoipupdate_data/:/usr/local/share/GeoIP/ ghcr.io/maxmind/geoipupdate |
| 16 | +# docker run --env-file geo-env --rm --name geoipupdate --entrypoint /bin/sh -it -v $(pwd)/geoipupdate_data/:/usr/local/share/GeoIP/ ghcr.io/maxmind/geoipupdate |
| 17 | +# HTTPS_PROXY=http://127.0.0.1:1080 HTTP_PROXY=http://127.0.0.1:1080 geoipupdate |
12 | 18 | ``` |
13 | 19 |
|
14 | 20 | ## Run openresty |
| 21 | + |
| 22 | +Alpine image (libmaxminddb 1.9.1-r0 && 1.12.2) |
| 23 | + |
15 | 24 | ```bash |
16 | 25 | # run openresty as daemon |
17 | | -docker run -d -p80:80 --name openresty --rm -v $(pwd)/../lib/resty/maxminddb.lua:/usr/local/openresty/lualib/resty/maxminddb.lua -v $(pwd)/geoip/:/opt/geoipupdate_data/ -v $(pwd)/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf openresty/openresty:alpine-fat |
| 26 | +docker run -d -p80:80 --name openresty --rm -v $(pwd)/../lib/resty/maxminddb.lua:/usr/local/openresty/lualib/resty/maxminddb.lua -v $(pwd)/geoipupdate_data/:/opt/geoipupdate_data/ -v $(pwd)/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf openresty/openresty:alpine-fat |
18 | 27 |
|
19 | 28 | # install libmaxminddb |
20 | | -docker exec -it openresty /bin/sh |
| 29 | +docker exec -it openresty /bin/bash |
| 30 | +# 1.9.1-r0 |
21 | 31 | apk add --no-cache perl libmaxminddb && ln -s /usr/lib/libmaxminddb.so.0 /usr/lib/libmaxminddb.so |
| 32 | +# 1.12.2 |
| 33 | +cd /tmp/ |
| 34 | +wget https://github.com/maxmind/libmaxminddb/releases/download/1.12.2/libmaxminddb-1.12.2.tar.gz && \ |
| 35 | + tar zxf libmaxminddb-1.12.2.tar.gz && \ |
| 36 | + cd libmaxminddb-1.12.2 && \ |
| 37 | + ./configure && \ |
| 38 | + make -j && \ |
| 39 | + make check && \ |
| 40 | + make install && \ |
| 41 | + ldconfig && \ |
| 42 | + rm -rf /tmp/* |
| 43 | + |
| 44 | +openresty -s reload |
| 45 | +``` |
| 46 | + |
| 47 | +Ubuntu image (1.12.2-0+maxmind1~jammy) |
| 48 | + |
| 49 | +```bash |
| 50 | +# run openresty as daemon |
| 51 | +docker run -d -p80:80 --name openresty --rm -v $(pwd)/../lib/resty/maxminddb.lua:/usr/local/openresty/lualib/resty/maxminddb.lua -v $(pwd)/geoipupdate_data/:/opt/geoipupdate_data/ -v $(pwd)/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf openresty/openresty:jammy |
| 52 | + |
| 53 | +# install libmaxminddb |
| 54 | +docker exec -it openresty /bin/bash |
| 55 | +apt update && apt install -y software-properties-common && add-apt-repository ppa:maxmind/ppa -y && apt update && apt install -y libmaxminddb0 libmaxminddb-dev mmdb-bin |
| 56 | +openresty -s reload |
22 | 57 | ``` |
23 | 58 |
|
24 | 59 | ## Run wrk |
25 | 60 |
|
26 | 61 | ```bash |
27 | 62 | docker run -it --rm -v $(pwd)/wrk-test.lua:/tmp/wrk-test.lua --name wrk williamyeh/wrk:4.0.2 -t50 -c200 -d120s -s /tmp/wrk-test.lua --latency http://127.0.0.1:80 |
28 | 63 |
|
| 64 | +# alpine image (old version libmaxminddb 1.9.1-r0) |
| 65 | +Running 2m test @ http://127.0.0.1:80 |
| 66 | + 50 threads and 200 connections |
| 67 | + Thread Stats Avg Stdev Max +/- Stdev |
| 68 | + Latency 3.85ms 3.39ms 260.04ms 92.83% |
| 69 | + Req/Sec 1.02k 210.85 3.26k 75.24% |
| 70 | + Latency Distribution |
| 71 | + 50% 3.40ms |
| 72 | + 75% 4.90ms |
| 73 | + 90% 6.59ms |
| 74 | + 99% 10.91ms |
| 75 | + 4488000 requests in 2.00m, 2.73GB read |
| 76 | +Requests/sec: 37368.74 |
| 77 | +Transfer/sec: 23.27MB |
| 78 | + |
| 79 | +# alpine image (libmaxminddb 1.12.2 cmake install) |
| 80 | +Running 2m test @ http://127.0.0.1:80 |
| 81 | + 50 threads and 200 connections |
| 82 | + Thread Stats Avg Stdev Max +/- Stdev |
| 83 | + Latency 3.89ms 2.57ms 211.34ms 81.24% |
| 84 | + Req/Sec 1.02k 210.32 3.21k 73.80% |
| 85 | + Latency Distribution |
| 86 | + 50% 3.48ms |
| 87 | + 75% 5.00ms |
| 88 | + 90% 6.71ms |
| 89 | + 99% 11.04ms |
| 90 | + 4482809 requests in 2.00m, 2.73GB read |
| 91 | +Requests/sec: 37325.96 |
| 92 | +Transfer/sec: 23.24MB |
| 93 | + |
| 94 | +# Ubuntu image (1.12.2-0+maxmind1~jammy) |
29 | 95 | Running 2m test @ http://127.0.0.1:80 |
30 | 96 | 50 threads and 200 connections |
31 | 97 | Thread Stats Avg Stdev Max +/- Stdev |
32 | | - Latency 4.08ms 2.93ms 220.41ms 85.59% |
33 | | - Req/Sec 0.97k 204.69 3.37k 72.66% |
| 98 | + Latency 3.84ms 3.47ms 204.31ms 92.95% |
| 99 | + Req/Sec 1.05k 222.28 3.15k 71.39% |
34 | 100 | Latency Distribution |
35 | | - 50% 3.62ms |
36 | | - 75% 5.22ms |
37 | | - 90% 7.02ms |
38 | | - 99% 11.78ms |
39 | | - 4537000 requests in 2.00m, 2.76GB read |
40 | | -Requests/sec: 37777.96 |
41 | | -Transfer/sec: 23.52MB |
| 101 | + 50% 3.31ms |
| 102 | + 75% 4.85ms |
| 103 | + 90% 6.63ms |
| 104 | + 99% 11.45ms |
| 105 | + 4410000 requests in 2.00m, 2.68GB read |
| 106 | +Requests/sec: 36719.95 |
| 107 | +Transfer/sec: 22.87MB |
42 | 108 | ``` |
43 | 109 |
|
0 commit comments