5 ms·
That's not the hard part of using a Pi as a desktop PC... I've been using them for light to moderate desktop use for years now. The important things in deskto
by Syonyk 5y ago
That's not the hard part of using a Pi as a desktop PC...
I've been using them for light to moderate desktop use for years now. The important things in desktopping a Pi, as far as I'm concerned:
- Fix the storage. The SD card is fine for a toy. It will not withstand actual daily use, either in "delivering sane performance" or "handling a lot of random writes without dying in a year." Get a USB to SSD adapter and a cheap 32GB or 64GB SSD from eBay - doesn't have to be fast, doesn't have to be new. It's radically better than an SD card in any use case that resembles desktop use. You can either boot straight from USB, or, to improve compatibility with weird USB to SSD adapters, boot from the SD card, mount root from the SSD, and use the SD card for swap or something (see below).
- Enable zswap if you're not on a 4GB or 8GB Pi4. It should be a module included in the Pi kernel now (I had to argue for a while to get it included). This is not zram - this is zswap. There's a huge difference. It's a compressed swap system that can flush out old or poorly compressible pages to the actual swapfile - which, since you're now fronting it with a compressed swap region in RAM, can be over on the SD card. The bulk of the stuff written to it will never be used again, unless you're just massively overcommitting RAM, at which point nothing really will help. I think around the 5.x kernels, z3fold starts working, though I've not seen a real practical difference between z3fold (up to 3 compressed pages per page of RAM) and zbud (only two compressed pages), as long as same filled pages are enabled - that will crunch a page of 0s down into a "Got it, all 0s, done!" note and not bother wasting space compressing it.
- Set the governor to performance. 'sudo cpufreq-set -g performance' The stock governor is really bad about ramping up, and leads to lag in typing, especially if you're using the atrocities that are modern "desktop" apps (Electron). Eventually, the system will spin up and do something useful, but you improve the performance and responsiveness rather substantially by just pinning the cores to their fastest speed and letting them stay there. I'm sure there's some measurable power difference doing this if you're concerned about the absolute lowest power, but it's not substantial, and "race to idle" solves a lot. If you're using a Pi as a desktop, try it - you'll like the change.
- Use adblockers. It's amazing how much CPU time the internet spends on stuff that is advertising, tracking, and generally evil. Most websites behave a lot better once you remove that garbage.
Otherwise... once you've done that, they're actually quite capable little systems! The Pi4 with 4GB or 8GB is the best option right now, and for most people I'm not sure the 8GB really gains you much - I have one, use it fairly heavily, and rarely see any RAM pressure past about 4GB. But it does make up for some slow disk.
I've written about some of this more extensively over on my blog over the years, if anyone wants more details - link is in my profile.
- geerlingguy 5y agoWith the Compute Module 4 and certain boards, you can use (and even boot from) NVMe SSDs natively. Makes a world of difference for so many things!
- jandeboevrie 5y agoJeffs case review of the argon one m2 case was the reason I bought it. The pi boots directly from an SSD, much faster and no more broken SD cards.
- Syonyk 5y agoI should sit down and benchmark those one of these days. The jump from USB2 to USB3, either with or without UAS (it's nice, but doesn't lead to a huge jump in benchmarks) gets you a ton of disk performance, and my gut feeling is that while you could certainly measure the performance delta from USB3 to NVMe, it wouldn't lead to a practical increase in speed for typical desktop use. Going from glacial SD cards even to USB2 SSDs is a huge jump, but USB3 to NVMe seems like it would be going from "Fast enough that it's no longer a bottleneck" to "Even faster." Though for reasons I don't understand fully, all the ARM boards I've tested have very poor USB3 performance compared to Intel. Same SSD, same USB adapter, and the Intel systems absolutely crush the ARM systems (Pi4 and Jetson Nano) in small sector IO performance. The main problem with NVMe is that the various carriers that support it aren't cheap, and often (at least in the past 6-8 months) aren't really available. You can get a USB3 adapter and used SSD for $30, reliably, any time you want.
- prox 5y agoGreat tips! I have been using the internal SSD for a while now. I do regular backups or just clone a new SSD. In the article : Firefox uses 900Mb! How did we get to the point that a browser needs 900Mb???