Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jaguililla committed Jun 16, 2024
2 parents 9f62ae3 + 6837c80 commit 30be805
Show file tree
Hide file tree
Showing 736 changed files with 8,853 additions and 11,738 deletions.
29 changes: 15 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive
# WARNING: DON'T PUT A SPACE AFTER ANY BACKSLASH OR APT WILL BREAK
Expand All @@ -18,24 +18,25 @@ RUN apt-get -yqq update && \
libpq-dev \
pkg-config \
python3 \
python3-colorama \
python3-dev \
python3-dnspython \
python3-packaging \
python3-pip \
python3-psutil \
python3-psycopg2 \
python3-requests \
siege \
software-properties-common

RUN pip3 install \
colorama==0.3.1 \
docker==4.0.2 \
mysqlclient \
psutil \
psycopg2-binary \
pymongo==3.13.0 \
# urllib3 incompatibility:
# https://github.com/docker/docker-py/issues/3113#issuecomment-1525500104
requests==2.28.1
software-properties-common && \
# Ubuntu's equivalent packages are too old and/or broken.
pip3 install \
--break-system-packages \
docker==7.0.0 \
mysqlclient==2.2.4 \
pymongo==4.7.2

# Collect resource usage statistics
ARG DOOL_VERSION=v1.2.0
ARG DOOL_VERSION=v1.3.1

WORKDIR /tmp
RUN curl -LSs "https://github.com/scottchiefbaker/dool/archive/${DOOL_VERSION}.tar.gz" | \
Expand Down
14 changes: 7 additions & 7 deletions frameworks/C++/drogon/drogon-core.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

COPY ./ ./

Expand All @@ -11,18 +11,18 @@ RUN apt-get update -yqq && \
zlib1g-dev && \
add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update -yqq && \
apt-get install -yqq gcc-10 g++-10
apt-get install -yqq gcc g++

RUN locale-gen en_US.UTF-8

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

ENV CC=gcc-10
ENV CXX=g++-10
ENV AR=gcc-ar-10
ENV RANLIB=gcc-ranlib-10
ENV CC=gcc
ENV CXX=g++
ENV AR=gcc-ar
ENV RANLIB=gcc-ranlib

ENV IROOT=/install
ENV DROGON_ROOT=$IROOT/drogon
Expand All @@ -41,7 +41,7 @@ RUN git clone https://github.com/an-tao/drogon

WORKDIR $DROGON_ROOT

RUN git checkout ebf87d69d7bb45dfa478ba364ef9374d9be25092
RUN git checkout 96919df488e0ebaa0ed304bbd76bba33508df3cc
RUN git submodule update --init
RUN mkdir build

Expand Down
14 changes: 7 additions & 7 deletions frameworks/C++/drogon/drogon.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

COPY ./ ./

Expand All @@ -11,18 +11,18 @@ RUN apt-get update -yqq && \
zlib1g-dev && \
add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update -yqq && \
apt-get install -yqq gcc-10 g++-10
apt-get install -yqq gcc g++

RUN locale-gen en_US.UTF-8

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

ENV CC=gcc-10
ENV CXX=g++-10
ENV AR=gcc-ar-10
ENV RANLIB=gcc-ranlib-10
ENV CC=gcc
ENV CXX=g++
ENV AR=gcc-ar
ENV RANLIB=gcc-ranlib

ENV IROOT=/install
ENV DROGON_ROOT=$IROOT/drogon
Expand All @@ -41,7 +41,7 @@ RUN git clone https://github.com/an-tao/drogon

WORKDIR $DROGON_ROOT

