mongols-1.0.9发布,c++服务器基础设施

栏目: C++ · 发布时间: 7年前

内容简介:mongols-1.0.9已经发布。a library for c++

mongols-1.0.9已经发布。

主要更新:

  1. 更新文件上传机制,for http_server

  2. 作为leveldb作为nosql,替换redis,for http_server

  3. 提升多线程机制效能,for tcp_server

  4. 添加lua_server

  5. 添加sqlite_server

介绍:

a library for c++

依赖:

  • linux

  • pcre-devel

  • zlib-devel

  • openssl-devel

sudo yum install pcre-devel zlib-devel openssl-devel

or

sudo apt-get install libpcre3-dev zlib1g-dev libssl-dev

主要特性:

epoll or epoll + multi-threading

  • tcp sever

  • http server

  • websocket server

  • web server

  • leveldb server

  • lua server

  • sqlite server

  • utils

安装:

make clean && make -j2 && sudo make install && sudo ldconfig

使用:

pkg-config --libs --cflags mongols

leveldb_server 使用:

  • successful: 200

  • failed: 500

  • POST curl -d'key=value' http://host/key

  • GET curl http://host/key

  • DELETE curl -X DELETE http://host/key

sqlite_server 使用:

  • 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,centos 7:

mongols-1.0.9发布,c++服务器基础设施

mongols-1.0.9发布,c++服务器基础设施

仓库: https://github.com/webcpp/mongols


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Web Development Recipes

Web Development Recipes

Brian P. Hogan、Chris Warren、Mike Weber、Chris Johnson、Aaron Godin / Pragmatic Bookshelf / 2012-1-22 / USD 35.00

You'll see a full spectrum of cutting-edge web development techniques, from UI and eye candy recipes to solutions for data analysis, testing, and web hosting. Make buttons and content stand out with s......一起来看看 《Web Development Recipes》 这本书的介绍吧!

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具