Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jaguililla committed Sep 24, 2024
2 parents 30c9830 + db30328 commit 2ae467e
Show file tree
Hide file tree
Showing 51 changed files with 222 additions and 464 deletions.
9 changes: 5 additions & 4 deletions frameworks/C++/userver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

This is the [userver](https://github.com/userver-framework/userver) portion of a [benchmarking test suite](https://github.com/TechEmpower/FrameworkBenchmarks) comparing a variety of web development platforms.

This benchmarks comes in two configurations: **userver** and **userver-bare**, where both configurations use exactly the same handlers code, but **userver-bare** replaces default http implementation of **userver** with custom one.
You see, **userver** being feature-rich framework widely used in production comes with a lot of useful functionality built-in (metrics, dynamic configuring, logging/tracing, congestion control etc...) none of which is of any use in benchmarks; although most of that can be disabled via configs, some parts remain, and these parts aren't free.
The aim of **userver-bare** is to explore practical limits of lower-level **userver** functionality when performance is an absolute must, while still being idiomatic userver code.

### Test Type Implementation Source Code

* [Plaintext](userver_benchmark/controllers/plaintext/handler.cpp)
* [Json](userver_benchmark/controllers/json/handler.cpp)
* [Fortunes](userver_benchmark/controllers/fortunes/handler.cpp)
* [Single Database Query](userver_benchmark/controllers/single_query/handler.cpp)
* [Multiple Database Queries](userver_benchmark/controllers/multiple_queries/handler.cpp)
* [Database Updates](userver_benchmark/controllers/updates/handler.cpp)
Expand All @@ -24,6 +21,10 @@ http://localhost:8080/plaintext

http://localhost:8080/json

### Fortunes

http://localhost:8080/fortunes

### Single Database Query

http://localhost:8080/db
Expand Down
24 changes: 0 additions & 24 deletions frameworks/C++/userver/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,6 @@
"display_name": "userver",
"notes": "",
"versus": "None"
},
"bare": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"db_url": "/db",
"query_url": "/queries?queries=",
"update_url": "/updates?queries=",
"cached_query_url": "/cached-queries?count=",
"fortune_url": "/fortunes",
"port": 8081,
"approach": "Realistic",
"classification": "Micro",
"database": "postgres",
"framework": "userver",
"language": "C++",
"flavor": "None",
"orm": "Micro",
"platform": "None",
"webserver": "None",
"os": "Linux",
"database_os": "Linux",
"display_name": "userver[bare]",
"notes": "",
"versus": "None"
}
}
]
Expand Down
18 changes: 0 additions & 18 deletions frameworks/C++/userver/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,3 @@ orm = "Micro"
platform = "None"
webserver = "None"
versus = "None"

[bare]
urls.plaintext = "/plaintext"
urls.json = "/json"
urls.db = "/db"
urls.query = "/queries?queries="
urls.update = "/updates?queries="
urls.cached_query = "/cached-queries?count="
urls.fortune = "/fortunes"
approach = "Realistic"
classification = "Micro"
database = "Postgres"
database_os = "Linux"
os = "Linux"
orm = "Micro"
platform = "None"
webserver = "None"
versus = "None"
29 changes: 0 additions & 29 deletions frameworks/C++/userver/userver-bare.dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion frameworks/C++/userver/userver.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN mkdir build && cd build && \
-DUSERVER_FEATURE_UTEST=0 \
-DUSERVER_FEATURE_POSTGRESQL=1 \
-DUSERVER_FEATURE_ERASE_LOG_WITH_LEVEL=warning \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native -flto=thin" -DCMAKE_C_FLAGS="-march=native -flto=thin" \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native" -DCMAKE_C_FLAGS="-march=native" \
-DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16 -DUSERVER_USE_LD=lld-16 \
-DUSERVER_LTO=0 .. && \
make -j $(nproc)
Expand Down
19 changes: 2 additions & 17 deletions frameworks/C++/userver/userver_benchmark/userver_techempower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,6 @@ class NoopTracingManager final
userver::server::http::HttpResponse&) const final {}
};

class MinimalMiddlewarePipelineBuilder final
: public userver::server::middlewares::PipelineBuilder {
public:
static constexpr std::string_view kName{
"minimal-middleware-pipeline-builder"};
using userver::server::middlewares::PipelineBuilder::PipelineBuilder;

private:
userver::server::middlewares::MiddlewaresList BuildPipeline(
userver::server::middlewares::MiddlewaresList) const override {
return {"userver-unknown-exceptions-handling-middleware"};
}
};

