View Full Version : Tweaking FreeBSD, Apache, Httpd.conf
ClusterMania 12-13-2001, 11:01 PM I order 2 servers with
Dual 1.13 Ghz
2 Gig ram
What settings should I tweak FreeBSD, Apache and my Httpd.conf to so the server can handle the max amount of clients and processes as possible. What settings do you guys recommend? I want it to take as many connections as possible without crashing or slowing down.
Planet Z 12-13-2001, 11:28 PM The first thing you'll probably need to do is recompile Apache with a higher maxclients limit. The default is only 256. You may also want to consider recompiling the BSD kernel to tweak it for performance plus possibly increase the maxusers in there.
clocker1996 12-13-2001, 11:35 PM Hm
How does one recompile apache with more then 256?
I mean, is it in ./configure --help or ?
ClusterMania 12-14-2001, 01:53 AM Originally posted by Planet Z
The first thing you'll probably need to do is recompile Apache with a higher maxclients limit. The default is only 256. You may also want to consider recompiling the BSD kernel to tweak it for performance plus possibly increase the maxusers in there.
How high will Apache and FreeBSD go? I want absolute max for my servers.
bobcares 12-14-2001, 03:58 AM Hi!
I would suggest not to go the ultimate max. for only httpd. The sole reason is that your servers would be used for ftp, mail, dns etc...
Mail is a major resource hog. So you must be careful while overtweaking... :)
Have a great day :)
regards
amar
clocker1996 12-14-2001, 08:24 AM well i still would like to know how
bitserve 12-14-2001, 03:34 PM Originally posted by clocker1996
Hm
How does one recompile apache with more then 256?
I mean, is it in ./configure --help or ?
Typically you have to edit one of the sourc files. Typically when apache compiles for UNIX, it sets the hard limit to 256, but for windows, it compiles it for like 1024. So you'll want to find this logic and change it. I totally forget what file it's in. It might be httpd.c
Clustermania,
You should search the web, because there are a lot of tweaking how-to's out there. But some of the things you might want to do is turn off modification times for your filesystem and disable reverse DNS lookups in apache. You'll also probably want to increase the number of files you can have open at one time and put your swap on a seperate drive. Although with that much memory, hopefully you won't be using much swap.
cperciva 12-14-2001, 03:49 PM Originally posted by bitserve
Typically you have to edit one of the sourc files. Typically when apache compiles for UNIX, it sets the hard limit to 256, but for windows, it compiles it for like 1024. So you'll want to find this logic and change it. I totally forget what file it's in. It might be httpd.c
In the FreeBSD port the default is 512; if you want to increase that to 2048 (which is probably a reasonable value for this system), just
cd /usr/ports/www/apache13 && perl -pie 's/512/2048/' Makefile && make all install
ClusterMania 12-14-2001, 04:31 PM Originally posted by cperciva
In the FreeBSD port the default is 512; if you want to increase that to 2048 (which is probably a reasonable value for this system), just
cd /usr/ports/www/apache13 && perl -pie 's/512/2048/' Makefile && make all install
These servers will be for freehosting. No mail, I will disable that. 2048 is absolute max?
How slow do you want the thing to go, because your on the path to a bunch of problems with that many users. The server software has defaults for a reason..
ClusterMania 12-14-2001, 05:00 PM Originally posted by ebo
How slow do you want the thing to go, because your on the path to a bunch of problems with that many users. The server software has defaults for a reason..
I guess I need balance. I want it to respond quickly and take as many request as possible for the machine I have. How does shared memory work?
http://thingy.kcilink.com/modperlguide/performance/Preloading_Perl_Modules_at_Serve.html
Looks interesting
cperciva 12-14-2001, 05:44 PM Originally posted by ebo
The server software has defaults for a reason..
Yep. And a quick glance at the CVS tree shows that the default hard limit of 512 was set on Sat Jun 13 08:33:41 1998 UTC. Not many systems with 2GB RAM back then.
CM: If you're going to run mod_perl, don't expect more than 200 simultaneous connections -- mod_perl is a huge memory hog. If I were you I'd stick to standalone perl and php (running through suexec of course). The forking overhead really isn't all that much, and the improved caching dynamics from having smaller working sets would offset much of that anyway.
You might be able to go as high as 4096 server processes if you are careful about which modules you use and compile carefully, but you'd probably do better to stick with a hard limit of 2048 and leave space for caching.
ClusterMania 12-15-2001, 02:43 AM Originally posted by cperciva
Yep. And a quick glance at the CVS tree shows that the default hard limit of 512 was set on Sat Jun 13 08:33:41 1998 UTC. Not many systems with 2GB RAM back then.
CM: If you're going to run mod_perl, don't expect more than 200 simultaneous connections -- mod_perl is a huge memory hog. If I were you I'd stick to standalone perl and php (running through suexec of course). The forking overhead really isn't all that much, and the improved caching dynamics from having smaller working sets would offset much of that anyway.
You might be able to go as high as 4096 server processes if you are careful about which modules you use and compile carefully, but you'd probably do better to stick with a hard limit of 2048 and leave space for caching.
Do you think 2560 is a tad too much? I want as many clients to reach my server as possible without slow down. I heard httpd don't take much cpu so Dual 1.13 Ghz should take quite alot especially with freebsd. I don't want any broken images to be displayed or slowdowns because of max clients being reached.
muppie 12-16-2001, 11:39 AM read up some articles about tweaking the kernel
http://www.daemonnews.org/200108/benchmark.html
http://apollo.backplane.com/FreeBSD.old/tuning.html
Cheers
|