Cheap server from Chinese parts. Part 1, iron

Cheap server from Chinese parts. Part 1, iron

Cheap server from Chinese parts. Part 1, iron
Blurred cat posing against custom server background. In the background is a mouse on the server

Hey Habr!

In the life of every person, sometimes the need for a computer upgrade is brewing. Sometimes it is buying a new phone to replace a broken one or in pursuit of a fresh android or camera. Sometimes - replacing the video card to pull the game at minimum wages. Sometimes - installing an SSD in a laptop on which you installed the tenth Windows, but she doesn’t really like to live on Core2Duo and 2.5 gigabytes of addressable memory, and she unloads unused pages to the swap file all the time, destroying the already not great exchange rate from 32- gig disk.

My story is a server upgrade, which was assembled during the first year of the institute. My needs have grown over the past six years, and he certainly got an increase in both RAM and disk space. The problem is that with new knowledge, new ambitions were obtained - the desire to apply this knowledge in practice - and he could no longer cope with them.

First there will be some boring introductory text, and then the pictures will go.

Purely in order to make it clear which server is now:

CPU: Core i3-2130 4 streams, 3.4 GHz
RAM: DDR3 8 GiB
SSD: 250GB

Further, this server will hardly be mentioned, these main characteristics are solely in order to have something to compare with and it is clear why I decided to overcome my laziness and spend time and money.

I myself am not yet sure what exactly will have to work on the new server, but some abstract thoughts make us assume the following tasks:

  • Hosting a couple of static sites. Now nginx is doing this, but with not the best configs. They will also need to be corrected, but more on that in the second part.
  • Hosting just static files. For example, pictures from this article. They also go through nginx, but they are loaded through WinSCP, which is inconvenient. It would be necessary to dig up a semblance of myOwnCloud so that you can easily and naturally upload pictures to the server.
  • Build server for pet projects. Now it's Jenkins.
  • Various stands for these projects: development, integration tests and prod. So far, things have not come to the sale, but there is only one stand, although in the docker.
  • Some game servers, if friends want to play something that requires a server: Starbound, Minecraft, Squad (although at least forty people are needed there). Yes, even CS 1.6.
  • Virtual rooms for friends, if they suddenly need to host something somewhere. Or for yourself to have a kind of VDI. What to download - there would be iron.

Politically distant plans:

  • Torrent downloader: to support rare distributions on the root tracker. True, we need to figure out how to download them automatically, where to store them, whether the provider will be against the constant background of distribution and, most importantly, whether uncles in uniform will be interested in terabytes of purposefully distributed music with books.
  • An exit point from some TOR: nice, but no. For the same reason.

Nevertheless, it is possible to give part of the capacities for an analogue of the now closed SETI@Home. Maybe a habrauser familiar with this will tell you where to put the ardor?

Platform Selection

Yeah. We figured out the motivational part: I want iron, but it’s not clear what for. It would be necessary to decide what kind of iron you want.

Cheap used equipment is regularly mentioned on Habré: whether it is the distribution of servers by an orange man or recent article about used ear flash accelerators. Professional equipment is expensive. For a developer in Moscow, it is tolerable, but expensive.

However, professional equipment is expensive because corporations have a lot of money and have technical support and a quality guarantee higher than that of consumer goods. Not always, but the expectation is clearly biased for the better.

So, the goal is to assemble a server from used (read - cheap) parts and leave room for a minor upgrade in the next five years. Such spare parts are cheaper than new ones, and there may still be enough resource for measured home use. (I composed this goal after I assembled the server. Everything is in the best traditions of writing a diploma)

As a consequence of the goal, the equipment should have one of the best “parrot / ruble” ratios, where the bit depth of the parrot depends on the type of equipment: RAM - volume (not speed, no), disk - volume (and speed), processor - it’s difficult here. Let it be synthetic benchmark parrots.

It is desirable that the server strive for noiselessness. I don’t promise exotics in the form of custom heat pipes and fanless coolers, but the server is destined to stand in the bedroom aka remote office aka my room, so I would like it not to roar in idle mode like a jet plane on takeoff.

The starting point is cheap Chinese xeons, which I learned about in ancient times, perhaps also from Habr. In comments to one of the passing news, the coal of the holivar "Intel against AMD" fell. It’s impossible not to compare, suddenly the new ryzens are really better than Intel processors - I haven’t followed them for five years, or even more.