int Main(int argc, char* argv[]) {
auto component_list =
userver::components::MinimalServerComponentList()
Expand All @@ -78,10 +64,9 @@ int Main(int argc, char* argv[]) {
.Append<cached_queries::WorldCacheComponent>() // cache component
.Append<cached_queries::Handler>()
.Append<fortunes::Handler>()
// tracing and metrics tweaks
// tracing tweaks
.Append<NoopTracingManager>()
.Append<MinimalMiddlewarePipelineBuilder>()
// bare
// bare (not used in the benchmark currently)
.Append<bare::SimpleRouter>()
.Append<bare::SimpleServer>();

Expand Down
3 changes: 0 additions & 3 deletions frameworks/C++/userver/userver_configs/static_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ components_manager:
thread_name: main-worker # OS will show the threads of this task processor with 'main-worker' prefix.
worker_threads: 48
guess-cpu-limit: true
task-processor-queue: work-stealing-task-queue

fs-task-processor: # Make a separate task processor for filesystem bound tasks.
thread_name: fs-worker
Expand All @@ -29,7 +28,6 @@ components_manager:
handler-defaults:
set_tracing_headers: false
server-name: us
middleware-pipeline-builder: minimal-middleware-pipeline-builder
simple-router:
simple-server:
port: 8081
Expand Down Expand Up @@ -63,7 +61,6 @@ components_manager:
noop-tracing-manager:
tracing-manager-locator:
component-name: noop-tracing-manager
minimal-middleware-pipeline-builder:

plaintext-handler:
path: /plaintext
Expand Down
10 changes: 8 additions & 2 deletions frameworks/Elixir/phoenix/config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import Config

config :hello, HelloWeb.Endpoint,
adapter: Bandit.PhoenixAdapter,
http: [port: 8080, ip: {0, 0, 0, 0}],
http_options: [log_protocol_errors: false],
http: [
port: 8080,
ip: {0, 0, 0, 0},
http_options: [
compress: false,
log_protocol_errors: false
]
],
compress: false,
check_origin: false,
debug_errors: false,
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Elixir/phoenix/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defmodule Hello.Mixfile do
# Type `mix help deps` for examples and options
defp deps do
[
{:bandit, "~> 1.0.0"},
{:bandit, "1.5.7"},
{:gettext, "~> 0.20"},
{:ecto_sql, "~> 3.10"},
{:jason, "~> 1.2"},
Expand Down
6 changes: 3 additions & 3 deletions frameworks/Elixir/phoenix/mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%{
"bandit": {:hex, :bandit, "1.0.0", "2bd87bbf713d0eed0090f2fa162cd1676198122e6c2b68a201c706e354a6d5e5", [:mix], [{:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "32acf6ac030fee1f99fd9c3fcf81671911ae8637e0a61c98111861b466efafdb"},
"bandit": {:hex, :bandit, "1.5.7", "6856b1e1df4f2b0cb3df1377eab7891bec2da6a7fd69dc78594ad3e152363a50", [:mix], [{:hpax, "~> 1.0.0", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "f2dd92ae87d2cbea2fa9aa1652db157b6cba6c405cb44d4f6dd87abba41371cd"},
"castore": {:hex, :castore, "1.0.8", "dedcf20ea746694647f883590b82d9e96014057aff1d44d03ec90f36a5c0dc6e", [:mix], [], "hexpm", "0b2b66d2ee742cb1d9cb8c8be3b43c3a70ee8651f37b75a8b982e036752983f1"},
"cowboy": {:hex, :cowboy, "2.12.0", "f276d521a1ff88b2b9b4c54d0e753da6c66dd7be6c9fca3d9418b561828a3731", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "8a7abe6d183372ceb21caa2709bec928ab2b72e18a3911aa1771639bef82651e"},
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
Expand All @@ -10,7 +10,7 @@
"ecto_sql": {:hex, :ecto_sql, "3.11.3", "4eb7348ff8101fbc4e6bbc5a4404a24fecbe73a3372d16569526b0cf34ebc195", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e5f36e3d736b99c7fee3e631333b8394ade4bafe9d96d35669fca2d81c2be928"},
"expo": {:hex, :expo, "1.0.0", "647639267e088717232f4d4451526e7a9de31a3402af7fcbda09b27e9a10395a", [:mix], [], "hexpm", "18d2093d344d97678e8a331ca0391e85d29816f9664a25653fd7e6166827827c"},
"gettext": {:hex, :gettext, "0.25.0", "98a95a862a94e2d55d24520dd79256a15c87ea75b49673a2e2f206e6ebc42e5d", [:mix], [{:expo, "~> 0.5.1 or ~> 1.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "38e5d754e66af37980a94fb93bb20dcde1d2361f664b0a19f01e87296634051f"},
"hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"},
"hpax": {:hex, :hpax, "1.0.0", "28dcf54509fe2152a3d040e4e3df5b265dcb6cb532029ecbacf4ce52caea3fd2", [:mix], [], "hexpm", "7f1314731d711e2ca5fdc7fd361296593fc2542570b3105595bb0bc6d0fad601"},
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"},
"nebulex": {:hex, :nebulex, "2.6.3", "78af348ed9f8a338871b41e0b6de718c1808e627ce03fbe86598cbda2bdda2f5", [:mix], [{:decorator, "~> 1.4", [hex: :decorator, repo: "hexpm", optional: true]}, {:shards, "~> 1.1", [hex: :shards, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "09cdcbb62f8463ffcec7cae4936425ce91e25d92a6cd37e48b5dda7c851958d5"},
Expand All @@ -25,7 +25,7 @@
"plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"},
"postgrex": {:hex, :postgrex, "0.19.0", "f7d50e50cb42e0a185f5b9a6095125a9ab7e4abccfbe2ab820ab9aa92b71dbab", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "dba2d2a0a8637defbf2307e8629cb2526388ba7348f67d04ec77a5d6a72ecfae"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
"thousand_island": {:hex, :thousand_island, "1.3.5", "6022b6338f1635b3d32406ff98d68b843ba73b3aa95cfc27154223244f3a6ca5", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2be6954916fdfe4756af3239fb6b6d75d0b8063b5df03ba76fd8a4c87849e180"},
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
"websock_adapter": {:hex, :websock_adapter, "0.5.6", "0437fe56e093fd4ac422de33bf8fc89f7bc1416a3f2d732d8b2c8fd54792fe60", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "e04378d26b0af627817ae84c92083b7e97aca3121196679b73c73b99d0d133ea"},
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Java/micronaut/micronaut-data-jdbc.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle micronaut-data-jdbc:build -x test -x internalStartTestResourcesService --no-daemon

FROM openjdk:21
FROM openjdk:23
WORKDIR /micronaut
COPY --from=build /home/gradle/src/micronaut-data-jdbc/build/libs/micronaut-data-jdbc-all.jar micronaut.jar
COPY run_benchmark.sh run_benchmark.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle micronaut-data-mongodb:build -x test -x internalStartTestResourcesService --no-daemon

FROM openjdk:21
FROM openjdk:23
WORKDIR /micronaut
COPY --from=build /home/gradle/src/micronaut-data-mongodb/build/libs/micronaut-data-mongodb-all.jar micronaut.jar
COPY run_benchmark.sh run_benchmark.sh
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Java/micronaut/micronaut-data-r2dbc.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle micronaut-data-r2dbc:build -x test -x internalStartTestResourcesService --no-daemon

FROM openjdk:21
FROM openjdk:23
WORKDIR /micronaut
COPY --from=build /home/gradle/src/micronaut-data-r2dbc/build/libs/micronaut-data-r2dbc-all.jar micronaut.jar
COPY run_benchmark.sh run_benchmark.sh
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Java/micronaut/micronaut-graalvm.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:22
FROM container-registry.oracle.com/graalvm/native-image:23
RUN microdnf install findutils # Gradle 8.7 requires xargs
COPY . /home/gradle/src
WORKDIR /home/gradle/src
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:22
FROM container-registry.oracle.com/graalvm/native-image:23
RUN microdnf install findutils # Gradle 8.7 requires xargs
COPY . /home/gradle/src
WORKDIR /home/gradle/src
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Java/micronaut/micronaut-jdbc.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle micronaut-jdbc:build -x test -x internalStartTestResourcesService --no-daemon

FROM openjdk:21
FROM openjdk:23
WORKDIR /micronaut
COPY --from=build /home/gradle/src/micronaut-jdbc/build/libs/micronaut-jdbc-all.jar micronaut.jar
COPY run_benchmark.sh run_benchmark.sh
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:22
FROM container-registry.oracle.com/graalvm/native-image:23
RUN microdnf install findutils # Gradle 8.7 requires xargs
COPY . /home/gradle/src
WORKDIR /home/gradle/src
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Java/micronaut/micronaut-r2dbc.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle micronaut-r2dbc:build -x test -x internalStartTestResourcesService --no-daemon

FROM openjdk:21
FROM openjdk:23
WORKDIR /micronaut
COPY --from=build /home/gradle/src/micronaut-r2dbc/build/libs/micronaut-r2dbc-all.jar micronaut.jar
COPY run_benchmark.sh run_benchmark.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1
opcache.validate_timestamps=0
opcache.save_comments=0
opcache.enable_file_override=1
opcache.huge_code_pages=1
memory_limit=1024M

opcache.jit_buffer_size=128M
opcache.jit=1225
8 changes: 5 additions & 3 deletions frameworks/PHP/swoole/swoole-async-mysql.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ RUN apt update -yqq > /dev/null \
&& ./configure > /dev/null \
&& make -j8 > /dev/null \
&& make install > /dev/null \
&& echo "extension=swoole.so" > /etc/php/8.3/cli/conf.d/50-swoole.ini
&& echo "extension=swoole.so" > /etc/php/8.3/cli/conf.d/50-swoole.ini \
&& echo "memory_limit=1024M" >> /etc/php/8.3/cli/php.ini \
&& php -m

WORKDIR /swoole

ADD ./swoole-server.php /swoole
ADD ./php.ini /swoole
ADD 10-opcache.ini /swoole
ADD ./database.php /swoole

RUN cat /swoole/php.ini >> /etc/php/8.3/cli/php.ini
COPY 10-opcache.ini /etc/php/8.3/cli/conf.d/10-opcache.ini

EXPOSE 8080
CMD php /swoole/swoole-server.php
8 changes: 5 additions & 3 deletions frameworks/PHP/swoole/swoole-async-postgres.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ RUN apt update -yqq > /dev/null \
&& ./configure --enable-swoole-pgsql > /dev/null \
&& make -j8 > /dev/null \
&& make install > /dev/null \
&& echo "extension=swoole.so" > /etc/php/8.3/cli/conf.d/50-swoole.ini
&& echo "extension=swoole.so" > /etc/php/8.3/cli/conf.d/50-swoole.ini \
&& echo "memory_limit=1024M" >> /etc/php/8.3/cli/php.ini \
&& php -m

WORKDIR /swoole

ADD ./swoole-server.php /swoole
ADD ./php.ini /swoole
ADD 10-opcache.ini /swoole
ADD ./database.php /swoole

RUN cat /swoole/php.ini >> /etc/php/8.3/cli/php.ini
COPY 10-opcache.ini /etc/php/8.3/cli/conf.d/10-opcache.ini

EXPOSE 8080
CMD php /swoole/swoole-server.php
8 changes: 5 additions & 3 deletions frameworks/PHP/swoole/swoole-sync-mysql.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ RUN apt update -yqq > /dev/null \
&& ./configure > /dev/null \
&& make -j8 > /dev/null \
&& make install > /dev/null \
&& echo "extension=swoole.so" > /etc/php/8.3/cli/conf.d/50-swoole.ini
&& echo "extension=swoole.so" > /etc/php/8.3/cli/conf.d/50-swoole.ini \
&& echo "memory_limit=1024M" >> /etc/php/8.3/cli/php.ini \
&& php -m

WORKDIR /swoole

ADD ./swoole-server.php /swoole
ADD ./php.ini /swoole
ADD 10-opcache.ini /swoole
ADD ./database.php /swoole

RUN cat /swoole/php.ini >> /etc/php/8.3/cli/php.ini
COPY 10-opcache.ini /etc/php/8.3/cli/conf.d/10-opcache.ini

EXPOSE 8080
CMD php /swoole/swoole-server.php
8 changes: 5 additions & 3 deletions frameworks/PHP/swoole/swoole-sync-postgres.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ RUN apt update -yqq > /dev/null \
&& ./configure > /dev/null \
&& make -j8 > /dev/null \
&& make install > /dev/null \
&& echo "extension=swoole.so" > /etc/php/8.3/cli/conf.d/50-swoole.ini
&& echo "extension=swoole.so" > /etc/php/8.3/cli/conf.d/50-swoole.ini \
&& echo "memory_limit=1024M" >> /etc/php/8.3/cli/php.ini \
&& php -m

WORKDIR /swoole

ADD ./swoole-server.php /swoole
ADD ./php.ini /swoole
ADD 10-opcache.ini /swoole
ADD ./database.php /swoole

RUN cat /swoole/php.ini >> /etc/php/8.3/cli/php.ini
COPY 10-opcache.ini /etc/php/8.3/cli/conf.d/10-opcache.ini

EXPOSE 8080
CMD php /swoole/swoole-server.php
Loading

0 comments on commit 2ae467e

Please sign in to comment.