A small yet high performance http server and reverse proxy. You may view it as a tiny nginx.
- gcc 5.4.0
- linux 4.4.0
$ git submodule update --remote --recursive
$ cd src && make all
$ make install # root required
$ julia # roo required, default listening at 8000
You may modify the config file to specify the port if there is a confliction.
As julia run as a daemon, it is not convenient to debug. Follow the steps to make it run in debug mode:
- change the INSTALL_DIR in Makefile to your local repo, like:
INSTALL_DIR = /home/foo/julia/ # the last slash required
- turn on the debug instruction in config.json
"debug": true,
Making a http server and host your site is not extremely cool? Then, what if your server is compiled by your own compiler?
Yes, i wrote a C11 compiler(let me call it wgtcc). It compiles julia, and the site runs well :) You can install wgtcc, then compile julia:
$ make CC=wgtcc all
It surprised me that the server compiled by wgtcc runs extremely fast!
have fun :)
fastcgi- chunked transform
- benchmark
julia 是一个短小精悍的高并发http服务器和反向代理。你可以将他想象成tiny nginx。我用它搭了博客。静态文件由julia serve, 动态内容pass到后端的uwsgi(类似于fpm)。
最酷的是,这个服务器,包括正在运行的博客,都是我自己写的C编译器编译的。如果你对编译器也感兴趣,可以看这里。按照其readme安装wgtcc后,你可以这样编译julia:
$ make CC=wgtcc all
have fun :)
benchmark: ab
均为8 worker, 1KiB静态页面
并发 | nginx | julia |
---|---|---|
10 | 52K | 54K |
100 | 56K | 56K |
1000 | 46K | 44K |