a library for c++
Libevent, libev and libuv are outdated.
- linux
- gcc (-std=c11)
- g++ (-std=c++11)
epoll or epoll + multi-threading + multi-process
- tcp sever
- http server
- websocket server
- web server
- leveldb server
- lua server
- sqlite server
- medis_server (like redis but support sqlite and leveldb)
- utils
make clean && make -j2 && sudo make install && sudo ldconfig
pkg-config --libs --cflags mongols
-
successful: 200
-
failed: 500
-
POST
curl -d'key=value' http://host/key
-
GET
curl http://host/key
-
DELETE
curl -X DELETE http://host/key
- successful: 200
- failed: 500
- sql_type: cmd,transaction,query
- sql: SQL statement
- result: JSON
POST curl -d 'sql_type=x' -d 'sql=sql_statement' http://127.0.0.1:9090/
example: curl -d'sql_type=query' -d'sql=select * from test limit 3;' http://127.0.0.1:9090/
result: {"error":null,"result":[{"id":1,"name":"a"},{"id":2,"name":"b"},{"id":3,"name":"c"}]}
2 core,4 GB,linux mint 18,2 thread:
ab -kc 10000 -n 500000 -H 'Connection: keep-alive' http://127.0.0.1:9090/
wrk -t 50 -d 30s -c 10000 -H 'Connection: keep-alive' http://127.0.0.1:9090/