If User connected to IIS

P

Prabhat

Hi All,

Is there a way that I can know if any user connected to any of my website
(or any specific website) in IIS 5? I wanted to know this before I restart
the Service.

Thanks
Prabhat
 
M

McKirahan

Prabhat said:
Hi All,

Is there a way that I can know if any user connected to any of my website
(or any specific website) in IIS 5? I wanted to know this before I restart
the Service.

Thanks
Prabhat

Google is your friend.

Counting Active Users
http://www.asp101.com/resources/active_users.asp
"There are 28 users currently on this site!"

GLOBAL.ASA
http://www.aspwebpro.com/tutorials/asp/globalasa.asp
"For example, we use the global.asa file on this website
to display the number of Active Users on our site."
 
P

Prabhat

McKirahan said:
Google is your friend.

Counting Active Users
http://www.asp101.com/resources/active_users.asp
"There are 28 users currently on this site!"

GLOBAL.ASA
http://www.aspwebpro.com/tutorials/asp/globalasa.asp
"For example, we use the global.asa file on this website
to display the number of Active Users on our site."
Hi McKirahan,

Thanks for the reply, But I know that we can do that in Global.asa using
Application variable. I am looking for is there some thing IIS built in that
will show the active users / activity ?

(Suppose there is one website that has not yet implenting Active user count
logic in global.asa and the Web Admin want to restart the Service after the
mid night and wanted to know if there are any active user for the Site?)

Thanks
Prabhat
 
K

Kristofer Gafvert [MVP]

Hi,

Yes, you can use performance counters. Check out the Web Service
performance object. "Current connections" will show you if there are any
connections to the webserver.
 
E

Evertjan.

Kristofer Gafvert [MVP] wrote on 07 okt 2005 in
microsoft.public.inetserver.asp.general:
Yes, you can use performance counters. Check out the Web Service
performance object. "Current connections" will show you if there are any
connections to the webserver.

All very nice, but a "connection" exists only during(!!) download.

If you mean looking if there are still sessions-not-ended
[session.end-ed, session.abandon-ed or timed out], yes,
but those users could have switched off their pc's 19 minutes ago.

The IIS "Current connections" is a misnomer.
 
P

Prabhat

Kristofer Gafvert said:
Hi,

Yes, you can use performance counters. Check out the Web Service
performance object. "Current connections" will show you if there are any
connections to the webserver.
Hi Kristofer Gafvert,

Thanks for that hint. as Evertjan is telling I think "Current anonymous
users" should work.

Thanks
Prabhat
 
K

Kristofer Gafvert [MVP]

I don't think we will ever find a failsafe way to find out if there is
someone browsing the website or not since the communication is one-way
(the client never tells the server it is still online using the website
until it makes a new request).

Someone could have switched off their PC, but they could also be reading a
very long article. Both situations may indicate a connection, or not a
connection.

So when restarting the service there is always a risk that someone may be
affected. The only way to avoid this is to have multiple servers in a
cluster (and a web application that is coded for this situation).


--
Regards,
Kristofer Gafvert (IIS MVP)
http://www.gafvert.info/iis/ - IIS Related Info


Evertjan. said:
Kristofer Gafvert [MVP] wrote on 07 okt 2005 in
microsoft.public.inetserver.asp.general:
Yes, you can use performance counters. Check out the Web Service
performance object. "Current connections" will show you if there are any
connections to the webserver.

All very nice, but a "connection" exists only during(!!) download.

If you mean looking if there are still sessions-not-ended
[session.end-ed, session.abandon-ed or timed out], yes,
but those users could have switched off their pc's 19 minutes ago.

The IIS "Current connections" is a misnomer.
 
E

Evertjan.

Kristofer Gafvert [MVP] wrote on 07 okt 2005 in
microsoft.public.inetserver.asp.general:
I don't think we will ever find a failsafe way to find out if there is
someone browsing the website or not since the communication is one-way
(the client never tells the server it is still online using the
website until it makes a new request).

