Mateen Ahmed

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, 14 June 2013

Most Common Apache Tuning Parameters :

Posted on 23:11 by Unknown
One of the biggest hardware issue affecting webserver performance is RAM. A webserver should never ever have to swap, as swapping increases the latency of each request beyond a point that users consider "fast enough". This causes users to hit stop and reload, further increasing the load.

We should, control the MaxClients setting so that web server does not spawn so many children it starts swapping. This procedure for doing this is simple: determine the size of your average Apache process, by looking at your process list via a tool such as top, and divide this into your total available memory, leaving some room for other processes.

1. Remove unused modules : Modules that are not required should be removed because unused module still consume memory and other resources.

2. Should Use mod_disk_cache NOT mod_mem_cache :  mod_mem_cache will not share its cache among different apache processes, which results in high memory usage with little performance gain since on an active server, mod_mem_cache will rarely serve the same page twice in the same apache process.

3. Setup appropriate Expires, Etag, and Cache-Control Headers : To utilize cache, we must tell it when a file expires, otherwise  client will not experience the caching benefits.

4.Utilize mod_gzip/mod_deflate : gzip the content before sending it off and then the client will ungzip upon receipt, this will minimize the size of file transfers, it generally will help all user experience.

5. Turn HostnameLookups Off : if HostnameLookups is ON , it will add latency to every request because it requires a DNS lookup to complete before the request is finished.

6. Avoid using hostname in configs : if you have HostnameLookups off, this will prevent you from having to wait for the DNS resolve of the hostnames in your configs, use IP addresses instead.

7. Use Persistent Connections : Set KeepAlive On and then set KeepAliveTimeout and KeepAliveRequests. KeepAliveTimeout is how long apache will wait for the next request, and KeepAliveRequests is the max number of requests for a client prior to resetting the connection. This will prevent the client from having to reconnect between each request.

8. Increase Write Buffer Size : increase your write buffer size for tcp/ip buffers. On linux systems increase /proc/sys/net/core/wmem_max and  /proc/sys/net/core/wmem_default. If your pages fit within this buffer, apache will complete a process in one call to the tcp/ip buffer.

9.  Increase Max Open Files : if you are handling high loads increase the number of allowed open files. On linux, increase /proc/sys/fs/file-max and run ulimit -H -n 4096.

10.  Disable Content Negotiation : Content negotiation causes a big reduction in performance.Disable content negotiation where it is not needed. If you do require content negotiation, use the type-map handler, rather than the MultiViews option:

Note: Content negotiation is a mechanism defined in the HTTP specification that makes it possible to serve different versions of a document  at the same URI.

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Linux Kernel /etc/sysctl.conf
    /etc/sysctl.conf can be a powerful way of changing kernel settings at run-time. If you have sysctl.conf support compiled into your kernel, y...
  • Domain name formulation
    The right-most label conveys the top-level domain; for example, the domain name  www.example.com  belongs to the top-level domain com. The h...
  • How To Add a non-login User in Linux so that he/she doesn't have shell.
    useradd & usermod commands are used to add and modify the users in linux. When invoked without the -D option, the useradd command creat...
  • To Increase Networking Performance Network Stack (Buffers Size)
    By default the Linux network stack is not configured for high speed large file transfer across WAN links. This is done to save memory resour...
  • SVN Server on RHEL6
    Subversion (SVN) is a version control system initiated in 2000 by CollabNet Inc. It is used to maintain current and historical versions of f...
  • Types of NameServer
                                                            There are four primary nameserver configuration:    Master Server:  The primary mast...
  • Apache Security with SELinux
    Security with Apache is an important topic, of which SELinux is a part. The reason for discussing SELInux at this point is so that you have ...
  • How do I hide the Apache version number under Linux server?
    You can easily hide Apche (httpd) version number and other information. There are two config directives that controls Apache version. The S...
  • Configuring ssh Server
                                                          SSH SERVER CONFIGURATIONS ssh command is a client remote login program to connect remo...
  • TOP - Process Activity Command
    The top program provides a dynamic real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-int...

Blog Archive

  • ▼  2013 (19)
    • ►  July (1)
    • ▼  June (6)
      • Most Common Apache Tuning Parameters :
      • How to Assign the IP Address and Default gateway i...
      • Key Based / Password Less SSH Authentication on Li...
      • How To Add a non-login User in Linux so that he/sh...
      • What is yum and how do I use it?
      • Set up yum repository for locally-mounted DVD onRH...
    • ►  May (1)
    • ►  April (11)
  • ►  2012 (12)
    • ►  December (11)
    • ►  November (1)
Powered by Blogger.

About Me

Unknown
View my complete profile