So, the comparison involves two parties with approximately the same indicator of parrots according to cpubenchmark: Ryzen 7 2700, Ryzen 7 2700x, a pair of Xeon E5-2689, pair E5-2690, pair E5-2696v2 and current Core i3-2130. Of course, I also compared other processors, for example, the new Core i7, the new Ryzen 7 and Ryzen 7 2600, but it is this cut that is of primary interest: they are about the same in terms of processing power. In the end, this is not an attempt to resolve the holivar, but the choice of the most suitable processor for me. The E5-2696v2 and i3-2130 are for comparison only with other used ear processors and the current server.

AM4
LGA2011

7 2700x
7 2700
e5-2689
2x e5-2689
e5-2690
2x e5-2690
2x e5-2696v2
i3-2100

Rank, parrots
17898
16021
10036
17945
10207
18967
23518
1839

Price, rubles
15200
12500
5000
10000
5500
11000
18000
1000

Thermal power, W
105
65
115
230
135
270
260
65

Cores, pcs
16
16
16
32
16
32
24
4

Frequency, GHz
3,7
3,2
2,6
2,6
2,9
2,9
2,5
3,1

Parrots/rubles
1,18
1,28
2,01
1,79
1,86
1,72
1,31
1,84

Parrots/W
170,46
246,48
87,27
78,02
75,61
70,25
90,45
28,29


The table is boring to consider, let's look at the graph of absolute parrots:
Cheap server from Chinese parts. Part 1, iron

I thought about omitting this graph, but then I would have to look at the table with my eyes, and not everyone likes to do this. So this is a training chart. On the left is a scale of whatever, in this case abstract synthetic parrots. Signatures below - processors. On the left - a pair of ryzens, in the center - a pair of single and double xeons. Confusing, yes, but it's a fact. On the right are two xeons of the second generation and the processor of the current server.

Having familiarized yourself with the location of the processors, it is worth taking a look at the graph of the cost of one parrot:
Cheap server from Chinese parts. Part 1, iron

It can be seen from it that the most profitable is to take a single first-generation xeon. Double xeons are slightly worse than single xeons: the cost has doubled, and the efficiency - 1.7 times, that is, the ratio has decreased. But the second generation xeon is no longer profitable: the cost for a parrot is already approaching ryzens.

And the ryzens are damn energy efficient in terms of a parrot:
Cheap server from Chinese parts. Part 1, iron

Admittedly, at that moment I felt proud of the progress of humanity and AMD. This is no longer an extensive development path, these are attempts to squeeze the maximum out of a piece of silicon. The E5-2690 came out in 2012, and the Ryzen 7 2700 came out in 2018. A threefold increase in energy efficiency in six years is not age for technology. And, well, the Core i3-2100 is somewhere completely invisible in the corner. Let's not talk about him.

Intermediate withdrawal: ryzens tear in the ratio "performance / energy consumption". Or is it an epic different way of measuring TDP from AMD and Intel. And second-hand ear xeons of the first generation are torn in terms of performance / price.

Thus, I will take xeons. You haven't forgotten the goal I set at the very beginning of this section, have you?

Other related iron

In fact, the choice of AMD vs Intel is limited not only by the processor used. Zen+ processors use DDR4 memory (tyts), and Sandy Bridge - DDR3 (tyts). DDR4-2933 is theoretically 1.87 times faster than DDR3-1600, if I understand anything about it. No, I remember from an institute course how DDR works, with all these ¬CS, RAS, CAS and others. And burst mode. I just don't want to go into it, because I remember very vaguely, and DDR3 is already implicitly selected by the processor, there is no point in suffering.

Besides 16 gig DDR4-2600 costs the same as 32 GB DDR3-1866* with ECC...

*It is not 1866, but 1778. I have no idea why the gloomy Chinese genius could not master 1866, but did not go down to the standard 1600 MHz either ...

Restrictions on the socket and type of memory also affect the choice of motherboard: for the same 7k rubles, you can take Chinese fee with a maximum of 256 gigabytes of RAM, and any AM4 socket It has a maximum of 4 slots for RAM, that is, it is limited to 64 gigabytes.

