Thursday, November 1, 2007

Rebooting Linux

Rebooting Linux. These are two words that are seldom said in the same sentence. Its something that most Linux users just never think about; but recently, rebooting Linux was the topic of conversation between myself, and a coworker with a Windows background.

"Why are we using Linux as a server?", she asked. This is a very good question that is likely to evoke a myriad of different responses.

"I think that Linux is used because of it's modular nature. Updates, configuration changes, and other maintenance can be done to the server without needing to reboot it.", I stated. Restart or reboot the computer

"Well, when does it need to be rebooted?", asked my coworker. Wow! I never really thought about it like that before. When does it need to be rebooted? Of course, I knew from experience that Linux could run for months without requiring a restart ever since Professor James Caldwell of the University of Wyoming stated that his office computer reported over 100 days of uptime since the last reboot. But I never really thought about why Linux would require a reboot.

With Windows, it's fairly obvious. Rebooting a Windows box is done in all of the following situations, yet none of these situations require a Linux reboot:

1 - When updating or patching the operating system.
2 - When installing new software of any kind.
3 - When it locks up or slows down.
4 - As the first step in any troubleshooting procedure.
5 - As a secondary, tertiary, intermediary, or final step in any troubleshooting procedure.
6 - Automatically, when you're not looking.
7 - As a troubleshooting step.
8 - When an application conflicts with the system.
9 - As a troubleshooting step.
10 - As a trou...

Anyway, I've had the opportunity to install some software on the servers at work, and not once have I had to reboot the server. Not once has the server locked up, acted sluggish, or thrown the blue screen of death. I've heard our IT department speak of worms on Windows Servers, but laughter ensues when someone asks what kind of virus software is installed on the Linux servers.

The conversation between my coworker and I continued: "When do we need to reboot a server?", she asked.Restart or reboot computer

"That's a good question. I'm not sure. I don't think it matters. But you've made me curious... Let's see how long it's been since svrXX was rebooted...". So at the SSH terminal, I type 'uptime' at the prompt, "162 days!", I exclaim.

"It has to be rebooted in 162 days?", she asks. Having primarily a Windows background, the concept of not having to reboot is a bit perplexing to her.

"No, that is how long it has been since it was last rebooted!", I explain. I try running 'uptime' on another server, "Check out this one, 315 days! This server was last rebooted almost a year ago! Now, there's no uptime command for Windows --", probably because hours are easier to remember than months, "but if you could type uptime at the prompt it would probably tell you that it had been running for only a few days."

"Oh! Can I try uptime?", she asks.

Another coworker overhears our conversation, "Actually,", he begins, "there is indeed a command you can use to view statistics from the DOS prompt. Type 'net statistics server'."

Upon discovering this information, my curious coworker types the command in her DOS window. "My computer has been running for eight(8) hours!", she said. "I just turned it on this morning."

I looked at my screen. "Mine shows a whopping six(6) days!", and it definitely showed. The PC was running slow. Clicking on an icon resulted in a delayed reaction, kind of like in cartoons where the character gets his foot stepped on and it takes a few minutes for the signal to reach his brain. There were 46 Firefox tabs open, 2 VMWare images running, a few Notepad windows, collaboration software, a database manager, a couple folders, and several Putty windows along with a mess of other open programs.

Like an old muscle car, I was pushing this thing to it's limit and it was still driving forward. It was definitely being taxed, so no wonder I have problems with my computers, but I wonder if I would have the same problems with Ubuntu or SUSE installed on my workstation PC? With SUSE or Ubuntu, I could "rip the process out of the wall" using 'kill -9', as another co-worker would say; but with Windows, eventually you come to a point where you have to just kill the motor and restart.

But why risk any downtime if you don't need to?


P.S. In all fairness to Windows, I did take note of the fact that Ubuntu 6.0.6 did require a restart after some updates. I was unpleasantly surprised by this and am not quite sure what to make of it. Of course, I think Ubuntu was designed more for home desktop users rather than for use as a server. More research will be needed in order to determine if Ubuntu Server suffers from this same requirement.

5 comments:

Anonymous said...

I stand to be corrected, but the last time I checked, Red Hat-style machines could stand to be rebooted after "yum update" installs a new kernel. Otherwise the system keeps going with the old kernel (according to what 'uname' reports).

And once or twice I've had stupid (and physically inaccessible) hardware (a PCMCIA modem which shall remain nameless) that needed to be reset by being switched off, but that's not quite the same thing, eh?

There are a couple of troubleshooting rituals that Windows-heads need to unlearn after they've seen the light:
1) rebooting
2) re-installing everything
3) uninstalling and re-installing drivers
4) fighting back tears of frustration

When I first started using Linux (8 years ago), I found it a bit spooky: no interminable waiting for the hourglass to go away, no laborious cranking of the HDD at every double-click. Make no mistake, I often curse and wish that I could just "plug & play" the latest hardware, but then I remember viruses, worms, spyware, blue screens, and plug & play that doesn't work as intended, and I begin to emit a warm peaceful glow.

James Mortensen said...

I just installed Ubuntu 8.04 on my PC as a dual-boot with XP. My uptime records show that this instance has been running for 14 days, 18 hours, and 57 minutes. I installed this 17 days ago, so I know what you mean about stability.

The system has run out of memory once due to Firefox memory leaks, but it recovered quite gracefully when I killed the process.

As far as plug and play is concerned, dealing with hardware issues doesn't seem to be as frustrating as dealing with spyware, adware, viruses, and other Windows maladies. Perhaps it's because the lack of hardware support generally isn't the result of some malicious user trying to ruin your day.

Overall, so far I'm very impressed with Ubuntu 8.04. It's more stable than SUSE 10.1, which I tried to run as a dual-boot, but would only do so when I needed a UNIX shell. With Ubuntu, I find that I don't really miss Windows XP, which is something that I -- surprisingly enough -- find quite surprising.

Unknown said...

hey can i knw,,,y v r not advisable to restart Linux again and again..???

Zhou Meisen said...

You have really selected the suitable topic; this is one of my favorite blogs.
www.mediaonlines.com

Zhou Meisen said...

You have really selected the suitable topic; this is one of my favorite blogs.
www.mediaonlines.com

Google