Linux server reboot

We reboot our linux servers daily. Is it needed ?

Generally, no. Servers can operate weeks to months at a go, potentially years if it wasn't for kernel upgrades.

Often people do so because they see the value of "free" memory creeping very low and "cached" climbing very high, then reboot to forestall what they perceive as impending disaster. Many try putting strange settings into /proc/ to "flush the cache", as well. This isn't necessary, low free/high cache is normal operation, just count the value of "cached" in your estimation of free memory and usually everything is fine after all.

My experience is that virtual servers need to be rebooted more often than stand alone servers. Here is an example from one stand alone linux server:

Over two years since the last reboot .....

The only reason I can think of to reboot a linux server that often would be lots of crashed connections (those showing state FIN_WAIT or similar with netstat -an) preventing further connections to the server - and there may be a better way to fix that without reboot.
Were you told the reasons why your company reboots that often? What kind of application are those servers hosting?

We run a stand alone java application with Database.

Description

  1. Stand alone web application run in apache tomcat 6..
  2. A database connection in postgresql 8.3..

System configuration
CentOS 5
~ 4 to 8 GB of Ram , (Differ in each servers)
core 2 duo processor
Java 1.6 [Oracle]

Users per server
~ 100 - 200 sessions.

But daily needs to reboot.. :wall:

It doesn't likely need to reboot. What ISSUE are you experiencing? Rather than telling us you reboot, tell us the problem, not some workaround you found.

mark,

The application runs is not a small one. it's a big application. And the server becomes very very slow as it used from morning to evening..

Thus in some servers tomcat / postgre or the Entire system itself reboots.

Do those servers start to swap a lot in the evening? Are all servers hosting both webserver and database or are there dedicated boxes that run only one component? Did you investigate why tomcat / postgres / system reboot themself?
The most common reason I've seen systems reboot themself without a hardware issue was them running out of paging space.

Have you looked at the contents of /var/log/messages when this occurs?

If this is happening, perhaps splitting the app from the DB could help. Also, what about setting things like the java heap size to be more normalized, or perhaps using a different garbage collection algorithm?

What is the output of dmesg?

Your server might be horribly undersized.

i once worked at a shop which had a server that got hung up everytime this 1 particular java application ran ... the developers kept asking the sa in charge of this server to tweak the server some more but it kept getting hung anyway ... it was only when the developers revised the application to better utilize and then free memory did the server stop hanging as soon as the application ran ...

anyways ...

somebody should monitor this server for cpu and memory utilization throughout the day ... the company might not want to redo the application but giving it more ram or moving it to a newer box may help it perform better ...

or ...

just stick to daily reboots .... :wall:

Sounds like you might have problem with Big app. here are the ways to check problems.
Code checks:

  1. Check if app open lots of temp files or creates cache which is required to be cleared.
  2. If it is a web based app. check if connection to DB is closed after usage. If database is slow or causing slowness to a page.
  3. if you have any file called via n/w may be network is slow connecting the server at certain time as n/w might be busy.
  4. Check if static pages also load slow if web based app.
  5. Check your app logs for more errors
  6. Check if you have any fork bomb etc

H/W and S/W check
Install something like MRTG or cacti etc to monitor:

  1. Check if your DB is slowing down after certain queries
  2. Check if your app server tomcat / weblogic is properly configured.
  3. Check if /tmp and /var /usr/local/apachec etc etc where log files are written is having enough space.
  4. Check lsof to see files open.

I usually try to blame this way :slight_smile:

  1. Hardware (check bad mem or disk or any n/w) etc
  2. Developers.
  3. DBA bad indexing/configurations
  4. kiddy perl/shell scripts which cause problems.
  5. unnecessary services.

if nothing else the SYS Admin, Data center...

last but not least .... my FATE :wall: