Skip to content

Commit 07d8030

Browse files
committed
docs(docker): 更新 Docker部署文档
- 添加 CPU、内存和操作系统信息 - 更新 geoipupdate 数据目录路径 - 新增 Alpine 和 Ubuntu 镜像的部署说明 - 提供不同版本 libmaxminddb 的安装方法 - 增加 wrk 性能测试结果
1 parent 7e8e031 commit 07d8030

File tree

2 files changed

+79
-12
lines changed

2 files changed

+79
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ luac.out
4242
.idea/
4343

4444
.vscode/
45+
geoipupdate_data/

docker/README.md

Lines changed: 78 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,109 @@
11

22
# Test Document
33

4+
> CPU Intel(R) Core(TM) Ultra 9 185H (2.30 GHz)
5+
> Wsl Memory limit 8G
6+
> Windows 11 + Wsl2
7+
48
`cd docker && mkdir -p geoipupdate_data`
59

610
## Download maxmind database file
711
```bash
812
cat geo-env
913
# Change to your account GEOIPUPDATE_LICENSE_KEY GEOIPUPDATE_ACCOUNT_ID
1014
#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
1218
```
1319

1420
## Run openresty
21+
22+
Alpine image (libmaxminddb 1.9.1-r0 && 1.12.2)
23+
1524
```bash
1625
# 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
1827

1928
# install libmaxminddb
20-
docker exec -it openresty /bin/sh
29+
docker exec -it openresty /bin/bash
30+
# 1.9.1-r0
2131
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
2257
```
2358

2459
## Run wrk
2560

2661
```bash
2762
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
2863

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)
2995
Running 2m test @ http://127.0.0.1:80
3096
50 threads and 200 connections
3197
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%
34100
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
42108
```
43109

0 commit comments

Comments
 (0)