1
0
Fork 0
isopod.cool/blog/posts/building_a_sensible_server/index.md

121 lines
20 KiB
Markdown
Raw Normal View History

2024-09-30 19:29:41 +00:00
It has become clear to me that the [laptop NAS](../building_a_normal_server/) I built in December of last year, while a fun project and a good learning experience, is unfit for the purpose that I need it to fulfill and is best stripped for parts and replaced. Here I'll detail the main reasons why it sucks and my plan to build something just a little bit more sensible.
## What In God's Name Have I Done
To get you up to speed in case the limit of your attention span is somewhere between one blog post and two blog posts, as of late last year I had been using an old gaming laptop as a home server for Minecraft and such things to great effect for a while, and had decided that I also wanted a proper NAS. Rather than buy a whole new CPU, motherboard, and RAM for this purpose, I saw fit to attempt to upgrade, or rather modify, or rather pervert, bastardize, and generally corrupt my existing laptop to have the storage capacity I wanted.
The end result of this initiative was a gaming laptop with a hole cut in the bottom to accept connections to a 2-port SATA controller card occupying the space where the WiFi card used to be, perched atop a custom chassis hewn of hardware store aluminum rods and 3d-printed brackets, within which was contained four high-capacity 3.5" HDDs, a pair of dubious SATA "splitters" to connect them all to the laptop, an ATX PC power supply to power the drives, and the pared-down mainboard out of a Supermicro enterprise-grade drive shelf to interface the power supply with a power button.
It was beautiful, and for reasons that are entirely beyond my ability to grasp, it didn't end up working very well.
This is where we find our intrepid hero today.
## This Whole Enterprise Was Fundamentally Ill-Conceived
I was expecting this thing to have problems, but I was unable to anticipate the specific problems it ended up having. Performance is... fine, actually. Better than expected, even. That horrible little 2-port SATA expander, or, failing that, the SATA multiplexers, are almost certainly bottlenecking the bandwidth to the HDDs, but it's fast enough to saturate the gigabit network infrastructure in my <span class="house">house</span>, so it doesn't really matter.
In fact, this little fucker is absolutely perfect for hosting an SMB share. It's been great for backups and the extensive collection of Linux ISOs that I install to machines on my network using Jellyfin.
The real problem is stability. Crashing has been a constant problem, especially when I touch anything software-wise. I try to update an app and it crashes. I try to install Syncthing and it crashes. I *browse* for new apps to install in the TrueNAS web UI and it bloody crashes. It crashed while running a system update once. I briefly attempted to spin up a Minecraft server on this thing and it crashed when I went to turn Minecraft *off*. Sometimes I'll go to use Jellyfin and it just won't be there and I'll have to troubleshoot it, which usually involves a good couple reboots. This must be how people felt dealing with old versions of Windows. Put <span title="🦐">shrimp</span>ly, this is fucking unusable.
Like the Windows Vista users of old, I have no clue where to even begin diagnosing this. The one possibility I've got is that it could have something to do with the fact that my laptop keeps throwing "SMART errors" during boot, but like, I'd expect TrueNAS to complain if something was actually wrong and even then I've tried and failed to diagnose the SMART errors anyway!
Whatever this is, I feel pretty well hopeless to fix it, and even then, it's also been getting some worrying temperature readings as of late and when I tried to re-paste it I stripped one of the screws holding the cooler on. So I guess short of some surgical dremel-ing of some tiny screws that's never gonna improve. With all that to contend with, I'm about ready to give up on this thing and start from scratch, properly this time.
However, despite all the problems with the laptop itself, all the other hardware has been nothing short of totally rock-solid. All of it has worked as advertised and I'll be carrying the drives and, if possible, the PSU<sup id="n1r"><a href="#n1">1</a></sup> over into the new system.
## Something Just A Little Bit More Sensible
### Angle of Attack
Firstly, as previously mentioned, the PSU and storage are accounted for already. I have eight total drives I want to put in the system: two 256GB SSDs as mirrored boot devices, 2 1TB SSDs, also mirrored, for TrueNAS apps and such things, and four big boy hard disks for bulk storage. Most of that stuff was bought for the original build, but the mirrored SSDs proved infeasible in the end. I don't strictly *need* them, but it would be very nice to have. Anything in serious consideration will need some way to accommodate my preponderance of SATA devices.
This narrows down the possibilities considerably. Namely, a lot of the common advice for cheap or beginner home servers doesn't apply to me. A mini PC or almost any used consumer desktop wouldn't have enough space for drives, and anything new is right out for the same reasons plus cost &mdash; half the reason I did the laptop NAS project in the first place was to *save* money.
I briefly considered getting a used workstation PC of some description. A used Lenovo Thinkstation P520 would have mounting space for all my drives and plenty of performance, but the proprietary motherboard, PSU, and power delivery system in general gave me pause, both for [repairability reasons](https://isopod.zone/notes/9uwehufw3t) and because I wasn't confident I could actually run power to all the drives. And that's the *best* option I've found.
I could get a used rack-mount server, like a Dell PowerEdge or similar. This is also a decent option, and it would be *quite* cost-effective, but I've got a few good reasons not to. First, most of these servers have old Xeon datacenter chips in them that are still good for many home server tasks, but aren't particularly fast or efficient. Take this PowerEdge R730 for instance:
![An Ebay listing for a Dell PowerEdge R730, with two Xeon E5-2623 v4 CPUs and 128GB of RAM, for $187 CAD, plus $57 CAD in shipping.](ebaypoweredge.png)
This has two Xeon E5-2623 v4 datacenter CPUs. At 4 cores/8 threads and 85 watts apiece, this server would have the same core count as the Ryzen 5700G in my desktop for almost three times the power draw, and *half* the single-threaded performance. In many cases, especially for servers, lackluster single-core performance isn't a problem, but if I want to run game servers on this, which I do, these chips may struggle.
Plus, rack-mount servers kind of suck for home use. They're very unweildy if you don't have a rack, and I don't, nor do I have anywhere to put one. They also tend to be *loud*. If you think the gaming laptop you've been using in your bed for the past three years and never cleaned sounds like a jet engine, you ain't seen nothing yet. Having one of these in my room would be intolerable. Of course, the R730 is a 2U server with no provisions for my 3.5" drives anyway, but a unit that could accommodate them wouldn't be much better.
Logically, then, the only remaining option is to build a system from scratch, out of used parts, to my specifications. That, therefore, is what I shall do, and I think I can do it for a similar amount of money to the GPU upgrade I was *planning* to get before this whole thing really started becoming an issue. Here's my plan:
### My Grand Design
In spite of the machine it's in, I've found that the i7-9750H in the laptop performs admirably for my use case. I don't really need a CPU upgrade here &mdash; hence my efforts to repurpose the existing one &mdash; unfortunately, however, the BGA form factor of this particular chip is incompatible with 100% of consumer desktop motherboards, so I'll be needing a new CPU regardless. Though I don't want or need a major upgrade, I also don't want a *downgrade* if I can avoid it, so I'll primarily be looking at other high end gaming chips from the era.
I initially gravitated towards the 9750H's desktop counterpart, the i7-9700K, for these reasons, but the significantly lower price, improved energy efficiency, superior upgrade potential, support for unregistered ECC RAM, and *vastly* superior multicore performance<sup id="n2r"><a href="#n2">2</a></sup> of its contemporary, the Ryzen 7 3700X, made the latter a bit of a no-brainer. I found one on Ebay for a cool 100 Canadian Prize Tokens and a matching X370 motherboard with *eight* whole SATA ports, which astute readers will recall is the exact amount I need, for about a hundred of God's True Imperial Dollars. As for cooling, the 3700X is a 65-watt chip, so the box cooler I've got lying around from my 5700G should suffice.
The 3700X lacks an integrated GPU, so I'll need a dedicated one in some form. Since I'm installing a server OS that's gonna output plain text to a display exactly once per install, I won't need a ton of graphics horsepower. I considered something like a GT 730 for a token display out and nothing more, however I'd like some transcoding capability for Jellyfin as well. After some research into cheap, low power GPUs for this I settled on an Nvidia Quadro P400 for about 60 CanuckBucks&trade; after shipping.
I've seen some redditors complaining about the P400's performance doing two 4k HDR streams at once, but all that tells me is that it can handle at least four simultaneous 1080p SDR streams, which is what I intend to use it for, without breaking a sweat. If I *really* need more, I can always upgrade to an Arc A310 once driver support for those in TrueNAS is less sketchy.
TrueNAS likes a lot of RAM for various ZFS-related purposes. The laptop seems happy with 32 gigs, so I'll start there and upgrade down the road if need be. I'll grab something cheap from a reputable brand, and I'll probably get it new since used prices on DDR4 are currently not really better.
I'd also like to get a pair of 10Gb network cards at some point to attach this thing directly to my main computer for maximum transfer speeds between the two, but that's not really critical and I'll worry about it later.
Finally, I need a case. Fortunately, this time around I don't have to build one myself. After a cursory search on PCPartPicker for cases with four each of 2.5" and 3.5" drive mounts didn't turn up anything for particularly cheap, I went to look at used ones and didn't initially have much luck there either. I scrolled through about a dozen listings for off-brand gamer-spec swill that wasn't even priced better than the name brand stuff before filtering by used and finding a bunch of listings just labeled "PC case", none of which I could confirm met my exacting needs.
The first case I found that obviously fit my use case was this thing, the weathered old shell of a Pentium III tower from the dawn of the ATX standard:
<figure class="media">
<div>
<img src="servercase.jpg" alt="A beige PC tower with four 5.25&quot; bays and two external 3.5&quot; bays, populated with an optical drive and a floppy drive respectively. The only visible branding is a Pentium III sticker and a badge that reads &quot;TOUCH&quot;.">
<figcaption>I'm curious about the branding here. If anyone recognizes that "TOUCH" badge, get in the comments.</figcaption>
</div>
</figure>
Honestly, I kind of love it. I'll transfer the 5.25"-to-3.5" adapter cage I bought to mount the drives in my homebrew case to the bays in this thing wholesale, and I can 3D print some brackets to mount the SSDs in the 3.5" bays. And, somewhat counterintuitively, it might actually be *easier* to build in than those modern RGB glass side panel power supply basement having ass Gaming&trade; cases:
![The inside of the same old PC case. Its layout is extremely pragmatic: motherboard in the very bottom corner, PSU in the top corner above it, and all the drive bay mounts are in a cage lining the front side. In other words, it looks like an old PC case.](servercaseinside.jpg)
Just look at it. Everything's right there. I can take the side panel off and instantly get to every component with my hands without spinning the case around and I don't need to run any cables through any fucking gromets to get them where they're going. It looks supremely convenient. As the type of person who enjoys *building* computers and not just using them as decoration, this is beautiful to me.
The biggest issue with this case is the cooling. It's absolutely pitiful by modern standards. Based on these photos, it looks like there's a single 92mm, possibly 80mm, fan each for intake and exhaust, with a passive vent in the side. I'm already bringing some extra cooling to the table &mdash; my drive cage has a mount for a 120mm fan, and I can use the fan in my much better ventilated modern PSU for extra exhaust, and with a 65W CPU and no meaningfully powerful GPU that might just suffice. If not, I've got some ideas involving 3D printing and/or a hole saw to make this thing a little less stuffy.
### Actually Building The Sucker
Everything above that heading there was in large part written a few weeks ago, when I was ordering all this stuff and it was all fresh in my mind. We now rejoin our intrepid hero as she receives the last of her Ebay orders and prepares for initial testing.
When I got it, the case was pre-loaded with all the stuff in those photos up there: a CD-ROM, a floppy drive, a power supply, a single 80mm intake fan<sup id="n3r"><a href="#n3">3</a></sup>, and a generous helping of, to quote the PC repair technician from my Youtube shorts feed, Swamp Gooch&trade;. The first thing I did was take the case apart and remove all that stuff, because I certainly wasn't going to be using any of it, least of all the dubious PSU. The next thing I did was hose it down to get rid of the almost thirty years of Home/Office Residue that had accumulated inside.
Once it was clean, the case did, admittedly, need some updating. The set of motherboard standoffs in the case was incomplete &mdash; six of the usual nine were present &mdash; so I ordered new ones. I also had to design that 3D printed adapter bracket for my 2.5" SSDs myself, as well as a mount for another 80mm fan to eke some more airflow out of those unused front expansion bays<sup id="n4r"><a href="#n4">4</a></sup>.
After the case was prepared and the mounting brackets printed, there wasn't much to do until all the other parts arrived. I learned about some interesting limitations of the motherboard in my main computer while testing to make sure the GPU worked. I think I might be the sort of person who buys motherboards with the high-end chipset now.
The last major component to arrive was the motherboard, and it arrived missing some important hardware, namely the M.2 standoff and the stock mounting bracket for the CPU cooler, the latter of which was *in the photo on the Ebay listing*! Fortunately both parts are pretty cheap to order online.
Assembly went smoothly; not much to say here that you couldn't get from Linus Tech Tips. It turned out that *both* the original standoffs *and* the ones I ordered were the wrong height &mdash; the original ones were too long, and mine were too short. I ended up putting the original standoffs back in because neither were so far off as to render the rear I/O unusable and my standoffs made installing the GPU properly impossible.
I had to use a couple of breadboard wires to hook up the power LED, since the pins on my motherboard were right next to each other and the connector in the case was 3 pins wide with a blank one in the middle, for some reason. Also, unlike *some* cases I've worked in, accessing the modular PSU cables was an absolute joy<sup id="n5r"><a href="#n5">5</a></sup>.
What didn't go smoothly was actually booting the thing. On first power on, it failed to POST and got stuck on a code "8" on the little seven-segment diagnostic code display. I initially assumed it was training the memory, since this can take a while on first boot, but after about five minutes of no change I started getting worried. I read a lot of very worrying forum posts that suggested that either the CPU or motherboard were straight up dead, and I very nearly bought another CPU to see if that was the case. First, though, I decided to try updating the BIOS using the "BIOS Flashback" feature, and that fixed it immediately.
<!-- As an aside, having gotten my hands on this case, I love it even more. Everything is just as accessible as it looks, and there is well and truly *nothing* crammed behind the motherboard tray. The only reason you would even take the other side panel off is to take the motherboard tray *out*. The CD-ROM drive and 3.5" cage are both on rails for easy removal. Stripping this thing of all the pre-installed hardware was such a smooth process it almost makes me resent the modern Gaming case I built my main rig in. And coolest of all:
<figure class="media">
<div>
<img src="servercaseinsidefront.jpg" alt="The same old PC case from before with the plastic front panel taken off, exposing the front of the metal frame. The requisite front panel buttons and indicator lights are clipped into little specially-shaped holes, and the entire top and right-hand edges of this side of the frame are lined with identical holes for a panoply of different arrangement possibilities.">
<figcaption>Every one of those little rectangular holes is a place where the front panel buttons and LEDs could go!</figcaption>
</div>
</figure>
Look at all those mount points for front panel buttons and lights! My guess is this was done in order to better facilitate a variety of different plastic front panels, so different systems could be given different aesthetic character without making changes to anything structural. You can tell the people who designed this case really wanted to make the most of their hard work. I think design features like this should be required by law. But enough about Our Intrepid Hero's New Favourite Metal Box. -->
---
<p id="n1"><a href="#n1r">1</a>. I'm not referring to the Seasonic S12III from the last installment. That thing is honestly a little sketchy for me to be using it in a proper server if I don't have to, and I don't. When my PC's power supply, a Seasonic GX650, exploded, I RMA'd it and then bought a beefier one to replace it with, and the replacement unit Seasonic sent me went in my server, and will be going in the new one. The S12III is serving as an improvised benchtop PSU using one of <a href="https://m.media-amazon.com/images/I/71UqFQ9U1QL._AC_SL1500_.jpg">these bad boys</a> at the moment.</p>
<p id="n2"><a href="#n2r">2</a>. If cpubenchmark.net is to be believed, anyway.</p>
<p id="n3"><a href="#n3r">3</a>. I could, in theory, reuse this fan, but I don't want to. It's so nasty that attempting to run it seems like a good way to invent a new respiratory illness, and even if I cleaned it the bearing is geriatric and the performance probably isn't very good, plus my modern motherboard might not even have a header for it. Its replacement will suit me much better.</p>
<p id="n4"><a href="#n4r">4</a>. You can download the model for the fan mount and corresponding grill I designed <a href="https://www.printables.com/model/1014992-80mm-fan-mount-for-3x35-drive-bay-in-old-pc-case">here</a>. I'd publish the drive bracket but the one I printed needed some modification in order to work, and I don't want to spend the time and filament to refine it right now.</p>
<p id="n5"><a href="#n5r">5</a>. Mind you, this case is well north of 20 years old. This case shipped to me with a Pentium III sticker on it. This thing may well predate modular power supplies as a <em>concept</em>, and somehow it accommodates them infinitely better than the 2-year-old case on my personal machine, which barely has room to <em>insert</em> a modular PSU, let alone actually get at the cables afterwards. I don't understand how this is possible.</p>