I want to talk about how I was puzzled by the search for inexpensive hosting with Java support.
In the beginning I decided that it would be nice to buy a piece of iron, put it at home, give it a good channel and enjoy life. But then I decided to calculate the approximate monthly cost of such a decision, and it turned out that a 200W unit will eat ~ 3-4kW per month (100-150W will eat iron), and it will cost 350-400 rubles (I have a gas stove).
Let's add here a good channel + SP, and we have about 750 rubles (and this is without a backup!).
Total about 1000 rubles per month and another about 8000 rubles will go one-time to purchase components that can pass for file-dumping + UPS (> = 2000 p) and we see that independently hosting “a couple of sites and mail” becomes a stressful affair.
Someone will offer to recoup this by placing projects - but who will agree to pay for hosting, which God hangs on 30 megabits, and has a chance to be offline due to the fact that someone cut the wire in the dashboard, or from the provider "Dns burned again."
I started the search with Mother Russia and found
hosting from
brim.ru (through Habropoisk), talked to the support, and the proposed conditions, to put it mildly, are not
enough standard.
6. Memory (basic 256MB) is allocated to
account (kernel, services, applications).
Expansion is possible - the cost of the service:
100 rubles / month for 64MB
7. Account exists on RAID 1 array.
Backup of data and / or image
account is not made.the price is 500 rubles per month, they don’t back up + there is a ratio for traffic, that is, their own backups will spoil their lives (just downloading them) and will not turn around in 256 megabytes of Java, but don’t push (although I’m sure that write how to squeeze the most out of this amount of memory, but for mail + jsp + php + ftp + DB this is not serious).
Look wider
Having bumped into a meager market with more exorbitant prices, I was intrigued by a lot of offers from $ 1.5 a month or more. I
went to
mochahost.com (it’s hard not to notice, because Google is promoting it with any kind of
java hosting request), which for $ 7 was ready to offer me the golden mountains, sftp and tomcat, unlimited traffic and the same place.
What can I say about them ... there is only a delay when connecting to the server, the terrible lags of everything dynamic, including cPanel and terrible technical support. Java on the tariff with Java, they include only on request in the support, account activation takes 6+ hours. Maybe someone will be lucky with them more ... if you live next to the DC ... or something like that.
Their only purpose is to host mail. At the minimum rate, you can serve 1 domain and on it email accounts and all for "dollar-ninety-five."
')
I believed in them, or rather, in those $ 20 that they left there) sftp was not given (lent SSL), JSP processing took forever (second reaction, and not for the first time, but after tomkat chewed it, JSP uses net.Socket).
They are closer than we thought ..
And I went back to the dark search path hoster. Yandex brought me to various Russian resources (Habru including), Google to foreign, but I also went to VDS hosting, and the first name I saw was
Hetzner . After reading articles about him, having read them to Wiki, having seen how users of the local portal without any problems put FreeBSD on there or any image from installimage, I was not really interested in them.
For starters, I ordered a VQ12 plan, 1 GB of memory, 40 GB of space, a Linux of my choice (and Windows too) and 2 TB of traffic on 100 megabytes.
Taking debian6 @ 32, which is already out of the box, I felt what a gap between shared hosting and (virtual machine, but still ..) VDS felt. I put nginx + tomcat + MySQL there and began to enjoy life and for only 12.9 euro-19% = 10.84 euros (since I am Russian, I do not pay VAT).
Next were Dovecot + Postfix + sasl, certificates, user base in MySQL, letters to fly, logs are being written, ports are closed, ssh is gone from 22 ... Everything was great. And the tariff plan ~ 430 rubles per month is remarkable, but there is not enough processor power.
The backup system is made by me so that at the beginning the content is packaged (part with compression
7z a
, part without
7z a -mx0
) in 7z, and then it is encrypted with a public key via gpg, key size 4096, dropped into a folder that is tied to a subdomain in nginx.
Next, I run
wget -r --no-check-certificate ....
at home
wget -r --no-check-certificate ....
and cling to ***. 7z.gpg, well, at the end I decrypt it.
In the moments of encryption, I felt very sharply how the “processor” rolls over 100% and at the same time the mail to the server starts to go very tight, jsp is slow, and roundcube beats the head (it was possible to limit the resources for gpg, but in addition to the processor I needed
need mooore free space , more on this below).
In addition, at that moment I decided clearly that I would be posting, and the space in 40 GB was not enough (or rather, in a month or two such a moment could arise, ~ 30 GB are mail accounts).
Just like the "vzloslyh"
My choice fell on a dedicated server. Why “server” and not server? Because they are assembled on ordinary iron, which can be bought at any store and is quite affordable. It was tempting to switch to the EQ4 tariff, but for my needs, 8GB of memory and 1.5TB of space were somehow above the roof. Especially a quarter cheaper tariffs that suited me.
And so I bought the X3
(X-three) . From small pluses: I found 5600+ processor instead of 4200+ and 2 screws of 400GB each instead of three hundred. At the moment, system performance is enough for solving problems, and there is a place for storing the data I need (and greedy mail, including). Hard work in software mode RAID-1, so that an additional mirror was added to my backups. He put debian6 @ 64 at the beginning of it, but the processes began to eat 1.5-2 times more memory, but there was a gingerbread too - according to test
7z b
it gives out 300 parrots more. As a result, debian6 @ 32 was installed, the disk was marked for the needs:
PART swap swap 4G
PART /boot ext4 512M
PART /var ext4 32G
PART / ext4 16G
PART /usr ext4 all
PART swap swap 4G
PART /boot ext4 512M
PART /var ext4 32G
PART / ext4 16G
PART /usr ext4 all
, as an
administrator for the iron server, I am not a wizard yet, but I hope the markup will not tarnish the general information content of the post. var limited, because I write logs by default, 16 gigs for the root “just in case”, swap = 2 memory (obmusolivanie this topic was on
linux.org.ru ), and all content is stored in / usr
At the moment, the flight of the server is normal and I'm happy as an elephant.
In conclusion, I want to inform you that I strongly disagree with those
authors who say (myth # 5) that hosting on the hardware store is a hoax and a kindergarten. From myself I want to note that many tasks are successfully solved on a simple processor with 2-4MB of cache and 2-4 adra, for the power of xeon, for ECC, and for smart SAS, if their absence is
not critical for the project -
do not overpay.
The VQ12 server was ready in half an hour, the X3 server was ready in less than an hour.
Performance testing
Below, I attach a small test of the performance of these two tariff plans (alas, as
Google didn’t google, no one laid out tests on this German).
Vq12
--> hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 16732 MB in 2.00 seconds = 8375.75 MB/sec
Timing buffered disk reads: 482 MB in 3.01 seconds = 160.37 MB/sec
===========
--> time echo '2 1000000 ^ p'|dc
real 0m5.592s
user 0m5.056s
sys 0m0.024s
===========
--> wget mirror.yandex.ru/debian-cd/6.0.0-live/i386/iso-hybrid/debian-live-6.0.0-i386-standard.iso
2011-03-21 22:06:50 (5.36 MB/s) - Ђњdebian-live-6.0.0-i386-standard.isoЂќ saved [232783872/232783872]
===========
--> time taskset 0xFFFFFFFF 7z a test.7z debian-live-6.0.0-i386-standard.iso
7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,1 CPU)
Scanning
Creating archive test.7z
Compressing debian-live-6.0.0-i386-standard.iso
Everything is Ok
real 2m54.989s
user 2m44.754s
sys 0m8.989s
===========
--> taskset 0xFFFFFFFF 7z b
7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,1 CPU)
RAM size: 1010 MB, # CPU hardware threads: 1
RAM usage: 419 MB, # Benchmark threads: 1
Dict Compressing | Decompressing
Speed Usage R/U Rating | Speed Usage R/U Rating
KB/s % MIPS MIPS | KB/s % MIPS MIPS
22: 1607 100 1568 1563 | 19696 100 1778 1778
23: 1897 100 1933 1932 | 19965 100 1833 1828
24: 1788 100 1924 1922 | 20066 100 1865 1862
25: 1252 99 1439 1430 | 19535 100 1830 1837
----------------------------------------------------------------
Avr: 100 1716 1712 100 1827 1826
Tot: 100 1771 1769
===========
--> grep -m 4 -e "model name" -e "MHz" -e "cache size" -e "bogomips" /proc/cpuinfo
model name : QEMU Virtual CPU version 0.13.0
cpu MHz : 3073.982
cache size : 4096 KB
bogomips : 6147.96
and X3 fare
--> hdparm -tT /dev/md4
/dev/md4:
Timing cached reads: 2148 MB in 2.00 seconds = 1074.50 MB/sec
Timing buffered disk reads: 220 MB in 3.02 seconds = 72.82 MB/sec
===========
--> time taskset 0xFFFFFFFF echo '2 1000000 ^ p'|dc
real 0m7.430s
user 0m6.660s
sys 0m0.036s
===========
--> wget mirror.yandex.ru/debian-cd/6.0.0-live/i386/iso-hybrid/debian-live-6.0.0-i386-standard.iso
2011-03-21 21:57:47 (6.45 MB/s) - Ђњdebian-live-6.0.0-i386-standard.isoЂќ saved [232783872/232783872]
===========
--> time taskset 0xFFFFFFFF 7z a test.7z debian-live-6.0.0-i386-standard.iso
7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)
Scanning
Creating archive test.7z
Compressing debian-live-6.0.0-i386-standard.iso
Everything is Ok
real 1m17.403s
user 2m29.109s
sys 0m1.452s
===========
--> taskset 0xFFFFFFFF 7z b
7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)
RAM size: 1993 MB, # CPU hardware threads: 2
RAM usage: 425 MB, # Benchmark threads: 2
Dict Compressing | Decompressing
Speed Usage R/U Rating | Speed Usage R/U Rating
KB/s % MIPS MIPS | KB/s % MIPS MIPS
22: 3037 170 1736 2955 | 42922 200 1937 3875
23: 3077 176 1778 3135 | 42357 200 1941 3878
24: 3061 182 1808 3291 | 41719 200 1939 3871
25: 3023 178 1941 3452 | 41133 200 1936 3868
----------------------------------------------------------------
Avr: 177 1816 3208 200 1938 3873
Tot: 188 1877 3541
===========
--> grep -m 4 -e "model name" -e "MHz" -e "cache size" -e "bogomips" /proc/cpuinfo
model name : AMD Athlon(tm) 64 X2 Dual Core Processor 5600+
cpu MHz : 2800.000
cache size : 1024 KB
bogomips : 5599.72
Addition:
taskset 0xFFFFFFFF cmd - this means that all processor cores will be involved in processing cmd.
time - to find out the time spent.
1 time the speed on VDS was 10MB per second when downloading an image from Yandex, unfortunately there is no proof.
Both servers are located geographically in the same place (the question was asked, since I was wondering if I didn’t lose ping ~ 60-65 and a good channel with Russia when changing the tariff and server):
your VQ-server is in DC12, your X3 is in DC13.
It is the same location .