- Making your servers a bit more "green" with smart system adminstration, part 3: the right tool for the right job
- Making your servers a bit more "green" with smart system adminstration, part 2: tools
- Making your servers a bit more "green" with smart system adminstration, part 4: MySQL databases
- Fixing permissions in Subversion post-commit hooks
- IMAP IDLE
Making your servers a bit more "green" with smart system adminstration (part 1)
July 22, 2009,
One of the latest crazes is "Green IT". There are a lot of companies who are marketing their solutions, mostly hardware, which should help you consuming less power while doing business. But there are also a lot of things you can do yourself, which are not difficult at all.
Green IT is hot because it is about making things less hot. The amount of power that is consumed by IT is quite big. If you look at datacenters this is not surprising. In the last few years there has been a sharp increase in Watts per square meter: machines have become more powerful and consume more energy, but at the same time they are still the same size, or smaller. The datacenter where we have a few of our servers was a perfect example. A lot of racks were empty, yet there were big containers with engine-generators outside to generate enough power for all machines inside, as well as for cooling all those machines.
Here at Loco we firmly believe that the excessive power consumption can be slashed quite a bit. Tools and techniques which are hyped by the media are just not the only way to do this and the only way you should do this. No matter how much you virtualize or use green hardware: if your application is badly designed or badly configured you will waste resources unnecessarily. In this blog post we want to run through a few things we or our customers ran into.
Choose the right hardware
Before you start optimizing it is good to know that it actually has any effect. Your server should have support for power management, like Intel SpeedStep, or AMD Cool'n'Quiet, or some other form of power management where the CPU runs at a lower speed when it doesn't have anything to do. Older servers, such as many servers with a Pentium 4 CPU, don't have this capability but run at one speed all the time. If you are going to buy new hardware power management is definitely something to take into consideration.
Disable unnecessary services
Many Linux distributions install more services by default than you usually need. On CentOS 5.x you might get quite a few services installed that you don't need, for example kudzu (unless you keep adding hardware all the time in the datacenter which is unlikely), Avahi, bluetooth services, pcscd (unless console logins are protected with smartcards of course). Disabling these services will give you a slightly faster boottime, but it also means less processes that eat a tiny bit of memory, network and CPU cycles and in case of networked services: it also means there are less attack vectors to break into your system.
Optimize your running services
Programs are consuming the least power when they don't have to run. So if you can avoid them to run at all the better. Sometimes this is just as simple as adopting some policies.
We saw the load on our servers drop significantly after we enabled greylisting to fight spam. Because of greylisting the filters (spam, virus) had a lot less work to do because most spams never reached the filters. As a side effect our customers also got a lot less spam.
IP banning for SSH and FTP brute force attacks
Many times a day we see brute force password attacks on some services that we run, such as SSH and FTP (at least when we used to run it). Sometimes attackers try to break in for hours on an end. Since you already know in advance that they have no good intention and only let the SSH and FTP server spill cycles, you can simply block them. There are several IP block scripts available, such as ip2ban and authfail.
There are a lot more optimizations possible, which we will write about in future blogposts.
On our own servers we are constantly trying to make services more efficient, so we, and our customers, can do more with the hardware we already have and save energy. Of course, we can do that for you too. If you are interested, please contact us.