-
Notifications
You must be signed in to change notification settings - Fork 846
FastCGI (cgit)
Ivan Tham edited this page Apr 8, 2018
·
1 revision
user: h2o
pid-file: /var/run/h2o.pid
error-log: /var/log/h2o/error.log
access-log: /var/log/h2o/access.log
hosts:
"git.domain.tld:80": &git
listen: 80
paths: &git_paths
/cgit.css:
file.file: /srv/git/cgit.css
file.send-compressed: ON # Performance: minify and pre-compress css
/cgit.png:
file.file: /srv/git/cgit.png
/:
fastcgi.spawn: "exec $H2O_ROOT/share/h2o/fastcgi-cgi"
setenv:
SCRIPT_FILENAME: /srv/git/cgit.cgi
compress: ON
"git.dooooooooooomain.onion:80": *git
"git.domain.tld:443":
listen:
port: 443
ssl:
certificate-file: /srv/www/acme.sh/git.domain.tld/fullchain.cer
key-file: /srv/www/acme.sh/git.domain.tld/git.domain.tld.key
paths: *git_paths
- Based on https://gist.github.com/mundry/6bd24edac461fe869289#h2o
- Implemented in https://git.pickfire.tk/
- Minify css with https://git.pickfire.tk/www/plain/_bin/css.sh
- Pre-compress css with
brotli -c9f cgit.css > cgit.css.br
andgzip -c9f cgit.css > cgit.css.gz
.
fastcgi.spawn: "exec $H2O_ROOT/share/h2o/fastcgi-cgi"
> wrk https://git.pickfire.tk/
Running 10s test @ https://git.pickfire.tk/
2 threads and 10 connections
Thread Stats Avg Stdev Max /- Stdev
Latency 156.96ms 44.48ms 319.38ms 72.00%
Req/Sec 31.18 10.65 70.00 65.45%
600 requests in 10.02s, 3.62MB read
Requests/sec: 59.91
Transfer/sec: 369.63KB
> wrk https://git.pickfire.tk/
fastcgi.connect:
port: /run/fcgi.sock
type: unix
2 threads and 10 connections
Thread Stats Avg Stdev Max /- Stdev
Latency 213.56ms 36.38ms 278.45ms 76.51%
Req/Sec 23.39 11.71 50.00 50.29%
447 requests in 10.02s, 2.66MB read
Requests/sec: 44.61
Transfer/sec: 272.11KB