Skip to content

Commit

Permalink
[ruby/sinatra] Add agoo server
Browse files Browse the repository at this point in the history
Agoo should should improve sinatra results:

+------------+---------+------+------+-----+-----+-------+--------------+
| branch_name|plaintext|update|  json|   db|query|fortune|weighted_score|
+------------+---------+------+------+-----+-----+-------+--------------+
|      master|    92523|  9634| 92989|38761|14495|  22834|          1242|
|sinatra/agoo|   150163| 16868|133183|50760|47776|  27544|          2550|
+------------+---------+------+------+-----+-----+-------+--------------+
  • Loading branch information
p8 committed Dec 19, 2024
1 parent 36a565a commit f2a89fd
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 4 deletions.
5 changes: 5 additions & 0 deletions frameworks/Ruby/sinatra/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ end
group :unicorn do
gem 'unicorn', '~> 6.1', platforms: [:ruby, :mswin], require: false
end

group :agoo do
gem 'agoo', require: false
gem 'rackup'
end
3 changes: 3 additions & 0 deletions frameworks/Ruby/sinatra/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
agoo (2.15.13)
base64 (0.2.0)
bigdecimal (3.1.8)
concurrent-ruby (1.3.4)
Expand Down Expand Up @@ -74,11 +75,13 @@ PLATFORMS

DEPENDENCIES
activerecord (~> 7.2)
agoo
json (~> 2.8)
mysql2 (~> 0.5)
passenger (~> 6.0)
pg (~> 1.5)
puma (~> 6.4)
rackup
sinatra (~> 4.0)
unicorn (~> 6.1)

Expand Down
22 changes: 22 additions & 0 deletions frameworks/Ruby/sinatra/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,28 @@
"versus": "rack-postgres-puma-mri",
"notes": ""
},
"postgres-agoo-mri": {
"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": "Micro",
"database": "Postgres",
"framework": "sinatra",
"language": "Ruby",
"orm": "Full",
"platform": "Rack",
"webserver": "Agoo",
"os": "Linux",
"database_os": "Linux",
"display_name": "sinatra-postgres-agoo-mri",
"versus": "rack-postgres-agoo-mri",
"notes": ""
},
"postgres-passenger-mri": {
"db_url": "/db",
"query_url": "/queries?queries=",
Expand Down
2 changes: 2 additions & 0 deletions frameworks/Ruby/sinatra/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
Puma::Const::PUMA_SERVER_STRING
elsif defined?(Unicorn)
Unicorn::HttpParser::DEFAULTS['SERVER_SOFTWARE']
elsif defined?(Agoo)
'Agoo'
end

Bundler.require(:default) # Load core modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
ADD ./ /sinatra
WORKDIR /sinatra

ENV BUNDLE_WITHOUT=mysql:puma:unicorn
ENV BUNDLE_WITHOUT=mysql:agoo:puma:unicorn
RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile

# TODO: https://github.com/phusion/passenger/issues/1916
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
ADD ./ /sinatra
WORKDIR /sinatra

ENV BUNDLE_WITHOUT=mysql:passenger:puma
ENV BUNDLE_WITHOUT=mysql:agoo:passenger:puma
RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile

ENV DBTYPE=postgresql
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Ruby/sinatra/sinatra-postgres.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
ADD ./ /sinatra
WORKDIR /sinatra

ENV BUNDLE_WITHOUT=mysql:passenger:unicorn
ENV BUNDLE_WITHOUT=mysql:agoo:passenger:unicorn
RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile

ENV DBTYPE=postgresql
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Ruby/sinatra/sinatra.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
ADD ./ /sinatra
WORKDIR /sinatra

ENV BUNDLE_WITHOUT=postgresql:passenger:unicorn
ENV BUNDLE_WITHOUT=postgresql:agoo:passenger:unicorn
RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile

ENV DBTYPE=mysql
Expand Down

0 comments on commit f2a89fd

Please sign in to comment.