i'd really like to know what the lifespan of a server is, or could be. Is there something like lifespan in the world of PCs at all? Lets assume it runs 24/7, how many hours/days/years/etc could it be used?
Do you mean before any part fails, at all? Or do you mean how long can a server be expected to last if you perform maintenance on the serve, including replacing faulty parts like hard drives and power supplies?
Assuming you mean the latter - after all components like a hard drive can fail any time from '2 days after you got them' to 10 years plus - then I'd say the lifespan of a server can be measured in two ways
You could consider its lifespan to be however long it remains able to do the tasks given to it, which might be some time if the task is something that never really changes, e.g. DNS server. This is common enough in businesses that don't give a lot of funding over to IT; I've always worked in "large business, big iron" environments, but this is a perfectly valid viewpoint in a small business, to some degree at least.
Or you could (and in my opinion, should) consider the lifespan to be for however long the hardware is supportable. In other words, once you can no longer obtain replacement parts for a server, it is essentially living on borrowed time. That doesn't mean you need to run out and buy a new server to replace an old one the very second you can no longer obtain parts to maintain it, but that at this point you have to balance the cost of replacing it against the cost/risk of not doing so and having the service it provides unavailable until you can purchase a new server and migrate the old server's apps and data over to the new one.
In addition to both/either of the above points, you might also consider the point at which an old server becomes inefficient to maintain - the cost of keeping it running becomes greater (maintenance, power, floorspace in some cases) than the cost of virtualising it and a bunch of other similar older servers on new hardware.
EDIT: I think it depends too on the task that server is doing - there's a big difference between a DNS server, say, and a database server running a major CRM backend that the business is paralysed without. Both in terms of risk to the business if it dies unexpectedly and in the efficiency gained by moving to newer hardware.
Of course you could migrate the CRM backend to new hardware and re-purpose the old hardware. We've done this a few times for non-vital test or dev environments, etc.
Most people have so far answered this with a view to the technical life span of a server. Which is pretty much what most small companies and private owners do. I work for a company where there are no cash flow problems, and our approach is quite different.
Our servers (and most other pieces of IT infrastructure) are all assets, i.e. they are capitalized and as such they get written off over a number of years. For most items, this happens over a period of 4 years. After that, these items have an asset value of 0. In other words, they are not assets any longer. And if they are not assets, they become liabilities.
Therefore we swap them out for new ones, and the old ones get donated to charities or other worthy projects (e.g. some of them go to the Debian project, if they are interested). From a financial viewpoint, purchasing an asset simply swaps money for a different kind of asset. From an IT perspective I can rely on the fact that all my kit is covered by warranties, that spares are available and downtime is minimized.
At the moment our oldest server is 6 years old, and the replacement for it is already on our configuration bench.
Regardless of the average lifespan of a server, maintenance pays off in the end. If a server doesn't go belly up within the first 90 days, then chances are it should outlive the lifespan of the technology housed inside. Servers at 5 years are considered venerable in relation to the technology used to build them.
As @radius says, a warranty actually predicts the life expectancy of the machine it is covering.
Until your warranty/service cover gets more expensive... for corporates
Many shops have 3rd party or vendor service agreements, based on server age and CPUs etc. After 3 or 4 years (been some time since I last looked at this) the cost per server jumps massively. So it's replaced, whether it needs it or not.
I have some servers at the office that are 10+ years old and still running fine. Some even have the original hdd's.
then I have some brand new servers that already have lost a few hdd's.
Temperature and good power is critical for the life of the server.
Of course it comes a point where you need to look at the performance/cost factor and determine if it is worth replacing/virtualizing (most of the time it is)
I have been replacing all those old servers with a few new servers and ESXi. and just the power savings alone is paying for the new servers.
I am still running a PII server with a pair of 9.1GB drives, at this point I don't want to retire it just because its almost a relic! It has been going 24/7 and has moved 3 different times.
Physically, I've seen servers go 10+ years. I don't count hard drives here, they're just expendable items and they WILL break from time to time. There are also systems that blow up sooner... and when you loose a motherboard or stuff like that on an old machine you throw the whole thing away.
As far as performance goes, it really depends on what you are doing and the system type. If given enough ram and the right workload, even <1GHz CPUs can still do a good job today: in datacenters there are still many many servers connected to the internet at 100mbit or less, and you can't possibly push out more than that: often the performance level of some years ago will be more than enough (or you probably isn't doing your sysadmin work very well).
If we talk about business decisions, I consider my servers lifespan to last exactly up to the last day of vendor support. When my contract with the hardware vendor expires, that system will no longer be doing a mission critical work, and I'll move it to something not critical where I can turn it off and/or replace it every day without big problems.
There are three approaches to server life.
One is the Mil Spec originated MTBF lifespan, which is a statistical thing derived from the expected life of the components, spares inventory, the operating and storage conditions, dust, incoming power quality, etc. Based on those considerations we'd expect devices with moving parts to fail first - hard drives, tape drives and fans. All of these can easily be replaced and spares in the commercial world are plentiful. Connector problems also fall in this category - the "laying on of hands" approach to troubleshooting can magically fix gear by abrasively lowering contact resistance.
The second is software. Is the server capable of being upgraded to a new OS or application?
And the third is the capacity/speed/efficiency of the server. Is it running out of room? Is it too slow for current or anticipated needs? Is it cost effective from a power consumption or thermal loading perspective? Is it possible to replace it with a new technology that consumes far less power but outperforms the existing server and will have an extended service life? (this is often my primary motivation to upgrade).
A 6 year old server with an 6 drive RAID5 array and a DLT tape drive may well be ready to have all the hard drives replaced and the tape drive rebuilt. The cost may be surprisingly low: 6 - 80 gig SATA drives with 200 gig total capacity can now be replaced by either a mirror of 2 - 750 gig high performance 2.5" drives or 3 - 750 gig drives in a RAID5. Either will give both speed and capacity improvements as well as lower power consumption. The tape drive could be rebuilt for less than half the cost of a new drive if you can afford the downtime. (I've worked for people who always have a spare on the shelf and routinely rebuild drives every 3 years).
All of this ignores the possibility of catastrophic events - fires, floods, lightning strikes, etc. that can only be addressed by off site storage, mirrored facilities and other risk management strategies.
It depends on whose point of view and what the pressures are on the box.
The financial lifespan is usually 3 years. The reliability lifespan depends on the quality of what you're buying.
When y2k was approaching I had clients who were decommisioning boxes which had been running since the 70's - Mono-function building maint systems which were still working. The only reason to upgrade was that they weren't compliant.
I can guarantee that there are plenty of old nt4 boxes still running out there. If the box is maintained and disks and power supplies are replaced when they fail then the lifespan would usually be whenever it became too expensive to continue maintaining it, if the price was right they may continue on forever. This may happen with virtual machines.