Sponsored Content
Operating Systems Linux Red Hat Memory Utilisation of httpd process Post 302568288 by Hari_Ganesh on Thursday 27th of October 2011 03:02:35 AM
Old 10-27-2011
Memory Utilisation of httpd process

Hi All,

I have a RHEL 5.4 server which runs an Apache web server(2.2.23 compiled with prefork MPM).I want to find out the memory utilised by the web server.


Code:
# ps -ylC httpd | wc -l
245
# ps -ylC httpd | more
S   UID   PID  PPID  C PRI  NI   RSS    SZ WCHAN  TTY          TIME CMD
S    48   376  1074  0  75   0  4640  45817 -      ?        00:00:00 httpd

My understanding is that RSS is the amount of real memory used by a process.So am adding the RSS column to arrive at total memory used by all httpd processes.

Code:
# ps -ylC httpd |awk '{print $8}' | awk '{sum = sum + $1;} END{print sum}'
1190456
# free -m
             total       used       free     shared    buffers     cached
Mem:          1883       1677        205          0        158        990
-/+ buffers/cache:        528       1355
Swap:         4095          0       4095



So the total memory used by my web server is 1190456Kb or 1.19GB. But from "free -m" command i am getting around 1gb cached and 1.6gb used while as the total RAM is just 2GB.

Can someone point where i am wrong? Is this the right way to calculate memory utilised by a webserver?
Any other better methods?

Thanks
HG

---------- Post updated at 12:32 PM ---------- Previous update was at 12:18 PM ----------

Forgot to add this:

Output of top:

Code:
 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 376 apache    15   0  178m 4784 2076 S  0.0  0.2   0:00.11 httpd
  378 apache    15   0  178m 5436 2160 S  0.0  0.3   0:00.13 httpd
  426 apache    15   0  178m 5448 2136 S  0.0  0.3   0:00.11 httpd


The top command shows something like VIRT using 178m. The documentation says VIRT = RES + Swap

SO each "httpd" process is using 178mb?? swap usage shows zero(as can be seen in "free -m) command.

Smilie

Thanks
HG
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to check Process Utilisation

Hi, Is there any way in Unix to check for the system usage processwise ?? I mean I wud like to get a listing of running processes along with their CPU / memory utilisation so that I can spot dangerous the space / memory eaters .. Thanks & regards, SNS (2 Replies)
Discussion started by: Sabari Nath S
2 Replies

2. UNIX for Dummies Questions & Answers

How to check process/cpu utilisation thru unix shell scripting

Dear Champs, Can anybody help me out to write a shell script , which will check whether the process is running , if running then divide the process into 2 so that next var it can take process parallel . Let ps -ef | grep a.sh => shows running note a.sh will take a process of next... (0 Replies)
Discussion started by: manas_ranjan
0 Replies

3. UNIX for Dummies Questions & Answers

Script for CPU and Memory Utilisation

Hi, I want to check the CPU and Memory Utilisation in the whole machine (not for a single process). Can someone send me a ready made script which captures all information in a log every 5min?? Thanks, Ajith (0 Replies)
Discussion started by: Ajith Praveen
0 Replies

4. Shell Programming and Scripting

Start a new process when memory/cpu utilisation falls

Hi all, I am a newbie to whole shell scripting thing. I deal with computational studies and a lot of softwares which run on linux. At times, I have to schedule my jobs after some process has started. In these case, I have to use at command to schedule my job. However, I would like to know if... (0 Replies)
Discussion started by: johnsmithgr8
0 Replies

5. UNIX for Dummies Questions & Answers

cant start httpd process

httpd status is stopped.cant start it again by : /etc/init.d/httpd restart or /etc/init.d/httpd/start help needed (2 Replies)
Discussion started by: raksha.s
2 Replies

6. AIX

CPU and memory utilisation by one process

Hi, We need to monitor one process over time to see at which exact point it starts to consume to much memory and CPU (to correlate this with some other events). I am a newbie in AIX, so please could you tell me which command will give a snapshot of the current state of a process so that I... (1 Reply)
Discussion started by: yallow
1 Replies

7. AIX

THCOUNT (THCNT) higher than ThreadLimit for httpd process?

One issue I could see on AIX 5.3: At one of my customer they have got the ThreadLimit of 2500 set on web server in httpd.conf file. Currently 2000 users have logged in each attaing a single instance of httpd. While in ps -ef for httpd process it is showing thread count (thcount) almost 3000.... (3 Replies)
Discussion started by: aarora_98
3 Replies

8. Linux

Reason/components behind high memory utilisation on linux

Hi friends, Problem: High memory utilisation of one linux server, due to which a database crashed on the server. My question to all: How does glance calculate that memory utilisation on the linux server is 98%. I mean what components are part of (31.4gb-599mb)? How can i check that myself? Can... (3 Replies)
Discussion started by: kunwar
3 Replies

9. Linux

HTTPD process user to access NIS

Hi, I have a machine A with a web server apache2 running. By default, apache2 user is wwwrun. Problem is that this user is local. Instead, I would like apache2 user to be able to login via NIS server so it can access NFS resources of two NIS different groups, let's say group1..groupN... (2 Replies)
Discussion started by: asanchez
2 Replies

10. Shell Programming and Scripting

Memory Utilisation of a server

Hi, I need to find the memory utilisation of a server as mentioned below. Memory should be divided into TOTAL, UZDM, BUFFER, CACHE, AVAILABLE. Can anyone help me to get this? (10 Replies)
Discussion started by: Arasu
10 Replies
GIT-INSTAWEB(1) 						    Git Manual							   GIT-INSTAWEB(1)

NAME
git-instaweb - Instantly browse your working repository in gitweb SYNOPSIS
git instaweb [--local] [--httpd=<httpd>] [--port=<port>] [--browser=<browser>] git instaweb [--start] [--stop] [--restart] DESCRIPTION
A simple script to set up gitweb and a web server for browsing the local repository. OPTIONS
-l, --local Only bind the web server to the local IP (127.0.0.1). -d, --httpd The HTTP daemon command-line that will be executed. Command-line options may be specified here, and the configuration file will be added at the end of the command-line. Currently apache2, lighttpd, mongoose, plackup and webrick are supported. (Default: lighttpd) -m, --module-path The module path (only needed if httpd is Apache). (Default: /usr/lib/apache2/modules) -p, --port The port number to bind the httpd to. (Default: 1234) -b, --browser The web browser that should be used to view the gitweb page. This will be passed to the git web--browse helper script along with the URL of the gitweb instance. See git-web--browse(1) for more information about this. If the script fails, the URL will be printed to stdout. start, --start Start the httpd instance and exit. Regenerate configuration files as necessary for spawning a new instance. stop, --stop Stop the httpd instance and exit. This does not generate any of the configuration files for spawning a new instance, nor does it close the browser. restart, --restart Restart the httpd instance and exit. Regenerate configuration files as necessary for spawning a new instance. CONFIGURATION
You may specify configuration in your .git/config [instaweb] local = true httpd = apache2 -f port = 4321 browser = konqueror modulepath = /usr/lib/apache2/modules If the configuration variable instaweb.browser is not set, web.browser will be used instead if it is defined. See git-web--browse(1) for more information about this. SEE ALSO
gitweb(1) GIT
Part of the git(1) suite Git 1.8.3.1 06/10/2014 GIT-INSTAWEB(1)
All times are GMT -4. The time now is 11:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy