10 ms·
Apple has a bug in its disk I/O throttling code that affects raw disk copies
- AJRF 4y agoApple: Great hardware, barely tolerable software.
- gentle 4y agoThe hardware looks nice but it's not for normal people getting normal work done. Things have gotten marginally better since Ive left, but they still have a long way to go.
- zer01 4y agoI disagree, having migrated multiple family members away from shitty plastic laptops full of bloat ware and ads and shitty Android phones full of the same they are much more able to use their devices. I also find as a dev that iPhones and MacBooks “just work” and let me get my stuff done, much much more so than a Linux desktop environment or windows laptop. I guess we may be talking about different things though if you’re saying the apple ecosystem isn’t living up to its full potential, but IMO the rest of the phone/computer ecosystem is full of cheap shitty plastic crap with windows installs that OEMs have had free reign to install whatever they want on (and even without that, why tf when I install windows 10 do I get ads for “candy crush” on my start menu?!)
- jeroenhd 4y agoComparing Apple's hardware to shitty plastic laptops is a false equivalence though. Once you spend Apple money on hardware, you get much better stuff in return. Apple is perceived to be high quality because they only serve the high end. When you compare ecosystems, you should at least compare the same market segment. There are also market segments that Apple has no products in (convertibles, for examples, or sub 600 dollar laptops). Candy crush hasn't been installed by default for years now. There's plenty wrong with Windows 11, but the spam has severely reduced and the user experience has improved in many points (and made worse in others, i.e. not being able to dock the task bar to the side, though you can't do that on macOS either).
- donarb 4y ago> not being able to dock the task bar to the side, though you can't do that on macOS either In System Preferences > General you can set the dock to the left, right or bottom of the screen.
- AnthonBerg 4y agoI have honestly, earnestly tried. I have tried to find a laptop that is for my needs and purposes truly equivalent to an Apple Macbook Pro. Or better. I always end up going with an Apple machine. There has always been a significant part of the assembly that just isn’t as good. It’s often disk speed or display quality. Build quality too. I want to underline that this is true for what I need out of a laptop. The opposite has been true in desktops. I have a Ryzen 3900X box and there still isn’t anything from Apple that I would replace it with. Not even to run macOS on it (which I do on the AMD box, using GPU passthrough).
- JimmyAustin 4y agoDepending on your workload, the Mac Studio would be the replacement for a 3900X box. It's not a GPU powerhouse, and lacks expandability though.
- AnthonBerg 4y agoThat’s exactly it :)
- microtonal 4y agoThe opposite has been true in desktops. I have a Ryzen 3900X box and there still isn’t anything from Apple that I would replace it with. Not even to run macOS on it (which I do on the AMD box, using GPU passthrough). My MacBook Pro 14" is pretty much on-par with my Ryzen 5900X CPU-wise (the M1 Ultra would surpass it by a wide margin). The GPU of the M1 Max is nothing to sneeze at, but I'd love it if they'd bring eGPU support to the M1 line. (And if one can dream, if NVIDIA would also make CUDA available.)
- 4y ago
- sschueller 4y agoIf you spend apple prices on PC hardware you will get more performance and a lot less plastic crap.
- seanmcdirmid 4y agoI think you mean a lot more plastic crap, right? For a PC laptop of the same price (eg Lenovo X1), I find that they are a lot more flimsy than a aluminum unibody construction. In fact, I mostly moved to Apple to get away from plastic. If I’m wrong and you have specific examples, let me know. But the last time I checked, PC quality price per price was still pretty bad compared to Apple.
- howinteresting 4y agoA Lenovo X1 can handle spills unlike an Apple laptop. That's what build quality is about.
- ThePowerOfFuet 4y agoThis has been debunked time and time again over the years; when you spec out something truly similar, the price is more or less the same.
- lynndotpy 4y agoWait, what? I think I'm missing something because the price difference is still there. This argument is old as the hills but has generally held up. The 2020 MBA (to avoid having arguments comparing ARM and x64 cpus) launched at $1000 started at a 256GB disk, 1.1GHz two-core i3, and 8GB of RAM. A quick search will find the 2020 Acer Swift 3, $700, with a 512GB disk, 1.8GHz eight-core Ryzen 7, and 8GB of RAM. It looks pretty sleek, metal, and thin too. I do mean this sincerely, am I missing something? Because I don't know of any perspective where the price-spec gap disappears with Apple laptops. When people talk about buying Apple "for the hardware", I really don't think the argument is about the specs.
- 4y ago
- deleted 4y ago[deleted]
- jchw 4y agoI really feel this way. The two Apple products I own are an iPhone, and an M1 Mac Mini. The hardware is good. The software often thwarts things I'm trying to do and pisses me off greatly. At least on the Mac Mini though, I can disable SIP and go crazy, or install Asahi Linux. iPhone is gimped really hard and even a $100/yr developer license doesn't really help you that much; you're still not getting basic WebM in Safari or alternate browser engines. I know it's popular to not like Android for being janky, not as privacy-respecting, fragmented, or simply because of the fact that it's Google, but I don't really mind Android that much, even given all of its faults. It's mildly annoying but at the end of the day it feels like there's very little that I simply can't do. I mostly use Google devices, so I can always root and flash other ROMs.
- krzyk 4y agoYeah, Android is much more hacker friendly than iPhone with its closed ecosystem. iPhones and Macs is more for people that don't want to tinker with their hardware/software.
- pcthrowaway 4y ago> iPhones and Macs is more for people that don't want to tinker with their hardware/software. The author of this article notwithstanding
- davidro80 4y agoHey fyi webm support is native in iPhone safari now. Noticed it a few days ago when I was surfing an image board and suddenly I could click and play them.
- jchw 4y agoThanks for letting me know. Unfortunately, I suspect that the website you were viewing was either transparently decoding the webm in JS or transcoding it on the server; I can’t find any info suggesting MobileSafari supports WebM in any version, and I just updated my iPhone but I still get a negative result over here: https://www.webmproject.org/detect/ https://www.webmproject.org/detect/ If you get a positive result, please let me know. I would be willing to jump to a beta for that…
- mpweiher 4y agoThe way I put it is that with hardware, Apple had their "come to Jesus" moment a couple of years ago. With software, they're still Johnny Ive^H^H^HSwift: just as cocksure as to how perfect they are as they are actually bad. It used to not be that way at all. They had OK-ish hardware that was basically a dongle for the awesome software.
- teddyh 4y agoApple used to be an oddity; a hardware company that was also good at software. If they are now reverting, it’s at least reassuring to see that the conventional wisdom still holds; i.e. that companies can be good at software or hardware, but never both.
- intsunny 4y ago> Apple: Great hardware, barely tolerable software. I think this is more accurate: Apple: great hardware, software better than the low low bar set by everyone else Linux ships with 2394230 desktops, and Windows apparently isn't even designed by people who use actually use Windows: https://news.ycombinator.com/item?id=30019307 https://news.ycombinator.com/item?id=30019307
- withinboredom 4y agoI’ve worked for a few dev shops now where the entire company uses Apple but over 90% of the customers interfacing with the software are on windows.
- howinteresting 4y agoAt least on Gnome, animation speeds aren't dependent on the aspect ratio of your monitor. macOS is an embarrassment of a system to actually use day-to-day.
- peoplefromibiza 4y ago> software better than the low low bar set by everyone else as a former Mac user, I think Mac software is kinda great on ways other systems cannot keep up: constant upgrades, function over form without sacrificing form, when an old/surpassed API is deprecated, community reacts very fast. But Apple software and especially MacOS? Not really.
- seba_dos1 4y ago> software better than the low low bar set by everyone else You mean, "set by you". It doesn't pass the higher bar set by me, which is easily passed by Plasma.
- ajkjk 4y agoBetter software than windows, though. Every time I go back to a Windows machine I'm traumatized by something that should be trivial within like the first hour. The most recent example was navigating control panel menus while trying to figure out why a microphone wasn't picking up my voice. Somehow every tiny management task like that is an absolute disaster on Windows.
- loeg 4y agoOS X disables volume control if you're playing on an HDMI monitor, for no particular reason. I don't think it's clear that Windows is worse in this area.
- PaulDavisThe1st 4y agomodern macOS can also semi-silently deny an application access to the mic. It's not a stupid thing to do, but it certainly can confuse the crap out of users who missed the "allow X to use mic" popup in the past.
- radicality 4y agoAnother thing that’s confusing to me is similarly with some applications requesting access to folders. I swear I’ve had situations where I download some software, and then I try open with it some file in my Downloads folder. OSX then shows a pop about requesting access. I remember either just ignoring that pop up or clicking cancel, and then still having the software somehow load the file! That seemed like a serious security issue and I don’t really trust those filesystem access protections on osx anymore.
- kalleboo 4y agomacOS will allow access to single files to software without any permissions if the action to open the file was deliberately done by the user (e.g. the file was selected in an OS open file dialog, the file was double-clicked, or dragged onto the app icon, etc). The app gets a runtime-limited lock on that one file and still can't willy-nilly list or read other files. IIRC this is also the only run-mode for sandboxed App Store apps, where all file opens must be user-initiated (and some utility apps work around this by asking you to open the disk root manually)
- torstenvl 4y agoApple: Great hardware. Great software. Terrible combination. I like Windows on Bootcamp. I like hackintoshes and my 2015 MacBook Pro. It's trying to bend macOS to my will on recent systems that causes wailing and gnashing of teeth. I wish there were some kind of mechanism to maintain current levels of system security while allowing previous levels of freedom. Maybe a way to sign a Yubikey and the Recovery partition with an Apple Developer account, after which booting with the Yubikey on that system would allow you to, e.g., install an older version of macOS, or make changes to /System.
- swozey 4y agoI was on this boat too, building hackintoshes, etc until the M1 came out. I refused to ever buy an actual Apple machine, especially since work gives me one to use for work/coding. I'm sold on the m1 though, miraculous little device, love my 14" powerhouse. M1 max, 64gb ram.. And I have PORTS again. I used the HDMI port the first day I got the machine. Expensive af but it'll hopefully last me 5+ years.
- lordgilman 4y agoUsing the rdisk over the disk device for this sort of dd bulk copy has been recommended practice on MacOS X forever.
- config_yml 4y agoAs a web dev reading this, this must be how my mom thinks about my work. It seems a bit like wizardry.
- rajamaka 4y agoAfter reading this I came to the conclusion that smart people are really smart
- sydthrowaway 4y agoWait till you hear about the iOS jailbreakers / security community on Twitter. These people either have simply more CPU cycles to burn, or no life.
- capableweb 4y ago> These people either have simply more CPU cycles to burn, or no life. Or they're just faster at learning stuff than you, or smarter :) Sounds like a pretty interesting life. Hinting that the jailbreaking/security community has no life, on a site called "Hacker News", where most of us have some sort of hacker spirit, is misguided at best.
- drewg123 4y agoIts all about where you spend your time and accumulate expertise. I'm a kernel dev (FreeBSD), and this all made perfect sense to me. But a lot of web dev stuff I read about here seems like wizardry to me!
- DannyBee 4y agoIMHO, low priority io throttle has been just about horrible in every way since it was introduced. You can tell when it was introduced if you google for things like "time machine got super slow for no reason" and see when they start occurring en masse. It has a strong habit, even on 100% completely idle machines, of slowing down throughput by 10x.
- rob_c 4y agohave to agree, why this concept wasn't dropped once they shipped ssd is beyond me. The number of iops and throughput shot up overnight and most people are still playing catchup...
- projektfu 4y agoIs this recent behavior or has it been consistent in a few major versions?
- rob_c 4y ago(2016) https://www.mackungfu.org/massively-speed-up-time-capsule-time-machine-backups https://www.mackungfu.org/massively-speed-up-time-capsule-ti... Aka, this has been known by the power users for some time
- apple4ever 4y agoCan confirm, I've seen it on a couple Macs starting around that year.
- loeg 4y agoIf you scroll about 2/3 through the article you will see the author thinks it was a regression in Lion (2011).
- rob_c 4y agoThis is a "feature" that has been known about for _years_ .... e.g. (2016) https://www.mackungfu.org/massively-speed-up-time-capsule-time-machine-backups https://www.mackungfu.org/massively-speed-up-time-capsule-ti...
- rob_c 4y agoSeriously read the article it explains how to make the change permanent when needed
- jrmg 4y agoThe web page there describes this feature working correctly, not the bug this article is about. Low priority Time Machine I/O is throttled to allow regular I/O to run at full speed.
- rob_c 4y ago
- Dylan16807 4y agoWhat are you on about in such a rude way? The "feature", working correctly, throttles the backup. This bug is throttling half the system.
- rob_c 4y agoThis feature is an antifeature which is doing harm by interfering with system functionality. If you have a system with millions of files it is the poor performance introduced by this antipattern concept that breaks backups, copies or systems with huge codebases, I could go on. It's defective by design... But as has been said, this isn't a problem Photoshop users hit so will never be addressed. If you can't see an equivocal here you aren't understanding the problem and probably shouldn't be strongly commenting on it. If I were being rude I'd just be rude. My comment is fair and the downvotes reflect how you need to learn more about this area before sharing comments of "green apples aren't red apples" when we're talking about oranges.
- hit8run 4y agoApple has a lot of other bugs in their code, too. Did you ever try to delete a Bootcamp partition and merge it to you main disk when using their new filesystem? It corrupts the disk and in order to be able to reallocate the disk space you need to completely wipe the Mac and start fresh.
- merely-unlikely 4y agoI did that a couple months ago without issue as far as I can tell
- pengaru 4y agoFunnily in linux we've had kind of the opposite problem where dmcrypt at some point was changed to use high-priority, multi-threaded workqueues, creating a priority inversion situation. Regular userspace processes, even those with niced/lowered priority, could generate overwhelming amounts of CPU load just by creating a bunch of IO burden on a dmcrypt-backed mountpoint. Far more than their fair share in terms of their own process scheduling. The effects of this were especially visible when listening to mp3 files on something like a core2duo (or older) machine. Audio buffer underruns galore, just because you had a big git checkout or rsync running. It took me years to convince upstream to revert the responsible dmcrypt workqueue commit and fix this.
- ChuckNorris89 4y ago>Audio buffer underruns galore AFAIK, this was also due to the disk IO scheduler used in Linux. Back in the late 00's, audio or video playback would skip on Ubuntu if you had a torrent download on the same HDD, an issue not present under Windows or MacOS. AFAIK, desktop Linux distros now have different schedulers to mitigate this issue, but back then, that made it impossible for me to use it.
- pengaru 4y agoBack in the early days that was a problem as well, but things were better for quite some time even with dmcrypt in play. Then someone at Google landed a change prioritizing dmcrypt throughput for their use case, and many on desktop linux using dmcrypt suffered for years because of it.
- ahartmetz 4y agoAh, the "Linux is for servers" problem. Linus thinks the desktop is important, but most contributors work for companies that do server stuff or have mostly server paying customers...
- PaulDavisThe1st 4y ago
- gabereiser 4y agoThis actually bit me earlier this week when I had to write a Windows 11 iso to a usb stick. Using dd on macos, everything seemed like it wrote ok. Checksums matched. All of that. Yet when I booted the target machine with the usb stick, windows installer kept asking for drivers. Back and forth with the motherboard manufacturer and debugging and I narrowed it down to this bug in dd which skipped a few bits (or wrote them incorrectly). Needless to say, I used a friends windows machine to make an install stick using Microsoft’s media creation tool and that worked out of the box. Strange. The only other explanation I have is that their direct download iso was corrupt or that this dd bug prevented it from writing correctly. UDF file format. Bootable image. UEFI. SecureBoot enabled. Standard Intel chipset.
- withinboredom 4y agoAlmost identical problem earlier last month, except it made the drive read-only and had to fix it from Linux. Both Windows and OSX couldn’t fix it.
- pronoiac 4y ago> The only other explanation I have is that their direct download iso was corrupt I definitely got this impression, after a 2 or 4 gig boundary was crossed. I think I tried a Raspberry Pi to rule out a Mac issue. I had success with https://github.com/WoeUSB/WoeUSB-ng https://github.com/WoeUSB/WoeUSB-ng .
- stazz1 4y agowhat does a checksum do
- pronoiac 4y agoSorry, I didn't mean "the iso was mangled in transit," I meant "they appear to not understand iso." The iso checksum verified without issue. Looking into it a bit, this might have something to do with UEFI firmware that only had FAT32 drivers. It started the install fine, but it broke when it hit a 4+ gig file, which would probably look truncated.
- divyekapoor 4y agoFantastic writeup and a great exposition of how to do kernel debugging. Thank you!
- irusensei 4y agoPlease use /dev/rdiskN instead of /dev/diskN.
- saagarjha 4y ago> Amusingly, even spindump's symbolication step—which relies on an external daemon—suffers from this kind of problem—one which I diagnosed, of course, another well-timed spindump. Yeah, this can get real annoying when trying to diagnose hangs…
- sbf501 4y agoTIL about "spindump". These kind of triage reports are really useful for learning more about macOS. THink about it: when is the last time any of you read a user manual for an OS? macOS doesn't even have one. You're just expected to figure out how to use the GUI, and unless you pay for a class, debug through the command line is StackOverflow. Thanks OP for writing this up.
- fragmede 4y agohttps://support.apple.com/guide/mac-help/welcome/mac https://support.apple.com/guide/mac-help/welcome/mac
- fiddlerwoaroof 4y agoMost of Apple’s programs have user manuals in the help menu.
- sbf501 4y agoI should have been more specific. Yes, you are correct, an apple guide that explains how to use the red/yellow/green buttons, and what windows and double-clicking are certainly is the user manual I asked for. I meant something more in depth, like in the old days, I have two Apple //e manuals that have annotated ROM listings, and SystemV had a manual that was about 6 feet long on its side.
- marcellus23 4y ago
- linsomniac 4y agoLooks like a thorough analysis, but I question the use of "bs=1m". Author says they verified that "dd was correctly only using a one meg buffer", but "bs" is more than just a buffer, it's the "count" that read()s are issued in. As in "read(fd, 1000000);" for the syscall. I don't know about MacOS, but in the distant past I found that using larger "bs" values tended to cause my Linux machines to behave sluggishly, particularly when interacting with very slow media like USB sticks or SD cards. I tend to use "bs=32k" at the largest because it offers good performance while also limiting sluggishness. Using too small a value limits throughput because you spend so much time issuing read() calls and looping. I'm sure the author isn't going to set up that environment again just to run a test, but it would be interesting to know if a smaller bs value would have had any change in this environment.
- tedunangst 4y agoAbout halfway through I was guessing the problem was that the device node lived on the root filesystem, and therefore everything written to a device looks like a write to that filesystem, which may be another way to manifest a similar bug.
- daneel_w 4y agoAny particular reason you're not using the rdiskN (raw) device family, even if you're reading from the disk? I've done plenty of HDD dumps/restores on OS X and macOS over the years, with USB-to-SATA adapters, and so far I haven't caught any problems with neither reliability nor transfer speeds, always maxing out USB2 at roughly 35 MB/sec.
- jhugo 4y agoIf they'd used rdisk then they'd never have been able to write this article! It's mentioned at the end as the solution, which of course has been recommended and known to most technical macOS users since forever.
- userbinator 4y agowhen they're being artificially delayed to slow down their I/O operations, with the ultimate goal of optimizing the performance of higher-priority I/O Could this be another example of "the road to hell is paved with good intentions"? While the intent might be good, adding complexity with non-obvious side-effects is not.
- silvestrov 4y agoNow that most people no longer use spinning disks and SSD are extremly fast, is there any reason to throttling IO anymore? I'm guessing that if you do use spinning disks, then the disks are single purpose. They are not main OS drives, but external storage or backup disks.
- aasasd 4y agoMy go-to wrapper for long-ass operations is: taskpolicy -d throttle nice <rest of the command> Can't remember if I previously ran into general slowness from disk operations, but at least with the wrapper I surely don't. `taskpolicy` might require root permissions, however.
- chmaynard 4y agoTried it with a trivial command and it works as expected: $ taskpolicy -d throttle ls -a [expected output]
- gnicholas 4y agoThere also seems to be a bug that eats up free disk space, until restart. I've experienced it on my Intel MBP, which slowly goes from 20+ GB available to zilch. I assumed it was related to swap performance, but my wife is now seeing the same issue on her M1 MBP (on which she doesn't even use all of her 16 GB of physical RAM). On her machine, it eats up nearly 100 GB of space before forcing a restart. Has anyone else had this issue, or figured it out?
- capableweb 4y agoThat sounds like something gets written to a temporary directory (but not memory backed but filesystem-backed). Have you checked all system logs and such? Maybe take a look at running processes and sort by disk activity as well.
- gnicholas 4y agoWill give this a try! The thing that surprises me is that it's happening to both my wife and me, since our list of overlapping applications is very small. I assumed it was a system-level issue and will have to be fixed with a software update. In the meantime, I'm restarting my machine like it's 199x...
- thenthenthen 4y agoI have this. Do you put the laptop to sleep a lot? My thought has always been itll write the ram to disk when suspending, but doesnt clear this on waking, accumulating slowly on the disk until reboot. Also updates are semi silently downloaded (and installed) by default. On iOS there was a similar bug, first with ghost photos; deleted photos were never ever really deleted nor deletable slowly filling up the device.
- gnicholas 4y agoI probably sleep the laptop several times a day. This could explain the issue, because when I’ve run Disk Inventory X it shows lots of large files that I can’t figure out. I have my Mac set to never pre-download software updates though. If writing RAM to disk is the issue, what’s the solution?
- Fnoord 4y agoYup, I stumbled upon this doing something as simple as writing a Raspberry Pi OS image on macOS.
- apple4ever 4y agoHOLY COW. I believe I have been running into this weird bug for years now, even through getting a new Mac (iMac 27" 2015 -> 2020). I could never figure out _why_ things would slow down like this. I would just reboot and everything would be all better. At first I thought it was my iMac or the memory, but after a new computer that couldn't be the case! I have external drives, and often use them, so that's why this seems to happen. But I will confirm next time does.