DeveloperSide.NET Forums
November 20, 2017, 07:49:19 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Apache Devside.net Tutorial  (Read 21994 times)
0 Members and 1 Guest are viewing this topic.
ittec
Member
*
Posts: 3


View Profile
« on: May 08, 2008, 04:07:53 PM »

Hi everybody and congratulations by site, very helpfult. First of all, i don't know if this is the properly forum to my question. Is about a tutorial about "Tunning and performance Apache":

http://www.devside.net/articles/apache-performance-tuning I found your web through MySQL Performance Blog.

Quote
MaxClients ≈ (RAM - size_all_other_processes)/(size_apache_process)

Use 'ps -ylC httpd --sort:rss' to find process size. Divide number by 1024 to get megabytes. Also try 'top'.

Use 'free -m' for a general overview. The key figure to look at is the buffers/cache used value.

Use 'vmstat 2 5' to display the number of runnable, blocked, and waiting processes; and swap in and swap out.

Example:

    * System: VPS (Virtual Private Server), CentOS 4.4, with 128MB RAM
    * Apache: v2.0, mpm_prefork, mod_php, mod_rewrite, mod_ssl, and other modules
    * Other Services: MySQL, Bind, SendMail
    * Reported System Memory: 120MB
    * Reported httpd process size: 7-13MB
    * Assumed memory available to Apache: 90MB

Optimal settings:

    * StartServers 5
    * MinSpareServers 5
    * MaxSpareServers 10
    * ServerLimit 15
    * MaxClients 15
    * MaxRequestsPerChild 2000

I don't understand how author of tutorial find the exaclty number to MaxClients. We know the total amount of RAM, and the total amount used by APACHE.

APACHE = 7-13 MB (totally?)
RAM      =  128 MB
REST OF SO= ???

Max Clients = 15

How you discover the exactly or properly value for Max Clients? My first doubt is how to find the total amount in memory of all process that are not httpd childs, to make the correct formula.

Great tutorial! Thanks.
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #1 on: May 08, 2008, 05:11:26 PM »

Quote
Reported httpd process size: 7-13MB

One point to consider is that out of that 7-13MB reported process size, half of that could potentially be "shared memory" that is part of all the given Apache processes running on that system...

In example: If you have 20 Apache processes and each is being reported as 15MB, there is a very good possibility that what you really have is 20 10MB processes that are also sharing common libraries that are another 5MB.

The point is its very difficult to get an accurate picture and do the correct math. The best solution is to estimate what your system can handle, set the maxclients value, and keep track of system resources.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
ittec
Member
*
Posts: 3


View Profile
« Reply #2 on: May 09, 2008, 08:51:34 AM »

Quote
In example: If you have 20 Apache processes and each is being reported as 15MB, there is a very good possibility that what you really have is 20 10MB processes that are also sharing common libraries that are another 5MB.

So when we did:

Code:
ps -ylC httpd --sort:rss

the last value of RSS is the total value that Apache is using in this moment? Or only the memory to one process of apache? I think that is the total value of memory loaded by one process child of apache, not the total RAM used by apache, isn't it?
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #3 on: May 09, 2008, 02:17:21 PM »

'ps' does not accurately represent memory usage.

Use this script to do that...
http://www.pixelbeat.org/scripts/ps_mem.py

Also read...
http://virtualthreads.blogspot.com/2006/02/understanding-memory-usage-on-linux.html
http://elinux.org/Runtime_Memory_Measurement
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
ittec
Member
*
Posts: 3


View Profile
« Reply #4 on: May 09, 2008, 04:17:20 PM »

Very interesting links admin, Thank you very much!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!