New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup docker-compose #40

Merged
merged 5 commits into from Aug 10, 2017

Conversation

Projects
None yet
3 participants
@bmarkons
Copy link
Collaborator

bmarkons commented Aug 9, 2017

Once upon a time there was an idea of docker-compose #13 馃槃

I was trying to debug issue with discourse query benchmark. We encountered unexpectedly similar performance of ActiveRecord and Sequel flavors for that benchmark. Therefore I assumed something is bad in docker setup and decided to try with docker-compose.

Results I got locally with this setup :

  • Raw : 230 ips
  • Sequel : 190 ips
  • ActiveRecord : 150

Overhead with ActiveRecord is 2x greater than with Sequel.

@bmarkons bmarkons changed the title Setup docker-compose Setup docker-compose [WIP] Aug 9, 2017

@bmarkons bmarkons force-pushed the bmarkons:docker-compose-setup branch from 06f023b to a3a65c7 Aug 9, 2017

dropdb --if-exists -h postgres -U postgres rubybench
createdb -h postgres -U postgres rubybench
echo "DROP DATABASE IF EXISTS rubybench" | mysql -u root -h mysql
echo "CREATE DATABASE rubybench" | mysql -u root -h mysql

This comment has been minimized.

@bmarkons

bmarkons Aug 9, 2017

Collaborator

I am not sure though if recreating database should occur before (or after) every benchmark? @noahgibbs

This comment has been minimized.

@bmarkons

bmarkons Aug 9, 2017

Collaborator

We are recreating only tables used in certain benchmark but not entire database. I have feeling that we should drop and create whole database before each bench. I am not sure if having two many tables in database affects performance even though you are not using them all?

This comment has been minimized.

@noahgibbs

noahgibbs Aug 9, 2017

Contributor

Having tables you're not using doesn't significantly affect performance during a benchmark unless you're doing something unusual (like enumerating all the tables.) ActiveRecord classes you aren't using will add a bit of overhead, but that's true Ruby-side as well.

Recreating the database would primarily be a way of making sure tables don't have extra records in them we're not using, which would make more difference in some cases.

This comment has been minimized.

@bmarkons

bmarkons Aug 9, 2017

Collaborator

We are making sure we don't have extra records in tables before every run by recreating tables, though I think we could recreate entire database before each benchmark.

This comment has been minimized.

@noahgibbs

noahgibbs Aug 9, 2017

Contributor

Sure. I think you're doing fine on that. I just mean that extra records in tables you use are slow (that's fine, you're taking care of that.) But extra tables you don't use are basically free.

@bmarkons bmarkons force-pushed the bmarkons:docker-compose-setup branch from a3a65c7 to 179e771 Aug 9, 2017

@bmarkons bmarkons changed the title Setup docker-compose [WIP] Setup docker-compose Aug 9, 2017

version: '3'
services:
postgres:
image: postgres:9.6

This comment has been minimized.

@tgxworld

tgxworld Aug 10, 2017

Member

Did this affect the performance of our benchmark? We'll probably have to invalidate all benchmarks that were ran with Postgres 9.5

This comment has been minimized.

@bmarkons

bmarkons Aug 10, 2017

Collaborator

Probably invalidation is the right thing to do.

@@ -1,13 +1,12 @@
#!/bin/bash
set -e

while ! exec 6<>/dev/tcp/${POSTGRES_PORT_5432_TCP_ADDR}/${POSTGRES_PORT_5432_TCP_PORT}; do
echo "$(date) - still trying to connect to Postgres server"
until pg_isready -h postgres; do

This comment has been minimized.

@tgxworld

tgxworld Aug 10, 2017

Member

馃憤

@tgxworld

This comment has been minimized.

Copy link
Member

tgxworld commented Aug 10, 2017

馃憦 loving the changes here

@bmarkons bmarkons merged commit b947300 into ruby-bench:master Aug 10, 2017

@bmarkons bmarkons deleted the bmarkons:docker-compose-setup branch Aug 10, 2017

@bmarkons bmarkons added the gsoc2017 label Aug 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment