/srv/irclogs.ubuntu.com/2019/11/01/#ubuntu-us-pa.txt

waltman/dev/random also blocks, which makes it a really bad choice for benchmarking.00:49
teddy-dbearMorning peoples, critters and everything else09:46
ChinnoDogHere is my new crude CPU benchmark: dd if=/dev/urandom bs=1M count=1024 | sha256sum13:35
ChinnoDogIt has the benefit of being able to use the dd output stats for measurement. I get 82.6MB/s13:36
waltmanI'm still confused about what it is you think you're measuring. That pipeline uses 3 cpus.13:44
waltmandd + sha256sum + one to run the RNG code13:45
ChinnoDogOne to run the rng code? I assumed dd usage would be insignificant since it is only copying bits in memory.13:54
ChinnoDogI guess generating random numbers could be expensive. hmm13:54
ChinnoDogI measured it. It is expensive.13:58
ChinnoDogI would need to make it run single threaded to get the number I wanted. However, both systems I am comparing have 2+ CPUs so I think it is ok for now.14:00
waltmanSurely there are existing benchmarks to measure whatever it is you're interested in.14:07
ChinnoDogI couldn't find any convenient CPU benchmark tools in the default RHEL repositories which is all I have to work with.14:07
waltmanOnce you write a pipeline you're using multiple CPUs.14:08
ChinnoDogThere must be a way to constrain all child processes from my command to a single CPU.14:09
ChinnoDogI could wrap it in a "sh -c" if I had to.14:10
waltmanI really doubt it.14:11
ChinnoDogThat sounds like a challenge.14:37
waltmanIt's kind of the point to take advantage of multiple CPUs for this.14:38
waltmanIf you want to be sure things are constrained to a single CPU, you're far better writing an actual program than trying to rely on shell tricks, especially since you don't seem to understand them well.14:39
ChinnoDogI understand them and I knew that there would be some parallelization, I just thought that they would be insignificant relative to the sha2 algorithm15:51
ChinnoDogI mean sha256. The RNG does take about 1/4 of the time of the sha256 calculation time though so I would expect if done right the command will take 25% longer when single threaded.15:52
waltmanYou fundamentally can't test just single-threaded CPU performance in a pipeline. Find a program.15:53
waltmanPipelines run on multiple CPUs. If you're accessing /dev/urandom, that's causing the kernel to run the random number generator and it's going to affect your results.15:54
waltmanAlso as you've discovered it's easy to guess wrong about what's going to take the time.15:55
waltmanhttps://linuxconfig.org/how-to-benchmark-your-linux-system15:56
ChinnoDogI made it run on one core. taskset -a -c 0 sh -c "dd if=/dev/urandom bs=1M count=1024 | sha256sum"16:10
ChinnoDogAlthough I'm not letting the scheduler select the core I think the number it produces is accurate since the scheduler will just send the other processes to other cores.16:10
ChinnoDogIncidentally, it actually runs /faster/ when it is confined to one core.16:11
ChinnoDogI verified by running it with a large count for DD and verifying with top that the CPU time for dd + sha256sum <= 100%16:13
waltmanWhat exactly is it you're trying to do?16:53
waltmanEven if you confine that to a single CPU, you've still got process switching involved.16:54
ChinnoDog That is ok! My intent was to come up with a way to compare CPU performance on different systems. That is all. I don't need an exact measure since I only need to know if there was something wrong with one of the systems.17:24
ChinnoDogI used the earlier multi-threaded version to confirm that the performance of the server in question was similar to my laptop so it did not have a CPU issue. It is suffering from the usual cause of slowness. Bad programming.20:36
ChinnoDogNo matter how fast computers get people still make them run slow by doing Bad Things20:38
waltmanI mean, you do you, but I still think your methodology is bogus.20:39
waltman:)20:39
ChinnoDogI don't understand why. I ran a command that was restricted to one CPU and received a measurement of how fast it ran. Is that not what a benchmark is?20:39
ChinnoDogIt took nothing into account except the raw performance of a couple common CPU intensive algorithms so it isn't great for comparing diverse hardware but that wasn't part of the design criteria.20:41
waltmanYou've got too many variables. You've got several algorithms running different processes so you've also got task switching to consider. Not to mention you're reinventing the wheel.20:45
waltmanAny, I've given up on trying to convince you. Have fun.20:45

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!