Web Servers

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Web Servers

Post by Johnm »

Hi All,
Just a quick informational question here.
How often do you restart your webservers?
Is there an optimal length of time or should I never have to if things are running right?


Direwolf
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

I'm hosted on someone else's computer so i don't really know but I don't think you need to restart your web server unless you have updated som settings.
Coco
Forum Contributor
Posts: 339
Joined: Sat Sep 07, 2002 5:28 am
Location: Leeds, UK
Contact:

Post by Coco »

you will probably find that most really busy servers are backed up and/or perform housekeeping daily... often includes a restart
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

Hmmm that sounds really wrong to me.... backup daily, yes, restart the web server daily? that just sounds plan wrong. I know my apache has been up for several weeks, now since I last updated the directives.

And the machine itself has been up since I connected it to the network without restart.
Coco
Forum Contributor
Posts: 339
Joined: Sat Sep 07, 2002 5:28 am
Location: Leeds, UK
Contact:

Post by Coco »

*mental note... remember unix based machines arent as crap as M$*
kcomer
Forum Contributor
Posts: 108
Joined: Tue Aug 27, 2002 8:50 am

Post by kcomer »

Our web server has uptimes past 3 months, only time its taken down is for hardware upgrades or if we are moving it. You shouldn't ever have to restart the server if things are running ok. Maybe restart the apache server, but thats about it. That's my expirience atleast.

Keith
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post by Johnm »

kcomer
Our web server has uptimes past 3 months, only time its taken down is for hardware upgrades or if we are moving it. You shouldn't ever have to restart the server if things are running ok. Maybe restart the apache server, but thats about it. That's my expirience atleast.
Your reply is confusing to me, my web server IS an Apache server. Are you referring to the computer that the "Apache Server" is on when you say restarting it after relocation or upgrade? I assume so... thanks though.

nielsene
Hmmm that sounds really wrong to me.... backup daily, yes, restart the web server daily? that just sounds plan wrong. I know my apache has been up for several weeks, now since I last updated the directives.
That is what I was thinking should be the case. I am having problems with db connections being left open since I upgraded to PHP 4.2.2 and Apache 1.3.26 from PHP 4.0.6 and Apache 1.3.12. Restarting the web server closes all of the open unused open db connections. I have to adjust the cod obviously but that means literally hundreds of pages on the real server AND the test server for consistency. A lot of work to say the least. Thanks for the input.


Takuma
I'm hosted on someone else's computer so i don't really know
Then why would you reply to this post? (Just out of curiosity)
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

Well to me "(web) server" tends to refer to the computer itself and "apache" to the software process running on the server. There should be no reason to have to restart the physical computer often. There is a slight chance of having to restart the apache process, but that's unusual..

As to your database connections, are you using pconnect? It wasn't working right(at all) in early version. Now it seems to be behaving and yes it does leave some connections around, but they are supposed to be left around. They aren't orphaned so they will be used again.
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post by Johnm »

Interesting. I have always viewed a web server (and for that mater a server itself) as a logical description of a process (for lack of better wording) and leaving the computer itself in the physical realm. Although, I see people refer to servers in the physical sense quite often.

On to the db connections.
Yes, I use pconnect, here is my db include file...

Code: Select all

<?php

$dbid=ifx_pconnect("xxxx@ifmx_online","xxxx","xxxx");

$connect_try=0;
while( ($dbid<=0) && ($connect_try < 50) )
{
  $dbid=ifx_pconnect("xxxx@ifmx_online","xxxx","xxxx");
  $connect_try++;
}
if($dbid==FALSE)
  die('Database connection Failed');


?>
I reduce the number of connections to the db by about 80 (after a days worth of operation) by restarting the apache web server.
How many connections are left open?

Here is the relevant part of the httpd.conf.

Code: Select all

MinSpareServers 128
MaxSpareServers 128

StartServers 128

MaxClients 128

MaxRequestsPerChild 300
If that tells you anything.

Direwolf
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

The number of connections left open is dependent on values in your database configuration and in your php.ini for your database.

Typically, it will try to keep 1 connection, per user, per database per apache process. If all your web connections are to a single database, by a single "web user" you should expect about 128 persistent connections. Of course if your database doesn't allow that many you may get into trouble.

I suspect if I used MySQL I wouldn't bother with pconnect, I use postgres which is slower at connecting, so pconnect makes more sense for me and the extra overheading of keeping connections around is more worth it.
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Johnm -> cos it hardly has a down-time... :D
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

Coco wrote:*mental note... remember unix based machines arent as crap as M$*
:roll: win xp stays on for just as long as most linux systems do..

if they don't it's bad hardware or user error, so if you're computer crashes, it's your fault, not Microsoft's
Coco
Forum Contributor
Posts: 339
Joined: Sat Sep 07, 2002 5:28 am
Location: Leeds, UK
Contact:

Post by Coco »

yah they been saying that all along... prolly why its taken them so long to relase an OS that is actually somewhere near stable
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

It still have some problems, I'll buy it when the SE is released (or maybe not...)
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

win xp stays on for just as long as most linux systems do..

if they don't it's bad hardware or user error, so if you're computer crashes, it's your fault, not Microsoft's
XP is just as much junk as the rest of the Windows products! It is nowhere near ready for the enterprise level, inspite of all the dolllars spent trying to get to people to believe it is.

Really, if you computer crashes, it's your fault for trusting MS!

Just a couple of things that make it bunk!

1) A server should NOT be tied to a gui! That represents operational overhead that has nothing to do with serving whatever the system is supposed to be serving in the first place.

2) There are too many different parameters that can't be changed without a reboot of the system.

3) That marraige to the gui (since they insisted on it), should not be able to cause a system crash, but it still does at times. However, the two (the gui and the kernel) should never have been bound so tightly in the first place.

4) Notorious security issues.

5) Lack of a reliable scheduling daemon. Yes, I know one is there, but I've never seen them work well. Cron is your freind!

6) Terrible use of system resources. Especially memory. User beware! If you don't take measures to tell windows that it has an upper limit on the amount of memory it's allowed to cache, it'll keep taking and keep taking.... Give a fool a rope and he want's to be a Cowboy!

Same goes for disk resources. Windows is REAL good at fragmenting drives. This is totally a non-issue on Linux as they set up a seperate partition for the sole purpose of swapping data. A good way to deal with this on windows? Set you min and max swap size to the same number.

7) A huge API! Controlling a system really should be easier than it is with windows. One should be able to control every single aspect of a system with some simple scripting as opposed to diving into the quagmire of the windows API.

I could go on and on....

MS really needs to get smart. Apple did! Its' called OS X.

Cheers,
BDKR
Post Reply