Skip to content

Commit fedff3a

Browse files
authored
[ruby/sinatra] Test Iodine with MySQL (#10427)
With Puma there is a noticable performance difference between MySQL and Postgresql. To see if this also applies when running Iodine, add MySQL tests.
1 parent 9e049e7 commit fedff3a

File tree

4 files changed

+83
-1
lines changed

4 files changed

+83
-1
lines changed

frameworks/Ruby/sinatra-sequel/benchmark_config.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,26 @@
4242
"versus": "rack-sequel-postgres-puma-mri",
4343
"notes": ""
4444
},
45+
"iodine": {
46+
"db_url": "/db",
47+
"query_url": "/queries?queries=",
48+
"fortune_url": "/fortunes",
49+
"update_url": "/updates?queries=",
50+
"port": 8080,
51+
"approach": "Realistic",
52+
"classification": "Micro",
53+
"database": "MySQL",
54+
"framework": "sinatra",
55+
"language": "Ruby",
56+
"orm": "Full",
57+
"platform": "Rack",
58+
"webserver": "Iodine",
59+
"os": "Linux",
60+
"database_os": "Linux",
61+
"display_name": "sinatra-sequel [iodine, mysql]",
62+
"versus": "",
63+
"notes": ""
64+
},
4565
"postgres-iodine-mri": {
4666
"db_url": "/db",
4767
"query_url": "/queries?queries=",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ruby:4.0-rc
2+
3+
ENV RUBY_YJIT_ENABLE=1
4+
5+
# Use Jemalloc
6+
RUN apt-get update && \
7+
apt-get install -y --no-install-recommends libjemalloc2
8+
ENV LD_PRELOAD=libjemalloc.so.2
9+
10+
ADD ./ /sinatra-sequel
11+
WORKDIR /sinatra-sequel
12+
13+
ENV BUNDLE_WITH=mysql:iodine
14+
RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile
15+
16+
ENV APP_ENV=production
17+
ENV DBTYPE=mysql
18+
19+
EXPOSE 8080
20+
21+
CMD bundle exec iodine -p 8080 -w $(ruby config/auto_tune.rb | grep -Eo '[0-9]+' | head -n 1)

frameworks/Ruby/sinatra/benchmark_config.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"versus": "rack-postgres-puma-mri",
4545
"notes": ""
4646
},
47-
"postgres-iodine-mri": {
47+
"iodine": {
4848
"json_url": "/json",
4949
"db_url": "/db",
5050
"query_url": "/queries?queries=",
@@ -54,6 +54,26 @@
5454
"port": 8080,
5555
"approach": "Realistic",
5656
"classification": "Micro",
57+
"database": "MySQL",
58+
"framework": "sinatra",
59+
"language": "Ruby",
60+
"orm": "Full",
61+
"platform": "Rack",
62+
"webserver": "Iodine",
63+
"os": "Linux",
64+
"database_os": "Linux",
65+
"display_name": "sinatra [iodine, mysql]",
66+
"versus": "",
67+
"notes": ""
68+
},
69+
"postgres-iodine-mri": {
70+
"db_url": "/db",
71+
"query_url": "/queries?queries=",
72+
"fortune_url": "/fortunes",
73+
"update_url": "/updates?queries=",
74+
"port": 8080,
75+
"approach": "Realistic",
76+
"classification": "Micro",
5777
"database": "Postgres",
5878
"framework": "sinatra",
5979
"language": "Ruby",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ruby:4.0-rc
2+
3+
ENV RUBY_YJIT_ENABLE=1
4+
5+
# Use Jemalloc
6+
RUN apt-get update && \
7+
apt-get install -y --no-install-recommends libjemalloc2
8+
ENV LD_PRELOAD=libjemalloc.so.2
9+
10+
ADD ./ /sinatra
11+
WORKDIR /sinatra
12+
13+
ENV BUNDLE_WITH=mysql:iodine
14+
RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile
15+
16+
ENV APP_ENV=production
17+
ENV DBTYPE=mysql
18+
19+
EXPOSE 8080
20+
21+
CMD bundle exec iodine -p 8080 -w $(ruby config/auto_tune.rb | grep -Eo '[0-9]+' | head -n 1)

0 commit comments

Comments
 (0)