Most active commenters
  • epistasis(5)
  • fukka42(3)

←back to thread

529 points swills | 17 comments | | HN request time: 0.207s | source | bottom
Show context
rezonant ◴[] No.45688230[source]
But is /dev/null web scale?
replies(3): >>45688273 #>>45688300 #>>45688765 #
1. epistasis ◴[] No.45688273[source]
Yes, /dev/null can even power sites like zombo.com
replies(1): >>45688321 #
2. bottled_poe ◴[] No.45688321[source]
What’s the I/O throughput of /dev/null ?
replies(2): >>45688365 #>>45688374 #
3. epistasis ◴[] No.45688365[source]
Single client, I'm getting ~5GB/s, both on an 8-year-old intel server, and on my M1 ARM chip.

However with a single server, it doesn't perfectly linearly scale with multiple clients. I'm getting

1 client: 5GB/s

2 clients: 8GB/s

3 client: 8.7GB/s

replies(2): >>45688467 #>>45688477 #
4. CaptainOfCoit ◴[] No.45688374[source]
You start dealing with Heisen-throughput at that point, it goes as high as you can measure.
5. fukka42 ◴[] No.45688467{3}[source]
I'm easily reaching 30GB/s with a single client:

    dd if=/dev/zero of=/dev/null bs=1M status=progress
A second dd process hits the same speed.
replies(2): >>45688575 #>>45688592 #
6. dinkelberg ◴[] No.45688477{3}[source]
How did you measure this? Do you know that /dev/null is the limiting factor, or could it be the data source that is limiting?
7. epistasis ◴[] No.45688575{4}[source]
My artisanal architecture design uses writes with a few characters and uses unix pipes:

    yes | pv > /dev/null
I hope that in my next rewrite I can advance to larger block sizes.
replies(1): >>45688906 #
8. rezonant ◴[] No.45688592{4}[source]
What's the best hardware for running a /dev/null instance for production?
replies(2): >>45688994 #>>45689263 #
9. fukka42 ◴[] No.45688906{5}[source]
Interestingly I tried this as well and was disappointed with the results:

  yes $(printf %1024s | tr " " "y") | pv > /dev/null
About the same throughput as letting yes output a single character. I guess Unix pipes are slow.
replies(1): >>45689193 #
10. epistasis ◴[] No.45688994{5}[source]
I usually do a kubernetes cluster on top of VMs. But sometimes when I really want to scale the standard cloud server less platforms all support /dev/null out of the box. (Except for Windows...)
replies(1): >>45689660 #
11. 1718627440 ◴[] No.45689193{6}[source]
> I guess Unix pipes are slow.

Or string concatenation, or pipeviewer.

replies(2): >>45689287 #>>45690060 #
12. __turbobrew__ ◴[] No.45689263{5}[source]
A single resistor at ground voltage.
replies(1): >>45690063 #
13. fukka42 ◴[] No.45689287{7}[source]
yes doesn't do string concatenation, at least not in the loop that matters. It just prepares a buffer of bytes once and writes it to stdout repeatedly.

https://github.com/coreutils/coreutils/blob/master/src/yes.c

14. wowczarek ◴[] No.45689660{6}[source]
> Except for Windows...

copy c:\file nul

It's been there since DOS or more likely CP/M :)

replies(1): >>45690314 #
15. eru ◴[] No.45690060{7}[source]
Compare https://codegolf.stackexchange.com/questions/199528/fastest-...
16. eru ◴[] No.45690063{6}[source]
That doesn't support expected features like 'stat /dev/null'.
17. epistasis ◴[] No.45690314{7}[source]
Still need an adapter library though! Fortunately there are about 7 competing implementations on npm and most of them only have 5-6 transitive dependencies.