Hacker News new | ask | show | jobs
by Bromskloss 3169 days ago
> I open up a couple of tabs

So, you're basically thawing your lunch manually. Have you considered the "parallel" command?

1 comments

Hrm, no I hadn't. I don't know much about this command. Could you give me a (thawing) example?
It's pretty straightforward:

  parallel -- yes yes yes yes >/dev/null
If you've more processors than that, add on extra yesses.
That manual counting of cores is what I thought we would let `parallel` handle! I have never actually used parallel, though, so I don't know how to best do it.
one way on a leenukz

    parallel -- `sed -ne 's:^processor.*:yes:p' < /proc/cpuinfo`
on openbsd:

    parallel -- `perl -e 'printf("yes "x\`sysctl -n hw.ncpu\`)'`
don't try the latter in a shell script without being prepared to debug tho.
Right. I was unclear. What I really meant was that I was thinking that `parallel` could automatically spin up more and more jobs until it sensed that there is no further performance to be gained. I'm not sure to what extent that is true, though.
I just realized a simple shell script would make a passable imitation of JMeter, without the horrible UI and xml.
A shell script wouldn't be enough (I've tried). However there are plenty of CLI based load testing tools, including one I've written myself. And if you need something more advanced then there is always Gatling, which is run via the command line and produces proper HTML reports and graphs plus is extended in code (eg in Scala) rather than GUI controls
OT but if you want a nice alternative to jmeter, check out Gatling. Instead of XML, you can code your scenarios in scala.

edit : hnlmorg beat me to it :)

    for p in `seq 1 $(sysctl -n hw.ncpu)`; do yes > /dev/null & done
Alternatively you could run Boinc with a cancer research project or something - defrost your food AND help the world become a better place.
$(nproc --all) on Linux