Created
August 30, 2020 17:09
-
-
Save daxim/757d90f597b067e49c5bae30e255d083 to your computer and use it in GitHub Desktop.
FrameworkBenchmarks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 06fd6913d2becdd0d994b0ac786516618bf0f420 Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Lars=20D=C9=AA=E1=B4=87=E1=B4=84=E1=B4=8B=E1=B4=8F?= | |
=?UTF-8?q?=E1=B4=A1=20=E8=BF=AA=E6=8B=89=E6=96=AF?= <daxim@cpan.org> | |
Date: Sun, 8 Jul 2018 15:05:31 +0200 | |
Subject: [PATCH 1/3] normalise so we can have meaningfully diffs | |
`jq . -S` was used | |
--- | |
frameworks/Perl/dancer/benchmark_config.json | 44 +++++----- | |
frameworks/Perl/kelp/benchmark_config.json | 84 ++++++++++--------- | |
.../Perl/mojolicious/benchmark_config.json | 50 +++++------ | |
frameworks/Perl/plack/benchmark_config.json | 40 ++++----- | |
.../Perl/web-simple/benchmark_config.json | 42 +++++----- | |
5 files changed, 135 insertions(+), 125 deletions(-) | |
diff --git a/frameworks/Perl/dancer/benchmark_config.json b/frameworks/Perl/dancer/benchmark_config.json | |
index a97d27095..52f37ae3c 100644 | |
--- a/frameworks/Perl/dancer/benchmark_config.json | |
+++ b/frameworks/Perl/dancer/benchmark_config.json | |
@@ -1,24 +1,26 @@ | |
{ | |
"framework": "dancer", | |
- "tests": [{ | |
- "default": { | |
- "json_url": "/json", | |
- "db_url": "/db", | |
- "query_url": "/db?queries=", | |
- "port": 8080, | |
- "approach": "Realistic", | |
- "classification": "Fullstack", | |
- "database": "MySQL", | |
- "framework": "dancer", | |
- "language": "Perl", | |
- "orm": "Raw", | |
- "platform": "Plack", | |
- "webserver": "Starman", | |
- "os": "Linux", | |
- "database_os": "Linux", | |
- "display_name": "dancer", | |
- "notes": "", | |
- "versus": "" | |
+ "tests": [ | |
+ { | |
+ "default": { | |
+ "approach": "Realistic", | |
+ "classification": "Fullstack", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "dancer", | |
+ "framework": "dancer", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/db?queries=", | |
+ "versus": "", | |
+ "webserver": "Starman" | |
+ } | |
} | |
- }] | |
-} | |
\ No newline at end of file | |
+ ] | |
+} | |
diff --git a/frameworks/Perl/kelp/benchmark_config.json b/frameworks/Perl/kelp/benchmark_config.json | |
index 11f7eabab..166de8f4c 100644 | |
--- a/frameworks/Perl/kelp/benchmark_config.json | |
+++ b/frameworks/Perl/kelp/benchmark_config.json | |
@@ -1,45 +1,47 @@ | |
{ | |
"framework": "kelp", | |
- "tests": [{ | |
- "default": { | |
- "db_url": "/db/mysql", | |
- "query_url": "/queries/mysql?queries=", | |
- "fortune_url": "/fortunes/mysql", | |
- "plaintext_url": "/plaintext", | |
- "port": 8080, | |
- "approach": "Realistic", | |
- "classification": "Fullstack", | |
- "database": "MySQL", | |
- "framework": "kelp", | |
- "language": "Perl", | |
- "orm": "Raw", | |
- "platform": "Plack", | |
- "webserver": "Starman", | |
- "os": "Linux", | |
- "database_os": "Linux", | |
- "display_name": "kelp", | |
- "notes": "", | |
- "versus": "" | |
- }, | |
- "mongodb": { | |
- "db_url": "/db/mongo", | |
- "query_url": "/queries/mongo?queries=", | |
- "fortune_url": "/fortunes/mongo", | |
- "plaintext_url": "/plaintext", | |
- "port": 8080, | |
- "approach": "Realistic", | |
- "classification": "Fullstack", | |
- "database": "MongoDB", | |
- "framework": "kelp", | |
- "language": "Perl", | |
- "orm": "Raw", | |
- "platform": "Plack", | |
- "webserver": "Starman", | |
- "os": "Linux", | |
- "database_os": "Linux", | |
- "display_name": "kelp", | |
- "notes": "", | |
- "versus": "" | |
+ "tests": [ | |
+ { | |
+ "default": { | |
+ "approach": "Realistic", | |
+ "classification": "Fullstack", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db/mysql", | |
+ "display_name": "kelp", | |
+ "fortune_url": "/fortunes/mysql", | |
+ "framework": "kelp", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries/mysql?queries=", | |
+ "versus": "", | |
+ "webserver": "Starman" | |
+ }, | |
+ "mongodb": { | |
+ "approach": "Realistic", | |
+ "classification": "Fullstack", | |
+ "database": "MongoDB", | |
+ "database_os": "Linux", | |
+ "db_url": "/db/mongo", | |
+ "display_name": "kelp", | |
+ "fortune_url": "/fortunes/mongo", | |
+ "framework": "kelp", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries/mongo?queries=", | |
+ "versus": "", | |
+ "webserver": "Starman" | |
+ } | |
} | |
- }] | |
+ ] | |
} | |
diff --git a/frameworks/Perl/mojolicious/benchmark_config.json b/frameworks/Perl/mojolicious/benchmark_config.json | |
index 8da7182f7..ab585dd65 100644 | |
--- a/frameworks/Perl/mojolicious/benchmark_config.json | |
+++ b/frameworks/Perl/mojolicious/benchmark_config.json | |
@@ -1,28 +1,30 @@ | |
{ | |
"framework": "mojolicious", | |
- "tests": [{ | |
- "default": { | |
- "setup_file": "setup", | |
- "json_url": "/json", | |
- "db_url": "/db", | |
- "query_url": "/queries?queries=", | |
- "fortune_url": "/fortunes", | |
- "update_url": "/updates?queries=", | |
- "plaintext_url": "/plaintext", | |
- "port": 8080, | |
- "approach": "Realistic", | |
- "classification": "Fullstack", | |
- "database": "Postgres", | |
- "framework": "mojolicious", | |
- "language": "Perl", | |
- "orm": "Raw", | |
- "platform": "None", | |
- "webserver": "Hypnotoad", | |
- "os": "Linux", | |
- "database_os": "Linux", | |
- "display_name": "Mojolicious", | |
- "notes": "", | |
- "versus": "" | |
+ "tests": [ | |
+ { | |
+ "default": { | |
+ "approach": "Realistic", | |
+ "classification": "Fullstack", | |
+ "database": "Postgres", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "Mojolicious", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "mojolicious", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "None", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "setup_file": "setup", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "Hypnotoad" | |
+ } | |
} | |
- }] | |
+ ] | |
} | |
diff --git a/frameworks/Perl/plack/benchmark_config.json b/frameworks/Perl/plack/benchmark_config.json | |
index 8b53480f8..1d09abc44 100644 | |
--- a/frameworks/Perl/plack/benchmark_config.json | |
+++ b/frameworks/Perl/plack/benchmark_config.json | |
@@ -1,23 +1,25 @@ | |
{ | |
"framework": "plack", | |
- "tests": [{ | |
- "default": { | |
- "json_url": "/json", | |
- "db_url": "/db", | |
- "port": 8080, | |
- "approach": "Realistic", | |
- "classification": "Micro", | |
- "database": "MySQL", | |
- "framework": "plack", | |
- "language": "Perl", | |
- "orm": "Raw", | |
- "platform": "Starlet", | |
- "webserver": "nginx", | |
- "os": "Linux", | |
- "database_os": "Linux", | |
- "display_name": "plack", | |
- "notes": "", | |
- "versus": "" | |
+ "tests": [ | |
+ { | |
+ "default": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack", | |
+ "framework": "plack", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "platform": "Starlet", | |
+ "port": 8080, | |
+ "versus": "", | |
+ "webserver": "nginx" | |
+ } | |
} | |
- }] | |
+ ] | |
} | |
diff --git a/frameworks/Perl/web-simple/benchmark_config.json b/frameworks/Perl/web-simple/benchmark_config.json | |
index f169a2613..d868d4cf3 100644 | |
--- a/frameworks/Perl/web-simple/benchmark_config.json | |
+++ b/frameworks/Perl/web-simple/benchmark_config.json | |
@@ -1,24 +1,26 @@ | |
{ | |
"framework": "web-simple", | |
- "tests": [{ | |
- "default": { | |
- "json_url": "/json", | |
- "db_url": "/db", | |
- "query_url": "/query?queries=", | |
- "port": 8080, | |
- "approach": "Realistic", | |
- "classification": "Micro", | |
- "database": "MySQL", | |
- "framework": "web-simple", | |
- "language": "Perl", | |
- "orm": "Raw", | |
- "platform": "Plack", | |
- "webserver": "Starman", | |
- "os": "Linux", | |
- "database_os": "Linux", | |
- "display_name": "web-simple", | |
- "notes": "", | |
- "versus": "" | |
+ "tests": [ | |
+ { | |
+ "default": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "web-simple", | |
+ "framework": "web-simple", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/query?queries=", | |
+ "versus": "", | |
+ "webserver": "Starman" | |
+ } | |
} | |
- }] | |
+ ] | |
} | |
-- | |
2.28.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 28309fdd6c684afc05fa9b5f027fb28514d34480 Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Lars=20D=C9=AA=E1=B4=87=E1=B4=84=E1=B4=8B=E1=B4=8F?= | |
=?UTF-8?q?=E1=B4=A1=20=E8=BF=AA=E6=8B=89=E6=96=AF?= <daxim@cpan.org> | |
Date: Sun, 8 Jul 2018 15:06:51 +0200 | |
Subject: [PATCH 2/3] update to latest stable | |
--- | |
frameworks/Perl/dancer/dancer.dockerfile | 2 +- | |
frameworks/Perl/kelp/kelp-mongodb.dockerfile | 2 +- | |
frameworks/Perl/kelp/kelp.dockerfile | 2 +- | |
frameworks/Perl/mojolicious/mojolicious.dockerfile | 2 +- | |
frameworks/Perl/plack/plack.dockerfile | 2 +- | |
frameworks/Perl/web-simple/web-simple.dockerfile | 2 +- | |
6 files changed, 6 insertions(+), 6 deletions(-) | |
diff --git a/frameworks/Perl/dancer/dancer.dockerfile b/frameworks/Perl/dancer/dancer.dockerfile | |
index 1e4b369c0..76dcfe3a7 100644 | |
--- a/frameworks/Perl/dancer/dancer.dockerfile | |
+++ b/frameworks/Perl/dancer/dancer.dockerfile | |
@@ -1,4 +1,4 @@ | |
-FROM perl:5.26 | |
+FROM perl:5.28 | |
RUN apt update -yqq && apt install -yqq nginx | |
diff --git a/frameworks/Perl/kelp/kelp-mongodb.dockerfile b/frameworks/Perl/kelp/kelp-mongodb.dockerfile | |
index 39079161d..e39ae7085 100644 | |
--- a/frameworks/Perl/kelp/kelp-mongodb.dockerfile | |
+++ b/frameworks/Perl/kelp/kelp-mongodb.dockerfile | |
@@ -1,4 +1,4 @@ | |
-FROM perl:5.26 | |
+FROM perl:5.28 | |
RUN apt update -yqq && apt install -yqq nginx | |
diff --git a/frameworks/Perl/kelp/kelp.dockerfile b/frameworks/Perl/kelp/kelp.dockerfile | |
index d06afb18f..9e30aba77 100644 | |
--- a/frameworks/Perl/kelp/kelp.dockerfile | |
+++ b/frameworks/Perl/kelp/kelp.dockerfile | |
@@ -1,4 +1,4 @@ | |
-FROM perl:5.26 | |
+FROM perl:5.28 | |
RUN apt update -yqq && apt install -yqq nginx | |
diff --git a/frameworks/Perl/mojolicious/mojolicious.dockerfile b/frameworks/Perl/mojolicious/mojolicious.dockerfile | |
index 22773da8a..0519f282b 100644 | |
--- a/frameworks/Perl/mojolicious/mojolicious.dockerfile | |
+++ b/frameworks/Perl/mojolicious/mojolicious.dockerfile | |
@@ -1,4 +1,4 @@ | |
-FROM perl:5.26 | |
+FROM perl:5.28 | |
WORKDIR /mojo | |
diff --git a/frameworks/Perl/plack/plack.dockerfile b/frameworks/Perl/plack/plack.dockerfile | |
index 5ae840602..aa5a3689d 100644 | |
--- a/frameworks/Perl/plack/plack.dockerfile | |
+++ b/frameworks/Perl/plack/plack.dockerfile | |
@@ -1,4 +1,4 @@ | |
-FROM perl:5.26 | |
+FROM perl:5.28 | |
RUN apt update -yqq && apt install -yqq nginx | |
diff --git a/frameworks/Perl/web-simple/web-simple.dockerfile b/frameworks/Perl/web-simple/web-simple.dockerfile | |
index 030348a16..ecb26c677 100644 | |
--- a/frameworks/Perl/web-simple/web-simple.dockerfile | |
+++ b/frameworks/Perl/web-simple/web-simple.dockerfile | |
@@ -1,4 +1,4 @@ | |
-FROM perl:5.26 | |
+FROM perl:5.28 | |
RUN apt update -yqq && apt install -yqq nginx | |
-- | |
2.28.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 004c5be2e85fe403b42e4c67265b1f9a369a2010 Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Lars=20D=C9=AA=E1=B4=87=E1=B4=84=E1=B4=8B=E1=B4=8F?= | |
=?UTF-8?q?=E1=B4=A1=20=E8=BF=AA=E6=8B=89=E6=96=AF?= <daxim@cpan.org> | |
Date: Sun, 12 Aug 2018 10:50:52 +0200 | |
Subject: [PATCH 3/3] wip | |
--- | |
frameworks/Perl/catalyst/README.md | 0 | |
.../Perl/catalyst/benchmark_config.json | 29 ++ | |
frameworks/Perl/catalyst/catalyst.dockerfile | 28 ++ | |
frameworks/Perl/catalyst/lib/MyApp.pm | 15 ++ | |
.../catalyst/lib/MyApp/Controller/Root.pm | 55 ++++ | |
frameworks/Perl/catalyst/myapp.conf | 3 + | |
frameworks/Perl/catalyst/myapp.psgi | 8 + | |
.../Perl/{plack => catalyst}/nginx.conf | 2 +- | |
frameworks/Perl/plack/app-extraheaders.psgi | 135 ++++++++++ | |
frameworks/Perl/plack/app.pid | 1 - | |
frameworks/Perl/plack/app.psgi | 110 ++++++-- | |
frameworks/Perl/plack/benchmark_config.json | 252 +++++++++++++++++- | |
frameworks/Perl/plack/plack-corona.dockerfile | 22 ++ | |
.../Perl/plack/plack-feersum.dockerfile | 23 ++ | |
.../Perl/plack/plack-gazelle.dockerfile | 22 ++ | |
frameworks/Perl/plack/plack-gepok.dockerfile | 22 ++ | |
.../plack/plack-http-server-simple.dockerfile | 23 ++ | |
.../Perl/plack/plack-monoceros.dockerfile | 22 ++ | |
.../plack-net-async-http-server.dockerfile | 23 ++ | |
.../plack/plack-postgres.dockerfile.disabled | 21 ++ | |
.../Perl/plack/plack-starlet.dockerfile | 22 ++ | |
.../Perl/plack/plack-starlight.dockerfile | 22 ++ | |
.../Perl/plack/plack-starman.dockerfile | 22 ++ | |
.../plack/plack-twiggy-prefork.dockerfile | 22 ++ | |
frameworks/Perl/plack/plack.dockerfile | 36 ++- | |
25 files changed, 894 insertions(+), 46 deletions(-) | |
create mode 100644 frameworks/Perl/catalyst/README.md | |
create mode 100644 frameworks/Perl/catalyst/benchmark_config.json | |
create mode 100644 frameworks/Perl/catalyst/catalyst.dockerfile | |
create mode 100644 frameworks/Perl/catalyst/lib/MyApp.pm | |
create mode 100644 frameworks/Perl/catalyst/lib/MyApp/Controller/Root.pm | |
create mode 100644 frameworks/Perl/catalyst/myapp.conf | |
create mode 100644 frameworks/Perl/catalyst/myapp.psgi | |
rename frameworks/Perl/{plack => catalyst}/nginx.conf (87%) | |
create mode 100644 frameworks/Perl/plack/app-extraheaders.psgi | |
delete mode 100644 frameworks/Perl/plack/app.pid | |
create mode 100644 frameworks/Perl/plack/plack-corona.dockerfile | |
create mode 100644 frameworks/Perl/plack/plack-feersum.dockerfile | |
create mode 100644 frameworks/Perl/plack/plack-gazelle.dockerfile | |
create mode 100644 frameworks/Perl/plack/plack-gepok.dockerfile | |
create mode 100644 frameworks/Perl/plack/plack-http-server-simple.dockerfile | |
create mode 100644 frameworks/Perl/plack/plack-monoceros.dockerfile | |
create mode 100644 frameworks/Perl/plack/plack-net-async-http-server.dockerfile | |
create mode 100644 frameworks/Perl/plack/plack-postgres.dockerfile.disabled | |
create mode 100644 frameworks/Perl/plack/plack-starlet.dockerfile | |
create mode 100644 frameworks/Perl/plack/plack-starlight.dockerfile | |
create mode 100644 frameworks/Perl/plack/plack-starman.dockerfile | |
create mode 100644 frameworks/Perl/plack/plack-twiggy-prefork.dockerfile | |
diff --git a/frameworks/Perl/catalyst/README.md b/frameworks/Perl/catalyst/README.md | |
new file mode 100644 | |
index 000000000..e69de29bb | |
diff --git a/frameworks/Perl/catalyst/benchmark_config.json b/frameworks/Perl/catalyst/benchmark_config.json | |
new file mode 100644 | |
index 000000000..3884ac064 | |
--- /dev/null | |
+++ b/frameworks/Perl/catalyst/benchmark_config.json | |
@@ -0,0 +1,29 @@ | |
+{ | |
+ "framework": "catalyst", | |
+ "tests": [ | |
+ { | |
+ "default": { | |
+ "approach": "Realistic", | |
+ "classification": "Full-stack", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "Catalyst", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "Catalyst", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "nginx" | |
+ } | |
+ } | |
+ ] | |
+} | |
diff --git a/frameworks/Perl/catalyst/catalyst.dockerfile b/frameworks/Perl/catalyst/catalyst.dockerfile | |
new file mode 100644 | |
index 000000000..72616f7d5 | |
--- /dev/null | |
+++ b/frameworks/Perl/catalyst/catalyst.dockerfile | |
@@ -0,0 +1,28 @@ | |
+FROM perl:5.28 | |
+RUN apt update -yqq && apt install -yqq nginx | |
+WORKDIR /catalyst | |
+ | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Starman@0.4014 \ | |
+ Catalyst::Runtime@5.90118 | |
+ | |
+ADD ./myapp.psgi /catalyst/ | |
+ADD ./myapp.conf /catalyst/ | |
+ADD ./nginx.conf /catalyst/ | |
+ADD ./lib/MyApp.pm /catalyst/lib/ | |
+ADD ./lib/MyApp/Controller/Root.pm /catalyst/lib/MyApp/Controller/ | |
+ | |
+ENV DBI_DRIVER mysql | |
+CMD nginx -c /catalyst/nginx.conf && \ | |
+ plackup -I /catalyst/lib -E production -s Starman --workers=$(nproc) -l /tmp/perl-catalyst.sock -a /catalyst/myapp.psgi | |
diff --git a/frameworks/Perl/catalyst/lib/MyApp.pm b/frameworks/Perl/catalyst/lib/MyApp.pm | |
new file mode 100644 | |
index 000000000..049db0bf2 | |
--- /dev/null | |
+++ b/frameworks/Perl/catalyst/lib/MyApp.pm | |
@@ -0,0 +1,15 @@ | |
+package MyApp; | |
+use Moose; | |
+use namespace::autoclean; | |
+use Catalyst::Runtime 5.80; | |
+use Catalyst qw(); | |
+extends 'Catalyst'; | |
+ | |
+__PACKAGE__->config( | |
+ name => 'MyApp', | |
+ disable_component_resolution_regex_fallback => 1, | |
+ enable_catalyst_header => 1, | |
+); | |
+__PACKAGE__->setup(); | |
+ | |
+1; | |
diff --git a/frameworks/Perl/catalyst/lib/MyApp/Controller/Root.pm b/frameworks/Perl/catalyst/lib/MyApp/Controller/Root.pm | |
new file mode 100644 | |
index 000000000..cf4b43c91 | |
--- /dev/null | |
+++ b/frameworks/Perl/catalyst/lib/MyApp/Controller/Root.pm | |
@@ -0,0 +1,55 @@ | |
+package MyApp::Controller::Root; | |
+use Moose; | |
+use namespace::autoclean; | |
+use Cpanel::JSON::XS qw(encode_json); | |
+use DBI qw(); | |
+use Unicode::UTF8 qw(encode_utf8); | |
+ | |
+BEGIN { extends 'Catalyst::Controller' } | |
+__PACKAGE__->config(namespace => ''); | |
+ | |
+my $dbh = DBI->connect_cached( | |
+ 'dbi::database=hello_world;host=tfb-database', | |
+ 'benchmarkdbuser', | |
+ 'benchmarkdbpass', | |
+ { | |
+ AutoInactiveDestroy => 1, | |
+ PrintError => 0, | |
+ RaiseError => 1, | |
+ 'mysql' eq $ENV{DBI_DRIVER} ? (mysql_enable_utf8 => 1) : | |
+ 'Pg' eq $ENV{DBI_DRIVER} ? (pg_enable_utf8 => 1) : | |
+ () | |
+ } | |
+) or die $DBI::errstr; | |
+ | |
+my @query = ('SELECT id, randomNumber FROM World WHERE id = ?', {Slice => {}}); | |
+my @header = qw(Content-Type application/json); | |
+ | |
+sub index :Path :Args(0) { | |
+ my ($self, $c) = @_; | |
+ $c->response->body( $c->welcome_message ); | |
+} | |
+ | |
+sub queries :Local { | |
+ my ($self, $c) = @_; | |
+ my ($n) = $c->request->param('queries'); | |
+ $n =~ tr/0-9//cd; | |
+ $n ||= 1; | |
+ $n = 500 if $n > 500; | |
+ my $res = $c->response; | |
+ $res->status(200); | |
+ $res->headers->header(@header); | |
+ $res->body(encode_json [map { | |
+ ($dbh->selectall_array(@query, int rand 10000 + 1))[0] | |
+ } 1..$n]); | |
+} | |
+ | |
+sub default :Path { | |
+ my ($self, $c) = @_; | |
+ $c->response->status(404); | |
+ $c->response->body('Page not found'); | |
+} | |
+ | |
+__PACKAGE__->meta->make_immutable; | |
+ | |
+1; | |
diff --git a/frameworks/Perl/catalyst/myapp.conf b/frameworks/Perl/catalyst/myapp.conf | |
new file mode 100644 | |
index 000000000..6c39ebf7e | |
--- /dev/null | |
+++ b/frameworks/Perl/catalyst/myapp.conf | |
@@ -0,0 +1,3 @@ | |
+# rename this file to myapp.yml and put a ':' after 'name' if | |
+# you want to use YAML like in old versions of Catalyst | |
+name MyApp | |
diff --git a/frameworks/Perl/catalyst/myapp.psgi b/frameworks/Perl/catalyst/myapp.psgi | |
new file mode 100644 | |
index 000000000..f28112968 | |
--- /dev/null | |
+++ b/frameworks/Perl/catalyst/myapp.psgi | |
@@ -0,0 +1,8 @@ | |
+use strict; | |
+use warnings; | |
+ | |
+use MyApp; | |
+ | |
+my $app = MyApp->apply_default_middlewares(MyApp->psgi_app); | |
+$app; | |
+ | |
diff --git a/frameworks/Perl/plack/nginx.conf b/frameworks/Perl/catalyst/nginx.conf | |
similarity index 87% | |
rename from frameworks/Perl/plack/nginx.conf | |
rename to frameworks/Perl/catalyst/nginx.conf | |
index 3d838667e..07d3ef21b 100644 | |
--- a/frameworks/Perl/plack/nginx.conf | |
+++ b/frameworks/Perl/catalyst/nginx.conf | |
@@ -26,7 +26,7 @@ http { | |
server_name localhost; | |
location / { | |
- proxy_pass http://unix:/tmp/perl-plack.sock; | |
+ proxy_pass http://unix:/tmp/perl-catalyst.sock; | |
} | |
} | |
diff --git a/frameworks/Perl/plack/app-extraheaders.psgi b/frameworks/Perl/plack/app-extraheaders.psgi | |
new file mode 100644 | |
index 000000000..db6a6ca21 | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/app-extraheaders.psgi | |
@@ -0,0 +1,135 @@ | |
+use v5.28; | |
+use utf8; | |
+use strict; | |
+use warnings; | |
+use Cpanel::JSON::XS qw(encode_json); | |
+use DBI qw(); | |
+use File::Spec qw(); | |
+use HTTP::Date qw(); | |
+use Sort::Key qw(keysort_inplace); | |
+use Text::Xslate qw(); | |
+use Unicode::UTF8 qw(encode_utf8); | |
+ | |
+my $dbh = DBI->connect_cached( | |
+ 'dbi::database=hello_world;host=tfb-database', | |
+ 'benchmarkdbuser', | |
+ 'benchmarkdbpass', | |
+ { | |
+ AutoInactiveDestroy => 1, | |
+ PrintError => 0, | |
+ RaiseError => 1, | |
+ 'mysql' eq $ENV{DBI_DRIVER} ? (mysql_enable_utf8 => 1) : | |
+ 'Pg' eq $ENV{DBI_DRIVER} ? (pg_enable_utf8 => 1) : | |
+ () | |
+ } | |
+) or die $DBI::errstr; | |
+ | |
+my @query = ('SELECT id, randomNumber FROM World WHERE id = ?', {Slice => {}}); | |
+my @header = qw(Content-Type application/json); | |
+my $tx = Text::Xslate->new( | |
+ cache_dir => File::Spec->tmpdir, | |
+ path => { | |
+ fortunes => <<'TEMPLATE' | |
+<!DOCTYPE html> | |
+<html> | |
+<head><title>Fortunes</title></head> | |
+<body> | |
+<table> | |
+<tr><th>id</th><th>message</th></tr> | |
+: for $fortunes -> $f { | |
+<tr><td><: $f.id :></td><td><: $f.message :></td></tr> | |
+: } | |
+</table> | |
+</body> | |
+</html> | |
+TEMPLATE | |
+ }, | |
+); | |
+ | |
+my $app = sub { | |
+ my ($env) = @_; | |
+ $env->{server_software} = $ENV{SERVER_NAME} if $ENV{SERVER_NAME}; | |
+ if ($env->{PATH_INFO} eq '/json') { | |
+ my $body = encode_json { | |
+ message => 'Hello, World!' | |
+ }; | |
+ return [200, [ | |
+ @header, | |
+ Date => HTTP::Date::time2str, | |
+ Server => $env->{server_software}, | |
+ 'Content-Length' => length($body), | |
+ ], [$body]]; | |
+ } elsif ($env->{PATH_INFO} eq '/db') { | |
+ my $body = encode_json(($dbh->selectall_array( | |
+ @query, int rand 10000 + 1 | |
+ ))[0]); | |
+ return [200, [ | |
+ @header, | |
+ Date => HTTP::Date::time2str, | |
+ Server => $env->{server_software}, | |
+ 'Content-Length' => length($body), | |
+ ], [$body]]; | |
+ } elsif ($env->{PATH_INFO} eq '/queries') { | |
+ my ($n) = ($env->{QUERY_STRING} || "") =~ /queries=(\d+)/; | |
+ $n ||= 1; | |
+ $n = 500 if $n > 500; | |
+ my $body = encode_json [map { | |
+ ($dbh->selectall_array(@query, int rand 10000 + 1))[0] | |
+ } 1..$n]; | |
+ return [200, [ | |
+ @header, | |
+ Date => HTTP::Date::time2str, | |
+ Server => $env->{server_software}, | |
+ 'Content-Length' => length($body), | |
+ ], [$body]]; | |
+ } elsif ($env->{PATH_INFO} eq '/fortunes') { | |
+ my @fortunes = $dbh->selectall_array( | |
+ 'SELECT id, message FROM Fortune', {Slice => {}} | |
+ ); | |
+ push @fortunes, { | |
+ id => 0, message => 'Additional fortune added at request time.' | |
+ }; | |
+ keysort_inplace {$_->{message}} @fortunes; | |
+ my $body = encode_utf8 $tx->render(fortunes => {fortunes => \@fortunes}); | |
+ return [200, [ | |
+ qw(Content-Type text/html;charset=UTF-8), | |
+ Date => HTTP::Date::time2str, | |
+ Server => $env->{server_software}, | |
+ 'Content-Length' => length($body), | |
+ ], [$body]]; | |
+ } elsif ($env->{PATH_INFO} eq '/updates') { | |
+ my ($n) = ($env->{QUERY_STRING} || "") =~ /queries=(\d+)/; | |
+ $n ||= 1; | |
+ $n = 500 if $n > 500; | |
+ my @r = map { | |
+ $_->{randomNumber} = int rand 10000 + 1; | |
+ $dbh->do( | |
+ 'UPDATE World SET randomNumber = ? WHERE id = ?', | |
+ undef, | |
+ $_->{randomNumber}, | |
+ $_->{id} | |
+ ); | |
+ $_ | |
+ } map { | |
+ ($dbh->selectall_array(@query, int rand 10000 + 1))[0] | |
+ } 1..$n; | |
+ my $body = encode_json \@r; | |
+ return [200, [ | |
+ @header, | |
+ Date => HTTP::Date::time2str, | |
+ Server => $env->{server_software}, | |
+ 'Content-Length' => length($body), | |
+ ], [$body]]; | |
+ } elsif ($env->{PATH_INFO} eq '/plaintext') { | |
+ state $res = ['Hello, World!']; | |
+ return [200, [ | |
+ qw(Content-Type text/plain), | |
+ Date => HTTP::Date::time2str, | |
+ Server => $env->{server_software}, | |
+ 'Content-Length' => 13, | |
+ ], $res]; | |
+ } | |
+ return [404, [], ['not found']]; | |
+}; | |
+ | |
+$app; | |
diff --git a/frameworks/Perl/plack/app.pid b/frameworks/Perl/plack/app.pid | |
deleted file mode 100644 | |
index 8a1c0208e..000000000 | |
--- a/frameworks/Perl/plack/app.pid | |
+++ /dev/null | |
@@ -1 +0,0 @@ | |
-12846 | |
\ No newline at end of file | |
diff --git a/frameworks/Perl/plack/app.psgi b/frameworks/Perl/plack/app.psgi | |
index 8e609ba88..de041371b 100644 | |
--- a/frameworks/Perl/plack/app.psgi | |
+++ b/frameworks/Perl/plack/app.psgi | |
@@ -1,34 +1,100 @@ | |
-use strict; | |
-use v5.16; | |
+use v5.28; | |
use utf8; | |
-use JSON::XS qw(encode_json); | |
-use DBI; | |
+use strict; | |
+use warnings; | |
+use Cpanel::JSON::XS qw(encode_json); | |
+use DBI qw(); | |
+use File::Spec qw(); | |
+use Sort::Key qw(keysort_inplace); | |
+use Text::Xslate qw(); | |
+use Unicode::UTF8 qw(encode_utf8); | |
my $dbh = DBI->connect_cached( | |
- 'dbi:mysql:database=hello_world;host=tfb-database;port=3306', | |
+ 'dbi::database=hello_world;host=tfb-database', | |
'benchmarkdbuser', | |
'benchmarkdbpass', | |
- { AutoInactiveDestroy => 1, mysql_enable_utf8 => 1 } | |
-) || die $!; | |
+ { | |
+ AutoInactiveDestroy => 1, | |
+ PrintError => 0, | |
+ RaiseError => 1, | |
+ 'mysql' eq $ENV{DBI_DRIVER} ? (mysql_enable_utf8 => 1) : | |
+ 'Pg' eq $ENV{DBI_DRIVER} ? (pg_enable_utf8 => 1) : | |
+ () | |
+ } | |
+) or die $DBI::errstr; | |
-my $query = 'SELECT id, randomNumber FROM World WHERE id = ?'; | |
-my $header = [qw(Content-Type application/json)]; | |
-my $message = { message => 'Hello, World!' }; | |
+my @query = ('SELECT id, randomNumber FROM World WHERE id = ?', {Slice => {}}); | |
+my @header = qw(Content-Type application/json); | |
+my $tx = Text::Xslate->new( | |
+ cache_dir => File::Spec->tmpdir, | |
+ path => { | |
+ fortunes => <<'TEMPLATE' | |
+<!DOCTYPE html> | |
+<html> | |
+<head><title>Fortunes</title></head> | |
+<body> | |
+<table> | |
+<tr><th>id</th><th>message</th></tr> | |
+: for $fortunes -> $f { | |
+<tr><td><: $f.id :></td><td><: $f.message :></td></tr> | |
+: } | |
+</table> | |
+</body> | |
+</html> | |
+TEMPLATE | |
+ }, | |
+); | |
my $app = sub { | |
- my $env = shift; | |
- if ( $env->{PATH_INFO} eq '/json' ) { | |
- return [ 200, $header, [ encode_json($message) ]]; | |
+ my ($env) = @_; | |
+ if ($env->{PATH_INFO} eq '/json') { | |
+ return [200, [@header], [encode_json { | |
+ message => 'Hello, World!' | |
+ }]]; | |
+ } elsif ($env->{PATH_INFO} eq '/db') { | |
+ return [200, [@header], [encode_json(($dbh->selectall_array( | |
+ @query, int rand 10000 + 1 | |
+ ))[0])]]; | |
+ } elsif ($env->{PATH_INFO} eq '/queries') { | |
+ my ($n) = ($env->{QUERY_STRING} || "") =~ /queries=(\d+)/; | |
+ $n ||= 1; | |
+ $n = 500 if $n > 500; | |
+ return [200, [@header], [encode_json [map { | |
+ ($dbh->selectall_array(@query, int rand 10000 + 1))[0] | |
+ } 1..$n]]]; | |
+ } elsif ($env->{PATH_INFO} eq '/fortunes') { | |
+ my @fortunes = $dbh->selectall_array( | |
+ 'SELECT id, message FROM Fortune', {Slice => {}} | |
+ ); | |
+ push @fortunes, { | |
+ id => 0, message => 'Additional fortune added at request time.' | |
+ }; | |
+ keysort_inplace {$_->{message}} @fortunes; | |
+ return [200, [qw(Content-Type text/html;charset=UTF-8)], [ | |
+ encode_utf8 $tx->render(fortunes => {fortunes => \@fortunes}) | |
+ ]]; | |
+ } elsif ($env->{PATH_INFO} eq '/updates') { | |
+ my ($n) = ($env->{QUERY_STRING} || "") =~ /queries=(\d+)/; | |
+ $n ||= 1; | |
+ $n = 500 if $n > 500; | |
+ my @r = map { | |
+ $_->{randomNumber} = int rand 10000 + 1; | |
+ $dbh->do( | |
+ 'UPDATE World SET randomNumber = ? WHERE id = ?', | |
+ undef, | |
+ $_->{randomNumber}, | |
+ $_->{id} | |
+ ); | |
+ $_ | |
+ } map { | |
+ ($dbh->selectall_array(@query, int rand 10000 + 1))[0] | |
+ } 1..$n; | |
+ return [200, [@header], [encode_json \@r]]; | |
+ } elsif ($env->{PATH_INFO} eq '/plaintext') { | |
+ state $res = ['Hello, World!']; | |
+ return [200, [qw(Content-Type text/plain)], $res]; | |
} | |
- elsif ( $env->{PATH_INFO} eq '/db' ) { | |
- my ($n) = ($env->{QUERY_STRING} || "" ) =~ m!queries=(\d+)!; | |
- $n //= 1; | |
- my @rs = map {{id=>$_->[0]+0,randomNumber=>$_->[1]+0}} | |
- map { $dbh->selectrow_arrayref($query,{},int rand 10000 + 1) } 1..$n; | |
- return [ 200, $header, [ '{}' ]] unless @rs; | |
- return [ 200, $header, [ encode_json( @rs > 1 ? \@rs : $rs[0] ) ]]; | |
- } | |
- [ 404, [], ['not found']]; | |
+ return [404, [], ['not found']]; | |
}; | |
$app; | |
diff --git a/frameworks/Perl/plack/benchmark_config.json b/frameworks/Perl/plack/benchmark_config.json | |
index 1d09abc44..f88d09979 100644 | |
--- a/frameworks/Perl/plack/benchmark_config.json | |
+++ b/frameworks/Perl/plack/benchmark_config.json | |
@@ -8,17 +8,263 @@ | |
"database": "MySQL", | |
"database_os": "Linux", | |
"db_url": "/db", | |
- "display_name": "plack", | |
+ "display_name": "plack-HTTP-Server-PSGI-MySQL", | |
+ "fortune_url": "/fortunes", | |
"framework": "plack", | |
"json_url": "/json", | |
"language": "Perl", | |
"notes": "", | |
"orm": "Raw", | |
"os": "Linux", | |
- "platform": "Starlet", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
"port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
"versus": "", | |
- "webserver": "nginx" | |
+ "webserver": "HTTP-Server-PSGI" | |
+ }, | |
+ "corona": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack-Corona", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "plack-Corona", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "Corona" | |
+ }, | |
+ "feersum": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack-Feersum", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "plack-Feersum", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "Feersum" | |
+ }, | |
+ "gazelle": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack-Gazelle", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "plack-Gazelle", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "Gazelle" | |
+ }, | |
+ "gepok": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack-Gepok", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "plack-Gepok", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "Gepok" | |
+ }, | |
+ "http-server-simple": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack-HTTP-Server-Simple", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "plack-HTTP-Server-Simple", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "HTTP-Server-Simple" | |
+ }, | |
+ "monoceros": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack-Monoceros", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "plack-Monoceros", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "Monoceros" | |
+ }, | |
+ "net-async-http-server": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack-Net-Async-HTTP-Server", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "plack-Net-Async-HTTP-Server", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "Net-Async-HTTP-Server" | |
+ }, | |
+ "starlet": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack-Starlet", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "plack-Starlet", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "Starlet" | |
+ }, | |
+ "starlight": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack-Starlight", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "plack-Starlight", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "Starlight" | |
+ }, | |
+ "starman": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack-Starman", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "plack-Starman", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "Starman" | |
+ }, | |
+ "twiggy-prefork": { | |
+ "approach": "Realistic", | |
+ "classification": "Micro", | |
+ "database": "MySQL", | |
+ "database_os": "Linux", | |
+ "db_url": "/db", | |
+ "display_name": "plack-Twiggy-Prefork", | |
+ "fortune_url": "/fortunes", | |
+ "framework": "plack-Twiggy-Prefork", | |
+ "json_url": "/json", | |
+ "language": "Perl", | |
+ "notes": "", | |
+ "orm": "Raw", | |
+ "os": "Linux", | |
+ "plaintext_url": "/plaintext", | |
+ "platform": "Plack", | |
+ "port": 8080, | |
+ "query_url": "/queries?queries=", | |
+ "update_url": "/updates?queries=", | |
+ "versus": "", | |
+ "webserver": "Twiggy-Prefork" | |
} | |
} | |
] | |
diff --git a/frameworks/Perl/plack/plack-corona.dockerfile b/frameworks/Perl/plack/plack-corona.dockerfile | |
new file mode 100644 | |
index 000000000..c5077d465 | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-corona.dockerfile | |
@@ -0,0 +1,22 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Corona@0.1004 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app-extraheaders.psgi $APPROOT/app.psgi | |
+ | |
+ENV DBI_DRIVER mysql | |
+CMD plackup -s Corona -E production --listen :8080 | |
diff --git a/frameworks/Perl/plack/plack-feersum.dockerfile b/frameworks/Perl/plack/plack-feersum.dockerfile | |
new file mode 100644 | |
index 000000000..220b3f49c | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-feersum.dockerfile | |
@@ -0,0 +1,23 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Feersum@1.405 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app-extraheaders.psgi $APPROOT/app.psgi | |
+ | |
+ENV DBI_DRIVER mysql | |
+ENV SERVER_NAME Feersum | |
+CMD plackup -s Feersum -E production --listen :8080 --pre-fork=$(nproc) | |
diff --git a/frameworks/Perl/plack/plack-gazelle.dockerfile b/frameworks/Perl/plack/plack-gazelle.dockerfile | |
new file mode 100644 | |
index 000000000..70d949c0e | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-gazelle.dockerfile | |
@@ -0,0 +1,22 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Gazelle@0.48 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app.psgi $APPROOT | |
+ | |
+ENV DBI_DRIVER mysql | |
+CMD plackup -s Gazelle -E production --listen :8080 --max-workers=$(nproc) | |
diff --git a/frameworks/Perl/plack/plack-gepok.dockerfile b/frameworks/Perl/plack/plack-gepok.dockerfile | |
new file mode 100644 | |
index 000000000..8c06c99ad | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-gepok.dockerfile | |
@@ -0,0 +1,22 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Gepok@0.28 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app.psgi $APPROOT | |
+ | |
+ENV DBI_DRIVER mysql | |
+CMD plackup -s Gepok -E production --listen :8080 | |
diff --git a/frameworks/Perl/plack/plack-http-server-simple.dockerfile b/frameworks/Perl/plack/plack-http-server-simple.dockerfile | |
new file mode 100644 | |
index 000000000..35fb39e66 | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-http-server-simple.dockerfile | |
@@ -0,0 +1,23 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Plack::Handler::HTTP::Server::Simple@0.16 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app-extraheaders.psgi $APPROOT/app.psgi | |
+ | |
+ENV DBI_DRIVER mysql | |
+CMD plackup -s HTTP::Server::Simple -E production --port 8080 | |
+ | |
diff --git a/frameworks/Perl/plack/plack-monoceros.dockerfile b/frameworks/Perl/plack/plack-monoceros.dockerfile | |
new file mode 100644 | |
index 000000000..152699977 | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-monoceros.dockerfile | |
@@ -0,0 +1,22 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Monoceros@0.27 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app.psgi $APPROOT | |
+ | |
+ENV DBI_DRIVER mysql | |
+CMD plackup -s Monoceros -E production --listen :8080 --max-workers=$(nproc) | |
diff --git a/frameworks/Perl/plack/plack-net-async-http-server.dockerfile b/frameworks/Perl/plack/plack-net-async-http-server.dockerfile | |
new file mode 100644 | |
index 000000000..ed8866794 | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-net-async-http-server.dockerfile | |
@@ -0,0 +1,23 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Plack::Handler::Net::Async::HTTP::Server@0.09 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app-extraheaders.psgi $APPROOT/app.psgi | |
+ | |
+ENV DBI_DRIVER mysql | |
+ENV SERVER_NAME Net::Async::HTTP::Server | |
+CMD plackup -s Net::Async::HTTP::Server -E production --listen :8080 | |
diff --git a/frameworks/Perl/plack/plack-postgres.dockerfile.disabled b/frameworks/Perl/plack/plack-postgres.dockerfile.disabled | |
new file mode 100644 | |
index 000000000..f4cdd960f | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-postgres.dockerfile.disabled | |
@@ -0,0 +1,21 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::Pg@3.7.4 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app.psgi $APPROOT | |
+ | |
+ENV DBI_DRIVER Pg | |
+CMD plackup -E production --listen :8080 | |
diff --git a/frameworks/Perl/plack/plack-starlet.dockerfile b/frameworks/Perl/plack/plack-starlet.dockerfile | |
new file mode 100644 | |
index 000000000..a7151f192 | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-starlet.dockerfile | |
@@ -0,0 +1,22 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Starlet@0.31 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app.psgi $APPROOT | |
+ | |
+ENV DBI_DRIVER mysql | |
+CMD plackup -s Starlet -E production --listen :8080 --max-workers=$(nproc) | |
diff --git a/frameworks/Perl/plack/plack-starlight.dockerfile b/frameworks/Perl/plack/plack-starlight.dockerfile | |
new file mode 100644 | |
index 000000000..09566d298 | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-starlight.dockerfile | |
@@ -0,0 +1,22 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Starlight@0.0306 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app.psgi $APPROOT | |
+ | |
+ENV DBI_DRIVER mysql | |
+CMD plackup -s Starlight -E production --port 8080 | |
diff --git a/frameworks/Perl/plack/plack-starman.dockerfile b/frameworks/Perl/plack/plack-starman.dockerfile | |
new file mode 100644 | |
index 000000000..3b779b3e4 | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-starman.dockerfile | |
@@ -0,0 +1,22 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Starman@0.4014 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app-extraheaders.psgi $APPROOT/app.psgi | |
+ | |
+ENV DBI_DRIVER mysql | |
+CMD plackup -s Starman -E production --listen :8080 --workers=$(nproc) | |
diff --git a/frameworks/Perl/plack/plack-twiggy-prefork.dockerfile b/frameworks/Perl/plack/plack-twiggy-prefork.dockerfile | |
new file mode 100644 | |
index 000000000..d864b13e3 | |
--- /dev/null | |
+++ b/frameworks/Perl/plack/plack-twiggy-prefork.dockerfile | |
@@ -0,0 +1,22 @@ | |
+FROM perl:5.28 | |
+RUN cpanm --notest --no-man-page \ | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 \ | |
+ Twiggy::Prefork@0.08 | |
+ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app-extraheaders.psgi $APPROOT/app.psgi | |
+ | |
+ENV DBI_DRIVER mysql | |
+CMD plackup -s Twiggy::Prefork -E production --port 8080 --max_workers=$(nproc) | |
diff --git a/frameworks/Perl/plack/plack.dockerfile b/frameworks/Perl/plack/plack.dockerfile | |
index aa5a3689d..1829b4734 100644 | |
--- a/frameworks/Perl/plack/plack.dockerfile | |
+++ b/frameworks/Perl/plack/plack.dockerfile | |
@@ -1,23 +1,21 @@ | |
FROM perl:5.28 | |
- | |
-RUN apt update -yqq && apt install -yqq nginx | |
- | |
-WORKDIR /plack | |
- | |
RUN cpanm --notest --no-man-page \ | |
- JSON JSON::XS IO::Socket::IP IO::Socket::SSL \ | |
- JSON::XS@3.01 \ | |
- HTTP::Parser::XS@0.16 \ | |
- Plack@1.0030 \ | |
- DBI@1.631 \ | |
- DBD::mysql@4.033 \ | |
- Starlet@0.24 | |
+ DBI@1.641 \ | |
+ DBD::mysql@4.046 \ | |
+ HTTP::Parser::XS@0.17 \ | |
+ IO::Socket::IP@0.39 \ | |
+ IO::Socket::SSL@2.058 \ | |
+ Cpanel::JSON::XS@4.04 \ | |
+ Plack@1.0047 \ | |
+ File::Spec@3.74 \ | |
+ Sort::Key@1.33 \ | |
+ Text::Xslate@3.5.6 \ | |
+ Unicode::UTF8@0.62 | |
-ADD ./app.pid /plack/ | |
-ADD ./app.psgi /plack/ | |
-add ./nginx.conf /plack/ | |
+ARG APPROOT=/usr/local/share/frameworks-benchmark | |
+RUN mkdir -p $APPROOT | |
+WORKDIR $APPROOT | |
+COPY ./app.psgi $APPROOT | |
-CMD nginx -c /plack/nginx.conf && \ | |
- start_server --backlog=16384 --pid-file=/plack/app.pid --path=/tmp/perl-plack.sock -- plackup \ | |
- -E production -s Starlet --max-keepalive-reqs 1000 --max-reqs-per-child 50000 \ | |
- --min-reqs-per-child 40000 --max-workers=$(nproc) -a /plack/app.psgi | |
+ENV DBI_DRIVER mysql | |
+CMD plackup -E production --listen :8080 | |
-- | |
2.28.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment