I studied few things by my experience that is required for making project quality better. These are following:
- Dedicated server: To make use of CPU 100% for that project it must have a fully dedicated sever.
- High end server (Hardware must be equivalent to server level) Minimum of 2GB RAM, 3GHz Processor
- SCSI Hard Drive (Faster than normal drive) - It is required if same server having database
- APACHE CONFIGURATION: (Change httpd.conf - apache configuration file)
- KeepAliveTimeout should be very low (this is the no of seconds to wait for next request for the same client) By keeping it very low it will remove connections with the client who has just send one request and next request from the same client will come after a long time so processor will not maintain a connection for a incosistent user. (for dynamic sites it must be low up to 5 second).
- No of processes apache can handle set to MaxClients (How many sub processes can a client generate) - It must be low also.
- StartServers must be low (If MaxClients is more than StartServers must be more). StartServer is the initial number of server processes to start, according to this number server generates processes at the time of booting the system. suppose that this no is 2 then at first server will generate 2 process and then wait for few seconds then again 4 then 8 and so on.
- MinSpareServers must be low. (minimum number of server processes which are kept spare) These are the child processes (which are called more) can be kept ideally so that further it can be called directly.
- MaxSpareServers must be low. (maximum number of server processes which are kept spare).
- MaxRequestPerChild (maximum number of requests a server process serves) - this is by default 0 but it should be set to something else. This number can be choosen by hit and trial method only.
- There is a scaling method to set the values for MaxClients ( RAM / (Average apache process size) ) = MaxClients
- For a site to be run with a very good performance , all apache server performance depends on these few points settings:
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
- Dual Apache Server: For Dynamic content one page takes a lot of time to load the whole page because it loads static data as well as dynamic content (images) - So to solve this problem you can use one more apache server on the same machine to process dynalic content seperately so that process of page could be make faster.
- PHP Tunning: Php can handle performance only to a level. PHP provide a very good data handling technique, but only few developers are known with it. PHP support - _SERVER["HTTP_ACCEPT_ENCODING"] gzip,deflate
set output_handler = ob_gzhandler
This gzip will make HTML code in to a compressed format and this compressed data can be send to end user using less bandwidth.