The choice of a two-socket motherboard leads to special requirements for the power supply: it must have two eight-pin contacts to power the processor. Maybe they will fit from a video card, but there are slightly different pin shapes, I decided not to take risks and not read the documentation, since power supplies with the necessary requirements exist.

This motherboard also has uncultured sockets: the distance between them is slightly less than 10 centimeters, which makes it difficult to install two coolers in parallel. Initially, I wanted to put the coolers in such a way that the air intake comes from the gap between them, but more on that below.

For data storage, I initially wanted to take the SSD that is already in the old server for the system, but decided to take it with the M2 Crucial P1 1TB connector. There are six SATA connectors on the motherboard, and I planned to connect six WD Red 2TB hard drives to them, but while I was wondering if it was worth spending another 12k rubles on them, they had already been bought. So setting up a ZFS raid is not included in the second part of the article. But this is later, the story is back about SSD. You can read a much more professional review on it here. Its feature is that it is cheap. Take a look at this recording chart for yourself:

Cheap server from Chinese parts. Part 1, iron

You can write 75 gigabytes at a time to it, and then it becomes worse than a hard drive. Thanks for keeping it from spinning. Oh, and it can only be overwritten 200 times. What is it even made of?

In fact, this is not so scary for the mode in which I plan to use it: mostly reading data and writing data that is not critical to the write speed. Well, I would like to hope so.

Rewriting resource 200 times corresponds to about 109 gigabytes per day for five years. 109 gigabytes a day is not the same as 75 gigabytes at a time. Yes, he is fine with reading. Not the best performance among M2 drives, but in line with the write level it shows within the cache.

Assembly

If before that there was mostly pseudo-technical text, interspersed with graphs, now pictures will go, diluted with artistic narration.

Suddenly, on Tuesday morning, the courier of the Russian Post called and said that he would arrive today with a parcel. I usually pick up the parcels myself, but here in quarantine they decided to strain the delivery department, apparently.

Cheap server from Chinese parts. Part 1, iron
Appearance of the parcel

The cunning Chinese packed everything in one package, although I ordered four different orders on aliexpress so as not to fall under the duties of two hundred euros.

Cheap server from Chinese parts. Part 1, iron
Box contents

The motherboard comes with a full sheet of instructions! You have to guess about the speaker's signals yourself. The site says that the orange RAM slots are the main ones, you need to put it in them. The instructions are a little less than completely useless. I connected the power button on it. By the way, there is only one inscription on the box - MOTHERBOARD. She did not deserve a separate photo, but she definitely deserved a mention.

We take out the case, vacuum it. In fact, it was not worth getting it, it turned out to be nothing but torment. But it looks aesthetically pleasing. Looked…

Cheap server from Chinese parts. Part 1, iron
Body, upside down view

There are tale skids in the case. (And I'm planning on 3.5" drives. You'll have to remove the board)

Cheap server from Chinese parts. Part 1, iron
Space for discs

There are also quick-change fans on the front panel. Probably noisy.

Cheap server from Chinese parts. Part 1, iron
They are controlled by something more complex than just the motherboard directly.

Remove the top cover and see what's inside. If you unscrew a couple of screws, you can move the disk space and make room for manipulation. And the E-ATX format motherboard, it takes up almost all the space in the server.

Cheap server from Chinese parts. Part 1, iron
native power supply

I just couldn’t pull out the power supply, I had to unscrew all the screws on the back and almost disassemble the entire case. It turned out that it was held on by two screws and a piece of adhesive tape. It was mean, but now I myself can use such tactics.

Cheap server from Chinese parts. Part 1, iron
Here it is on the left, the ill-fated black stripe!

I'm already tired of choosing the most successful photos, filtering out those that are not needed for the story, cropping the pictures and uploading them to the site. Meanwhile, the next day comes, and I only have Chinese parts on my desk. You have to rush to place an order and rush to the store at the other end of Moscow.

Cheap server from Chinese parts. Part 1, iron
At the entrance to the store

The trading floor is closed, only the issuance of orders is open. It was good that the weather was sunny, I don’t know how it would have been in the rain. Orders must be called through a video intercom, it is a pity that this is not explained enough. It would be nice to print at least some kind of instruction other than "keep a distance of 2 meters." Waiting no longer than ten minutes is great. We're going back.