Someone could have switched off their PC, but they could also be
reading a very long article. Both situations may indicate a
connection, or not a connection.

You are making your own definition of "connection".
So when restarting the service there is always a risk that someone may
be affected.

I fully agree.
The only way to avoid this is to have multiple servers in
a cluster (and a web application that is coded for this situation).

As we are talking anonimous users,
I suppose it most often is not worth the trouble.
However that depends on the site application.
 
K

Kristofer Gafvert [MVP]

With HTTP Keep-Alives it is a connection until it times out (or closes for
another reason). Hence someone reading a page (but not actively
downloading anything) could be "connected".

So i am not making up my own definition of "connection". The client has an
inactive connection to the webserver if http keep-alives is enabled and
used, and the "Current Connections" performance counter object shows this.
If you do a netstat -an on the webserver you will see that there is an
established connection between the webserver and client, which also
indicates that there is a connection.

HTTP keep-alive is explained in the HTTP RFC (2616)[1], chapter 8. You may
also want to read about it on the Microsoft website[2].

HTTP keep-alive is enabled by default on IIS 6.0 and probably also IIS 5.0
(i didn't have anywhere to check right now).

For data to transfer between two hosts, first a connection must be
established (opened). Once a connection has been established, the data can
be transfered. When the data is sent, the connection is closed. With HTTP
Keep-alive, the connection is not closed immediately.

So a connection does not exist _only_ during a download...

Read "Protocol operation in detail":
http://en.wikipedia.org/wiki/Transmission_Control_Protocol

"Transmission Control Protocol"
http://www.scit.wlv.ac.uk/~jphb/comms/tcp.html


[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8
[2]
http://www.microsoft.com/technet/pr...IIS/ea116535-8eb9-4c80-8b14-b34418dbfe42.mspx


Bye.


--
Regards,
Kristofer Gafvert (IIS MVP)
http://www.gafvert.info/iis/ - IIS Related Info
 
E

Evertjan.

Kristofer Gafvert [MVP] wrote on 07 okt 2005 in
microsoft.public.inetserver.asp.general:
With HTTP Keep-Alives it is a connection until it times out (or closes
for another reason). Hence someone reading a page (but not actively
downloading anything) could be "connected".

So i am not making up my own definition of "connection". The client
has an inactive connection to the webserver if http keep-alives is
enabled and used, and the "Current Connections" performance counter
object shows this. If you do a netstat -an on the webserver you will
see that there is an established connection between the webserver and
client, which also indicates that there is a connection.

"if http keep-alives is enabled and used"

Is this done by my IE, or the majority of anonimous(!!!) users??

I don't think so, but if so, how can I see that with ASP?
 
K

Kristofer Gafvert [MVP]

I have no idea about _your_ IE, since i don't sit in front of your
computer. I also don't know about the majority of anonymous (i assume that
is what you mean with "anonimous") users, since i have no idea what client
browser the majority of anonymous users use (which is also probably
dependent on the focus of the website).

IE in general has however had HTTP Keep-Alive enabled by default since 5.0
(perhaps even in earlier versions but i have no interest in looking for KB
Articles about this).

Did you read the URLs i gave you? The question you asked is explained
there. In general when HTTP 1.1 is used, HTTP keep-alives is used. But
both the client and/or the server may choose (which is explained in the
HTTP RFC, the link i gave you in the earlier post) to negotiate.

Why do you don't think that the majority of anonymous users do _not_
utilize HTTP keep-alive? What do you base this on?

Why do you want to know this in your ASP code? It has no meaning at all
for ASP code.


--
Regards,
Kristofer Gafvert (IIS MVP)
http://www.gafvert.info/iis/ - IIS Related Info
 
E

Evertjan.

Kristofer Gafvert [MVP] wrote on 07 okt 2005 in
microsoft.public.inetserver.asp.general:
Why do you want to know this in your ASP code? It has no meaning at all
for ASP code.

OK, then it is OT as far as
microsoft.public.inetserver.asp.general is concerned.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top