RUN git checkout ebf87d69d7bb45dfa478ba364ef9374d9be25092
RUN git checkout 96919df488e0ebaa0ed304bbd76bba33508df3cc
RUN git submodule update --init
RUN mkdir build

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ void FortuneCtrlRaw::asyncHandleHttpRequest(
rows.reserve(r.size() + 1);
for (auto const &row : r)
{
rows.emplace_back(row[0ul].as<string_view>(), // id
row[1ul].as<string_view>()); // message
rows.emplace_back(row[0ul].as<std::string_view>(), // id
row[1ul].as<std::string_view>()); // message
}
rows.emplace_back("0", "Additional fortune added at request time.");
std::sort(rows.begin(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#pragma once
#include <drogon/HttpSimpleController.h>
#include <drogon/IOThreadStorage.h>
#include <string_view>

using namespace drogon;
struct Fortune
{
Fortune(string_view &&id, string_view &&message)
Fortune(std::string_view &&id, std::string_view &&message)
: id_(std::move(id)), message_(std::move(message))
{
}
Fortune() = default;
string_view id_;
string_view message_;
std::string_view id_;
std::string_view message_;
};
class FortuneCtrlRaw : public drogon::HttpSimpleController<FortuneCtrlRaw>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void UpdatesCtrlRaw::update(
const DbClientPtr &client)
{
auto const &sql = getSQL(results->size());
auto sqlBinder = *client << string_view(sql.data(), sql.length());
auto sqlBinder = *client << std::string_view(sql.data(), sql.length());
Json::Value json;
json.resize(0);
for (auto const &w : *results)
Expand Down
40 changes: 40 additions & 0 deletions frameworks/C++/paozhu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# paozhu Benchmarking Test

This is the [Paozhu](https://github.com/hggq/paozhu)

This Benchmarking Test code from https://github.com/hggq/paozhu/releases/tag/v1.5.8

### Test Type Implementation Source Code

* [Benchmark code](controller/src/techempower.cpp)
* [ORM config](conf/orm.conf)
* [Server config](conf/server.conf)

## Test URLs
### JSON

http://localhost:8888/json

### PLAINTEXT

http://localhost:8888/plaintext


### Single Database Query

http://localhost:8888/db

### Fortune

http://localhost:8888/fortunes

### Multiple Database Queries

http://localhost:8888/queries?queries=10

### Database Updates

http://localhost:8888/updates?queries=10

### Cache
http://localhost:8888/cached-queries?count=20
31 changes: 31 additions & 0 deletions frameworks/C++/paozhu/benchmark_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"framework": "paozhu",
"tests": [
{
"default": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"db_url": "/db",
"fortune_url": "/fortunes",
"query_url": "/queries?queries=",
"update_url": "/updates?queries=",
"cached_query_url": "/cached-queries?count=",
"port": 8888,
"approach": "Realistic",
"classification": "Fullstack",
"database": "MySQL",
"framework": "paozhu",
"language": "C++",
"flavor": "None",
"orm": "Micro",
"platform": "None",
"webserver": "None",
"os": "Linux",
"database_os": "Linux",
"display_name": "paozhu",
"notes": "",
"versus": "None"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[framework]
name = "fintrospect"
name = "paozhu"
authors = ["Huang ziquan <huanguuq@163.com>"]
github = "https://github.com/hggq/paozhu"

[main]
urls.plaintext = "/plaintext"
Expand All @@ -8,12 +10,13 @@ urls.db = "/db"
urls.query = "/queries?queries="
urls.update = "/updates?queries="
urls.fortune = "/fortunes"
urls.cached_query = "/cached-queries?count="
approach = "Realistic"
classification = "Micro"
classification = "Fullstack"
database = "MySQL"
database_os = "Linux"
os = "Linux"
orm = "Raw"
platform = "Netty"
orm = "Micro"
platform = "None"
webserver = "None"
versus = "finagle"
versus = "None"
54 changes: 54 additions & 0 deletions frameworks/C++/paozhu/paozhu.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM ubuntu:22.04
RUN apt-get update -yqq && apt-get install -yqq apt-utils software-properties-common wget unzip cmake git
RUN apt-get install -yqq gcc g++ openssl libssl-dev zlib1g-dev build-essential locales

RUN apt-get -y install brotli libbrotli-dev
RUN apt-get -y install libreadline-dev
RUN apt-get -y install mysql-client
RUN apt-get -y install libmysqlclient-dev

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

COPY ./ ./
WORKDIR /

# RUN wget https://github.com/hggq/paozhu/releases/download/v1.5.8/benchmark.zip
RUN git clone https://github.com/hggq/paozhu
# RUN unzip benchmark.zip
RUN rm -Rf ./paozhu/controller
RUN rm -Rf ./paozhu/libs
RUN mkdir ./paozhu/libs
RUN mkdir ./paozhu/libs/types

RUN mkdir ./paozhu/controller
RUN mkdir ./paozhu/controller/include
RUN mkdir ./paozhu/controller/src

COPY ./paozhu_benchmark/controller/include/techempower.h ./paozhu/controller/include/
COPY ./paozhu_benchmark/controller/src/techempower.cpp ./paozhu/controller/src/

COPY ./paozhu_benchmark/libs/types/techempower_json.h ./paozhu/libs/types/
COPY ./paozhu_benchmark/libs/types/techempower_json_jsonreflect.cpp ./paozhu/libs/types/

COPY ./paozhu_benchmark/common/autocontrolmethod.hpp ./paozhu/common/
COPY ./paozhu_benchmark/common/reghttpmethod_pre.hpp ./paozhu/common/
COPY ./paozhu_benchmark/common/reghttpmethod.hpp ./paozhu/common/
COPY ./paozhu_benchmark/common/json_reflect_headers.h ./paozhu/common/

COPY ./paozhu_benchmark/conf/server.conf ./paozhu/conf/server.conf
COPY ./paozhu_benchmark/conf/orm.conf ./paozhu/conf/orm.conf
COPY ./paozhu_benchmark/CMakeLists.txt ./paozhu/CMakeLists.txt

WORKDIR /paozhu
RUN unzip asio.zip

RUN cmake . -B build -DCMAKE_BUILD_TYPE=Release
RUN cmake --build build


EXPOSE 8888

CMD ./bin/paozhu
Loading

0 comments on commit 30be805

Please sign in to comment.