Cheap server from Chinese parts. Part 1, iron
Two coolers, one power supply and a tiny SSD

Since coolers suitable for the dimensions of the case were expensive and noisy, I had to choose an oversized option. This saved me from the pain of choosing a power supply: a quiet ATX format, but you have to remove the cover with it, or a one-unit, but noisy and two thousand rubles more expensive. Let's start shopping. The original idea of ​​the two coolers was to take air from the center, but the shifting capacity for disks made adjustments and the fans had to be rearranged for sequential blowing. It will be interesting to observe the temperature on one crystal a couple of degrees higher than on the other.

Cheap server from Chinese parts. Part 1, iron
Still no thermal paste

We wipe the base of the cooler and the processor with alcohol. Drinking. But he has been a technical one for a couple of years, it is better not to use it orally. Evenly apply thermal paste with something flat. Actually, I don't know much about the process of applying thermal paste, but the results of my work have always brought positive results. Apparently, it’s hard to screw up here, even if Moment glue is able to work for years, judging by the bikes. Usually I use a piece of an unnecessary plastic card, but I didn’t have it on hand. In its place was a newfangled legless fourth stump. Don't worry, after the procedure, I wiped it with alcohol and put it back on the shelf.

Cheap server from Chinese parts. Part 1, iron
Something strange and disturbing
The application is not ideal, and I did not press the cooler completely: you can see the displacement of the “bald” place relative to the center.

Cheap server from Chinese parts. Part 1, iron
Sighting

We add an additional layer of thermal interface in places where it is clearly not enough and a little in other places.

Cheap server from Chinese parts. Part 1, iron
Yep, satisfactory

Let's install the motherboard. The server obviously had something of a different format, and those ... uh ... fittings into which the screws for fixing the motherboard are screwed in were not located in the places for the E-ATX board. Unfortunately, in a piece of metal into which the fittings are screwed, there were not enough three holes opposite those that were in the motherboard. Fortunately, the fittings themselves were also missing three pieces.

Because of this, the motherboard sags in the places where the 24-pin connector and PCI-E connectors are attached. On the one hand, it is textolite. On the other hand, this is a Chinese textolite, you never know what to expect from it. But it is necessary to press gently in any case, even if it is a textolite certified by military acceptance. Not even, in this case, you need to press even more carefully - it is also made in China, but piece certification and acceptance increased the cost of the device by a couple of dozen times.

Cheap server from Chinese parts. Part 1, iron
A bunch of holes and everything is not there

Remember the power supply on tape? History is cyclical, here is the repetition:

Cheap server from Chinese parts. Part 1, iron
And yes I don't like it

The assembly is completed, we transfer the computer to the brother's room, take away the keyboard and monitor from the live server and try to turn it on. From the first time it is not possible to get out even in the BIOS. Since xeons usually do not have a built-in graphic coprocessor, and you need to display the BIOS on the screen, we put some kind of simple video card. Gods, how she makes noise!

From the second time it is also impossible to enter the BIOS. By sorting through the culprits, we come to a solution: by swapping the RAM strips and removing the SSD, you can reach the BIOS. We insert the SSD into place and turn on the computer again - the BIOS is loaded, the disk is detected. Apparently, something was reset when the CR2032 battery was missing.

By the way, do you see that the block for hard drives protrudes forward more than it should? He hits the cooler. This is not an ideal case for classic form factor computers, what can you do.

Cheap server from Chinese parts. Part 1, iron
Place for initial setup

A small digression about noise: with a video card, the noise level was at the level of 27-30 decibels, and after installing the operating system, the server noise level dropped to somewhere up to 8-14 decibels. It was difficult to measure it more accurately, since the background noise level was also somewhere in this range: the construction of the subway on the street, rolling balls from the neighbors from above, the stomping of a cat, and so on. The server will be in an Ikea cabinet without doors, so this noise level is fine.  

bonus

Technically, this chapter does not refer to the selection and assembly of hardware, but installing the operating system does not pull on an independent chapter. Many resources have already described the installation of anything on different devices, and what happens here is a completely ordinary phenomenon. I absolutely don’t want to produce an extra tutorial, moreover, possibly incorrect.

