https://github.com/whtsht/ginn
Ginn is not nginx.
https://github.com/whtsht/ginn
c educational-project http http-server linux
Last synced: 3 days ago
JSON representation
Ginn is not nginx.
- Host: GitHub
- URL: https://github.com/whtsht/ginn
- Owner: whtsht
- License: gpl-3.0
- Created: 2023-12-28T05:16:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-07T05:42:31.000Z (over 2 years ago)
- Last Synced: 2024-01-07T10:16:38.124Z (over 2 years ago)
- Topics: c, educational-project, http, http-server, linux
- Language: C
- Homepage:
- Size: 132 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ginn
Ginn is not nginx.
## What is Ginn?
Ginn is a web server inspired by [nginx](https://www.nginx.com/). It employs an event-driven approach to address [C10k problems](http://www.kegel.com/c10k.html) and achieves scaling by reloading configuration files without dropping client requests.
Note. _This was created for educational purposes and is not suitable for real production._
## Installation
First, clone this repository and go to the directory.
### Install Local
Build Ginn locally and place it in the appropriate directory.
```
$ make && sudo make install
```
Start Ginn with root permission.
```
$ sudo ginn start
```
and open [http://localhost](http://localhost).
Ginn uses a well-known 80 port by default. If you don't like this behavior, edit `/etc/ginn.conf`.
```
- # port 4700;
+ port 4700;
```
### Using Docker
Start Ginn using docker-compose.
```
$ docker compose up -d
```
and open [http://localhost:4700](http://localhost:4700).
## Unit tests
This project uses [CUnit Test Framework](https://cunit.sourceforge.net/). Please install it.
Run all tests with the following command.
```
$ make test
```
## Benchmarking
You can test and benchmark using [siege](https://github.com/JoeDog/siege).
Note. _Start Ginn on port number 4700._
```
$ siege -c 200 -t 5S -b -i --log=/tmp/siege.log -f ./urls.txt
```
## References
- [Pico HTTP Server in C](https://github.com/foxweb/pico)
- [pidfile.c at enki/gvpe](https://github.com/enki/gvpe/blob/master/lib/pidfile.c)
- [pasce/daemon-skeleton-linux-c](https://github.com/pasce/daemon-skeleton-linux-c)