# Apache conf file for very heavy load servers...



## stoynev (Feb 8, 2009)

Hi, I need an configuration file for Apache 2.2 (+php) for very heavy load servers (with alot traffic) *or* at least which are the most important settings that I will need to setup in the config file so the apache 2 server to handle the traffic.


Thanks.


----------



## Mel_Flynn (Feb 12, 2009)

very heavy and alot of traffic are abstracts that no one can answer.

You will need to provide at the very least:
- architecture (64-bit apache+php consumes a lot more memory per process)
- ammount of physical memory
- CPU speed, number of CPUs, number of cores per cpu
- FreeBSD version
- Expected traffic (not 'alot', but requests/second, breakdown static/dynamic content per hour at peak)

To paraphrase what you asked:
"What tires and engine do I need for my car to be able to drive to my mom who lives far far away?"


----------



## stoynev (Feb 13, 2009)

Mel_Flynn said:
			
		

> very heavy and alot of traffic are abstracts that no one can answer.
> 
> You will need to provide at the very least:
> - architecture (64-bit apache+php consumes a lot more memory per process)
> ...



amd64 architecture 
32GB physical Memory 
HP ProLiant DL160 G5 Server
2x IntelÂ® XeonÂ® Quad-core E5430 2.66GHz 
FreeBSD 7.1 
expected traffic - assume 2000 req. per sec. and more


----------



## vivek (Feb 13, 2009)

stoynev said:
			
		

> expected traffic - assume 2000 req. per sec. and more


Forget it, single apache server won't work here (I've some experience with 400 req/per second web-site and Apache died after sometime) .. You need to use nginix or lighttpd web server (used by wordpress.com, wikipedia, youtube.com and many high traffic website on the Internet). Also, if site is heavily loaded with  CGI requests, you need a cluster. It all depends upon your application. 

You also need to use FastCGI for python / perl / php along with php opcoder such as xcache. Do you run sql from the same box? If so spit up webserver and sql server. This will also improve performance and security. 

Since you have lods of ram, I suggest reverse proxy server such as Varnish HTTP accelerator infront of webserver. It can cache lots of dynamic stuff and makes site really fast. You also need to put something infront of MySQL like Memcached which is probably the most popular distributed caching system.

HTH


----------



## gilinko (Feb 13, 2009)

I would atm go with vivek's suggestion, but what is worrying me is the "and more" part. Although you have a server fit for the purpose I would seriously consider some type of load balancing with multiple servers and/or a cluster setup if the "and more" is about to happen. It may not be needed right now, but start planning for it... A server with this kind of traffic you will need to be well versed in all aspects of serving content using the http protocol.

One thing that most people doesn't consider is the impact of logs(access, error, fail, ssl etc) from the http server. A high impact server can decline quickly if you have full logging enabled. Error logging should be done only on you dev server only and access logging should be done using firewall or separate frontend server. As all software that need this kind of server power will have(or should have) internal error checking and logging capabilities.


----------



## stoynev (Feb 16, 2009)

Thank you for the suggestions.  They were very helpful.

Regards..


----------