Nevertheless, I will describe the rake that I stepped on during the OS installation process.

I didn’t install Windows Server due to the lack of a license, and I’m used to interacting more with Linux servers. The old server is running Ubuntu, but a couple of little-used VPSs are running CentOS and at work running RHEL. Therefore, we will get acquainted closer with CentOS 8.

Let's go to any mirror, download the .torrent file - and in a couple of tens of minutes we download a seven-gigabyte image.

We insert the USB flash drive, find it and copy the image to it.

frog@server:~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb      8:16   1  14,6G  0 disk
└─sdb4   8:20   1  14,6G  0 part /media/localadmin/ANACONDA
sda      8:0    0 223,6G  0 disk
├─sda2   8:2    0    24G  0 part [SWAP]
├─sda3   8:3    0   128G  0 part /
└─sda1   8:1    0   243M  0 part /boot/efi
frog@server:~$ dd if=/home/frog/CentOS-8.1.1911-x86_64-dvd1.iso of=/dev/sdb
dd: failed to open '/dev/sdb': Permission denied
frog@server:~$ sudo !!
sudo dd if=/home/frog/CentOS-8.1.1911-x86_64-dvd1.iso of=/dev/sdb

And we go to drink tea. An hour later, we are confident that everything has been copied for a long time - but the invitation to enter did not appear. So it's still being copied. Okay, new terminal, ask dd, how much is left.

  PID TTY          TIME CMD
 1075 tty5     00:00:00 bash
 1105 tty5     00:00:00 sudo
 1106 tty5     00:00:00 su
 1112 tty5     00:00:00 bash
 1825 pts/18   00:00:00 sudo
 1826 pts/18   00:01:08 dd
 2846 pts/0    1-23:03:42 java
 5956 pts/19   00:00:00 bash
 6070 pts/19   00:42:15 java
 6652 pts/20   00:00:00 ps
 7477 tty4     00:00:00 bash
 7494 tty4     00:00:00 sudo
 7495 tty4     00:00:00 su
 7497 tty4     00:00:00 bash
frog@server:~$ kill -USR1 1826
-bash: kill: (1826) - Operation not permitted
frog@server:~$ sudo !!
sudo kill -USR1 1826

Response in the old terminal:

9025993+0 records in
9025993+0 records out
4621308416 bytes (4,6 GB, 4,3 GiB) copied, 13428,4 s, 344 kB/s

And a couple of minutes later:

14755840+0 records in
14755840+0 records out
7554990080 bytes (7,6 GB, 7,0 GiB) copied, 14971,5 s, 505 kB/s

What was it? Did it copy it byte by byte? Poor flash drive resource. Or check the correctness of the record. In any case, it was necessary man dd and use large copy blocks, and anything else that came in handy once when copying a 64 gig HDD at 5400 rpm. But even that copied at a faster rate than a third of USB 1.0.

And then the standard selection of a flash drive as Boot Device, Next, Next, Next, Finish. No manipulations with disk layout, Ethernet settings. The most common OS installation in 2020.

Conclusion

This is the first part of the story about setting up a new server. I would have released it in its entirety at once, but I have two more unfinished articles in my drafts, which, it seems to me, are more interesting than “yet another server build”, and the second part about setting up the software threatens to end soon.

The total cost was 57973 rubles. Here is the breakdown in more detail, however, links to aliexpress already show slightly different products.

RAM 32GB DDR3-1866 - 4 things
19078 rubles

Processor Xeon E5-2690 - 2 things
10300 rubles

Motherboard Jingsha X79 Dual Socket - 1 things
9422 ruble

Power supply unit ExeGate ServerPRO RM-800ADS - 1 things
4852 ruble

Cooler ID Cooling ID-CPU-SE-224-XT - 2 things
3722 ruble

SSD Crucial P1 CT1000P1SSD8
10599 rubles

Case Noname
Free options

The approximate cost of ownership is 3.89 rubles / kWh * 0.8 kW * 24 hours * 31 days = 2315 rubles / month. But this is if he threshes to the fullest without ceasing for a month, which I very much doubt due to the lack of such tasks and the survivability of iron. For comparison, the cost of renting a similar server of quality parts is about 25k rubles / month.

I think this is a pretty good server for the money.

Source: habr.com

Add a comment