Web Servers
Moderator: General Moderators
- Johnm
- Forum Contributor
- Posts: 344
- Joined: Mon May 13, 2002 12:05 pm
- Location: Michigan, USA
- Contact:
Web Servers
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
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
- Johnm
- Forum Contributor
- Posts: 344
- Joined: Mon May 13, 2002 12:05 pm
- Location: Michigan, USA
- Contact:
kcomer
nielsene
Takuma
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.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.
nielsene
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.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.
Takuma
Then why would you reply to this post? (Just out of curiosity)I'm hosted on someone else's computer so i don't really know
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.
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.
- Johnm
- Forum Contributor
- Posts: 344
- Joined: Mon May 13, 2002 12:05 pm
- Location: Michigan, USA
- Contact:
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...
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.
If that tells you anything.
Direwolf
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');
?>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 300Direwolf
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.
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.
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
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.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
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