diff --git a/Benchmark.md b/Benchmark.md index 6fadee1..a952c9d 100644 --- a/Benchmark.md +++ b/Benchmark.md @@ -40,29 +40,23 @@ Requests/sec: 117876.05 Transfer/sec: 15.40MB ``` -## Nginx --> Nginx + +## Pingap --> Nginx ```bash -wrk 'http://127.0.0.1:6200/ping' --latency +wrk 'http://127.0.0.1:6101/ping' --latency -Running 10s test @ http://127.0.0.1:6200/ping +Running 10s test @ http://127.0.0.1:6101/ping 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev - Latency 287.76us 2.00ms 43.08ms 98.30% - Req/Sec 64.58k 4.49k 79.88k 87.13% + Latency 221.18us 394.85us 13.41ms 99.53% + Req/Sec 24.98k 0.90k 26.78k 89.60% Latency Distribution - 50% 73.00us - 75% 81.00us - 90% 88.00us - 99% 8.16ms - 1298148 requests in 10.10s, 185.70MB read -Requests/sec: 128518.38 -Transfer/sec: 18.38MB -``` - - -## Pingap --> Nginx - -```bash -wrk 'http://127.0.0.1:6101/ping' --latency + 50% 212.00us + 75% 226.00us + 90% 240.00us + 99% 305.00us + 502003 requests in 10.10s, 71.81MB read +Requests/sec: 49706.13 +Transfer/sec: 7.11MB ``` diff --git a/benches/nginx.conf b/benches/nginx.conf index 150b3ac..9c609be 100644 --- a/benches/nginx.conf +++ b/benches/nginx.conf @@ -12,19 +12,20 @@ http { upstream backend { server 127.0.0.1:6200; - keepalive 300; + keepalive 30; } sendfile on; keepalive_timeout 65; - keepalive_requests 1000000; + keepalive_requests 1000; server { listen 6201; #server_name localhost; #access_log /tmp/access.log access; location / { default_type text/json; + proxy_http_version 1.1; proxy_pass http://backend; } diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index 6f8e7ad..eea123f 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -63,6 +63,7 @@ export default { machineMemory: "Machine Memory", yes: "Yes", no: "No", + to: "To", }, basic: { name: "Name", diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index ae10130..cf2a5ad 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -63,6 +63,7 @@ export default { machineMemory: "机器内存", yes: "是", no: "否", + to: "至", }, basic: { name: "名称", diff --git a/web/src/pages/Certificates.tsx b/web/src/pages/Certificates.tsx index 2001ca5..2869fa8 100644 --- a/web/src/pages/Certificates.tsx +++ b/web/src/pages/Certificates.tsx @@ -61,6 +61,10 @@ export default function Certificates() { currentCertificate, config.certificates, ); + const countLines = (value: string) => { + const count = value.split("\n").length; + return Math.min(Math.max(3, count), 8); + }; const items: ExFormItem[] = [ { @@ -70,6 +74,7 @@ export default function Certificates() { defaultValue: certificateConfig.tls_cert, span: 6, category: ExFormItemCategory.TEXTAREA, + rows: countLines(certificateConfig.tls_cert || ""), }, { name: "tls_key", @@ -78,6 +83,7 @@ export default function Certificates() { defaultValue: certificateConfig.tls_key, span: 6, category: ExFormItemCategory.TEXTAREA, + rows: countLines(certificateConfig.tls_key || ""), }, { name: "tls_chain", diff --git a/web/src/pages/Home.tsx b/web/src/pages/Home.tsx index 4a9c63b..cd43746 100644 --- a/web/src/pages/Home.tsx +++ b/web/src/pages/Home.tsx @@ -52,7 +52,9 @@ export default function Home() { const data = infos[name]; if (data) { results[name] = - formatDate(data.not_before) + " : " + formatDate(data.not_after); + formatDate(data.not_before) + + ` ${homeI18n("to")} ` + + formatDate(data.not_after); } }); setValidity(results);