TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ruby on Rails load testing habits

128 pointsby a12bover 1 year ago

8 comments

rdohertyover 1 year ago
These are great tips for load testing any web service. Don&#x27;t forget that you can also saturate memory, disk or network too, so watch those graphs too. I&#x27;ve seen load tests unable to saturate CPU because another resource was limited.<p>Also don&#x27;t forget that you are load testing all the dependencies of your service. Database, caching tier, external services, etc. Make sure other teams are aware!<p>Also nothing beats real world traffic. Users&#x27; connections will stay open longer than a synthetic tool may hold them open due to bandwidth, they make very random, sporadic requests too. Your service will behave very differently under large amounts of real world traffic vs synthetic.<p>Other options if you are running multiple web servers is to shift traffic around to increase traffic to 1 host and see where it fails. That is usually a very reliable signal for peak load.<p>And don&#x27;t forget to do this on a schedule as your codebase (and your dependencies codebases) changes!
评论 #39147639 未加载
mplewisover 1 year ago
If you&#x27;re looking to run programmable load test scenarios as described in this blog post, consider checking out <a href="https:&#x2F;&#x2F;k6.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;k6.io&#x2F;</a>, which I&#x27;ve found to be extremely easy to use and powerful.
anonacct37over 1 year ago
&gt; My initial requirement was to send requests with unique parameters. To the best of my knowledge, no tool could do this.<p>wrk does this with lua. <a href="https:&#x2F;&#x2F;github.com&#x2F;wg&#x2F;wrk&#x2F;blob&#x2F;master&#x2F;src&#x2F;wrk.lua">https:&#x2F;&#x2F;github.com&#x2F;wg&#x2F;wrk&#x2F;blob&#x2F;master&#x2F;src&#x2F;wrk.lua</a><p>Also even things like the venerable jmeter supported pulling parameters from a csv file.
评论 #39138096 未加载
ericbover 1 year ago
If you&#x27;d like to write your load tests in Ruby (plain ruby or browser based), and use your own libraries (internal libraries, specs, ets) browserup does that:<p>Ruby with browser:<p><a href="https:&#x2F;&#x2F;browserup.com&#x2F;docs&#x2F;en&#x2F;load&#x2F;ruby-load-test.html" rel="nofollow">https:&#x2F;&#x2F;browserup.com&#x2F;docs&#x2F;en&#x2F;load&#x2F;ruby-load-test.html</a><p>Command-line installation:<p><a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;browserup" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;browserup</a>
pistoriuspover 1 year ago
Having your test database mirror production as closely as possible is also an important habit, however I’m biased since that’s part of the offering that I’m building.
评论 #39142056 未加载
Hendriktoover 1 year ago
&gt; If the application can’t saturate the CPU, there’s a fundamental problem. It’s a shame because it makes adding more servers less efficient. Money is being wasted on hosting costs, and this should be a priority to address.<p>Talking about efficiency being a priority, but using RoR. I guess that is one way of saturating the CPU.
评论 #39142167 未加载
评论 #39139643 未加载
评论 #39139741 未加载
评论 #39139936 未加载
sfc32over 1 year ago
RoRvsWild is a pretty cool product, and built by 2 of the nicest guys in the Ruby ecosystem.
评论 #39143850 未加载
rubyissimoover 1 year ago
fwiw, I know it&#x27;s the right thing to run tests from a different computer. But it&#x27;s more annoying. And I hereby tell you that 90% of the time it probably doesn&#x27;t matter.<p>Definitely times it isn&#x27;t true. But if you&#x27;re not doing a load test bc it&#x27;s a pita, do it locally. Most of the time I&#x27;ve wanted to do this, all the action is inside the app. Just be careful to acknowledge that there could be limitations &#x2F; surprises.