Hi,

I'm trying to build a simple performance test on a rails 3 app that
operates on a large database (~150GB). We copy production data to our
dev/test setup every night so that we have a realistic environment for
development.

I followed the guide on creating a test and tried to run it using

$ rake test:benchmark

Unbelievably, this tried to drop my test database!!! Fortunately it didn't
have permission to do this and failed. Is there a way to skip this step
and just run the test against the DB as it exists already. From the guide,
it seems like most rails apps have their test data in yaml files or
something but I don't understand how this would scale to a production
environment. Code that works well on 100 or so database rows is not
necessarily going to work well on millions of rows.

Feel free to point me in the direction of relevant documentation and tell
me to RTFM.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/LUHLC6G36-kJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.

Search Discussions

  • Colin Law at Jul 12, 2012 at 7:04 am

    On 11 July 2012 01:39, Andy Chambers wrote:
    Hi,

    I'm trying to build a simple performance test on a rails 3 app that operates
    on a large database (~150GB). We copy production data to our dev/test setup
    every night so that we have a realistic environment for development.

    I followed the guide on creating a test and tried to run it using

    $ rake test:benchmark

    Unbelievably, this tried to drop my test database!!! Fortunately it didn't
    have permission to do this and failed.
    Is there a way to skip this step and
    just run the test against the DB as it exists already. From the guide, it
    seems like most rails apps have their test data in yaml files or something
    but I don't understand how this would scale to a production environment.
    Code that works well on 100 or so database rows is not necessarily going to
    work well on millions of rows.
    The test environment is designed for testing that stuff works, not for
    performance testing. In order for tests to be repeatable they have to
    always work on the same data, which is why the test database is
    reloaded for each test, either from fixtures or, more often nowadays,
    using Factories.

    The test environment is not appropriate for performance testing
    anyway, to do this you would have to set up a parallel production
    environment in order that it correctly mimics your real environment.

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
  • Andy Chambers at Jul 12, 2012 at 2:38 pm

    On Thursday, July 12, 2012 3:03:25 AM UTC-4, Colin Law wrote:
    On 11 July 2012 01:39, Andy Chambers > wrote:
    Hi,

    I'm trying to build a simple performance test on a rails 3 app that operates
    on a large database (~150GB). We copy production data to our dev/test setup
    every night so that we have a realistic environment for development.

    I followed the guide on creating a test and tried to run it using

    $ rake test:benchmark

    Unbelievably, this tried to drop my test database!!! Fortunately it didn't
    have permission to do this and failed.
    Is there a way to skip this step and
    just run the test against the DB as it exists already. From the guide, it
    seems like most rails apps have their test data in yaml files or something
    but I don't understand how this would scale to a production environment.
    Code that works well on 100 or so database rows is not necessarily going to
    work well on millions of rows.
    The test environment is designed for testing that stuff works, not for
    performance testing.

    If this is true, someone should tell that to the official guide maintainers

    http://guides.rubyonrails.org/performance_testing.html

    The test environment is not appropriate for performance testing
    anyway, to do this you would have to set up a parallel production
    environment in order that it correctly mimics your real environment.
    Exactly! We have this. I just wondered if there was a "rails/ruby way" of
    writing and running performance tests against this environment. The
    scaffolding builds a tests/performance directory so I assumed there was.


    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ChtcbBV8m6IJ.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
  • Colin Law at Jul 12, 2012 at 4:01 pm

    On 12 July 2012 15:37, Andy Chambers wrote:
    On Thursday, July 12, 2012 3:03:25 AM UTC-4, Colin Law wrote:
    On 11 July 2012 01:39, Andy Chambers > wrote:
    Hi,

    I'm trying to build a simple performance test on a rails 3 app that
    operates
    on a large database (~150GB). We copy production data to our dev/test
    setup
    every night so that we have a realistic environment for development.

    I followed the guide on creating a test and tried to run it using

    $ rake test:benchmark

    Unbelievably, this tried to drop my test database!!! Fortunately it
    didn't
    have permission to do this and failed.
    Is there a way to skip this step and
    just run the test against the DB as it exists already. From the guide,
    it
    seems like most rails apps have their test data in yaml files or
    something
    but I don't understand how this would scale to a production environment.
    Code that works well on 100 or so database rows is not necessarily going
    to
    work well on millions of rows.
    The test environment is designed for testing that stuff works, not for
    performance testing.

    If this is true, someone should tell that to the official guide maintainers

    http://guides.rubyonrails.org/performance_testing.html
    That munching sound you can hear is me eating my words.
    The test environment is not appropriate for performance testing
    anyway, to do this you would have to set up a parallel production
    environment in order that it correctly mimics your real environment.

    Exactly! We have this. I just wondered if there was a "rails/ruby way" of
    writing and running performance tests against this environment. The
    scaffolding builds a tests/performance directory so I assumed there was.
    I see from the guide section 1.7 that for performance test environment
    is close to the production environment. Munch munch.

    So to get back to your original question this might be helpful, though
    I have not tried it myself. It is a bit old so may need tweaking for
    Rails 3. Does anyone else have suggestions?
    http://m.onkey.org/running-rails-performance-tests-on-real-data

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
  • Andy Chambers at Jul 12, 2012 at 4:31 pm

    On Thursday, July 12, 2012 12:01:15 PM UTC-4, Colin Law wrote:
    On 12 July 2012 15:37, Andy Chambers wrote:

    On Thursday, July 12, 2012 3:03:25 AM UTC-4, Colin Law wrote:
    On 11 July 2012 01:39, Andy Chambers > wrote:
    Hi,

    I'm trying to build a simple performance test on a rails 3 app that
    operates
    on a large database (~150GB). We copy production data to our
    dev/test
    setup
    every night so that we have a realistic environment for development.

    I followed the guide on creating a test and tried to run it using

    $ rake test:benchmark

    Unbelievably, this tried to drop my test database!!! Fortunately it
    didn't
    have permission to do this and failed.
    Is there a way to skip this step and
    just run the test against the DB as it exists already. From the
    guide,
    it
    seems like most rails apps have their test data in yaml files or
    something
    but I don't understand how this would scale to a production
    environment.
    Code that works well on 100 or so database rows is not necessarily
    going
    to
    work well on millions of rows.
    The test environment is designed for testing that stuff works, not for
    performance testing.

    If this is true, someone should tell that to the official guide
    maintainers
    http://guides.rubyonrails.org/performance_testing.html
    That munching sound you can hear is me eating my words.
    The test environment is not appropriate for performance testing
    anyway, to do this you would have to set up a parallel production
    environment in order that it correctly mimics your real environment.

    Exactly! We have this. I just wondered if there was a "rails/ruby way" of
    writing and running performance tests against this environment. The
    scaffolding builds a tests/performance directory so I assumed there was.
    I see from the guide section 1.7 that for performance test environment
    is close to the production environment. Munch munch.

    So to get back to your original question this might be helpful, though
    I have not tried it myself. It is a bit old so may need tweaking for
    Rails 3. Does anyone else have suggestions?
    http://m.onkey.org/running-rails-performance-tests-on-real-data
    Aha, thanks for this link. That helps a lot.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/wSPU3SU9N4YJ.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJul 11, '12 at 10:59p
activeJul 12, '12 at 4:31p
posts5
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Andy Chambers: 3 posts Colin Law: 2 posts

People

Translate

site design / logo © 2022 Grokbase