Maximum time for which a Linux PC can be UP? [closed]

Actually I had a linux system ( running Ubuntu 12.04.3 ) for days without reboot. I ran in to some errors like sleep getting hang and some network mounted file system not getting mount even able to ping it (verified via other PC, the network mount was working fine).

Wanted to check if Linux also requires to reboot the machine after some time frame to avoid these types of weired errors which are non repeatable.

What is the maximum time we can maintain the PC up? Are there some other problems that could occur if we have a system up for year or more without reboot?


Solution 1:

Working as a system administrator, I see Linux servers up for over 700-800 days without reboot, so there are no uptime limitations; the errors you got are not related to Linux (the kernel) itself.

A lot of services can be restarted and most errors can be solved on production systems.

Solution 2:

There is no technical need to restart your computer after a certain time period. I've had mine running for months (incl. kernel module updates) with some suspensions (to RAM and disk) in between.

There are occasions where

  • it's absolutely necessary to reboot, like kernel updates (but those aren't urgent in many situations, and in some cases you can replace a running kernel with a new one on a live system. See kexec and Ksplice)
  • it may be easier to restart the whole system instead of just a particular (set of) subsystem(s).

There may be some issues that “become worse” over time (e. g. hardware driver issues, leaky processes), but those are considered bugs and can often be fixed with a software upgrade or worked around by a reload/restart of that particular subsystem (also see above).

Solution 3:

I don't know whether this has an impact over system's stability, but the maximum uptime shown in Ubuntu with kernel 3.19-xx is 68,0962597349822 years on a 32-bit machine and 292471208677,8627 years on a 64-bit machine.

That's because the system's current uptime, which is returned by the sysinfo() syscall, is returned as a __kernel_long_t type, which is a declared as a long in a 32-bit kernel and as a long long in a 64-bit kernel;

A long on a 32-bit machine has a maximum value of 2147483647;

A long long on a 64-bit machine has a maximum value of 9223372036854775807;

Doing the math, 2147483647s = 68,0962597349822 years and 9223372036854775807s = 292471208677,8627 years.

Once this value increases exceeding its type's capability, an arithmetic overflow takes place and it's set to the smallest value allowed by its type (in both cases a negative number): this might be an issue for programs relying on it.

Solution 4:

While I'm certain that there are servers with a higher uptime, I present the following from one of mine as an example of what is possible:

# uptime
04:58:44 up 2186 days, 23:15,  1 user,  load average: 0.02, 0.02, 0.00

This server was installed shortly after the DC it's in went live and hasn't been turned off since. Thus far it has continued happily doing what it was originally intended for and when that purpose gets moved to a different server I'll put something on there just to monitor the uptime and it will probably stay up until I can't justify keeping it alive any longer.

Thus I think "There is no maximum" is quite definitely the correct answer.