General
cancel
Showing results for 
Search instead for 
Did you mean: 

How to find no users accessing my site currently

palaniappan.sp
Regular Advisor

How to find no users accessing my site currently

Hi,
We have an rhel4 Linux web server which is getting loadded too much by the user.
But our requirement is to find out the no of users accessing our website currently..
I don't need the logs of the site.i need only the no of users in figures how can i find it out
pls help me out

regds,
palani

Everything is Possible and Anything is Feasible if u try
6 REPLIES
Steven E. Protter
Exalted Contributor

Re: How to find no users accessing my site currently

Shalom,

NOUSERS=$(ps -ef | grep httpd | wc -l)
or
NOUSERS=$(export UNIX95=1;ps -C httpd | wc -l)
echo "USERS: $NOUSERS

This will roughly provide the number of httpd threads open, though even an idle web server generally keeps some opoen.

Assuming the site is in use this will provide you an estimate.

The second methodology, not using grep is more accurate at excluding the grep process.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven Schweda
Honored Contributor

Re: How to find no users accessing my site currently

Something like "netstat [-a]", perhaps with
an option or a "grep" to look for port 80,
might be useful.
Matti_Kurkela
Honored Contributor

Re: How to find no users accessing my site currently

Note that a single browser may open multiple HTTP connections when the page contains multiple elements (=almost always).

Also note that one IP address may well contain several simultaneous users, if the IP address belongs to a NAT box. So determining the number of _users_ is not simple at all.

There are other complications, too. The free log analyzer "Analog" has a good explanation on its web page:
http://www.analog.cx/docs/webworks.html

If you're using SSL, the SSL session log might allow you to count the number of individual users with some kind of reliability. If your site has a concept of sessions and implements it in some other way (perhaps using cookies?), you might be able to use this information to count the users.

MK
MK
palaniappan.sp
Regular Advisor

Re: How to find no users accessing my site currently

Hi SEP and steven schweta
I had already tried ur options before itself but i am getting random of users only...
i need currently active users...
Is there any tool available for finding out this
Our customer requires exact information regarding active users when visting the page..

Wa,i know this is some what difficult..task to track it out.
But i am still trying to get some clues..

matti,
Thx for sending the link..

once again thanks for all ur valuable information.

Pls let me know if anybody got answer for this issue in future.


Everything is Possible and Anything is Feasible if u try
Steven Schweda
Honored Contributor

Re: How to find no users accessing my site currently

> [...] but i am getting random of users
> only...

What does this mean? "netstat" should show
current connections to the Web server. What,
exactly, do you want?

> i need currently active users...

Define "currently active user".

If only the Web server knows what an "active
user" is, then you may need to do some CGI
work (or something else active) to keep track
of this datum.
Ralph Grothe
Honored Contributor

Re: How to find no users accessing my site currently

Hi Palani,

I'm buffled nobody mentioned Apache's mod_status
http://httpd.apache.org/docs/2.0/mod/mod_status.html

Just enable it in your httpd.conf

Then run GET http://your.webserver.url/server-status?autoconf

and parse the result.
Read the docs in the above links how to interpret the so called scoreboard.

You can automate this.
I have several Munin nodes running where I let my Munin server chart nice rrdgraphs from exactly the server-status results in five minute intervals.
It produces nice charts that let you see at what hour of the day, what day of the week, what month in the year, your webserver is most frequented.

Ah, I shouldn't forget, this tool is great for performance charting

http://munin.projects.linpro.no/
Madness, thy name is system administration