 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Glenn Thimmes Guest
|
Posted: Fri Dec 12, 2003 6:13 pm Post subject: Getting current Active Module count |
|
|
As each user logs into my web broker application, I am needing to find out
how many users are already logged in and if the limit is reached log the
event and send them to a 'max concurrency reached' page. This is difficult
since I do not have separate application and sessions levels.
I see I might be able legitimately reference the TWebApplication as
(self.Owner as TWebApplication), but it looks like the active module list is
private anyway. Alternatively, if I could create an object in the
initialization of the ISAPI dll that would be visible to all instantiated
DataModules, they could each use that object to check, set the refcount of
current connections.
Any suggestions on how I might accomplish this type of functionality in a
Web Broker application? I see that this would be simple with WebSnap,
though WebSnap itself is NOT simple.
Thanks.
|
|
| Back to top |
|
 |
Glenn Thimmes Guest
|
Posted: Mon Dec 15, 2003 11:43 pm Post subject: Re: Getting current Active Module count |
|
|
So should I assume that it is not possible to find out how many web modules
are currently in the active module list?
"Glenn Thimmes" <glennthi (AT) NoSpam_msn (DOT) com> wrote
| Quote: | As each user logs into my web broker application, I am needing to find out
how many users are already logged in and if the limit is reached log the
event and send them to a 'max concurrency reached' page. This is difficult
since I do not have separate application and sessions levels.
I see I might be able legitimately reference the TWebApplication as
(self.Owner as TWebApplication), but it looks like the active module list
is
private anyway. Alternatively, if I could create an object in the
initialization of the ISAPI dll that would be visible to all instantiated
DataModules, they could each use that object to check, set the refcount of
current connections.
Any suggestions on how I might accomplish this type of functionality in a
Web Broker application? I see that this would be simple with WebSnap,
though WebSnap itself is NOT simple.
Thanks.
|
|
|
| Back to top |
|
 |
Dave Hackett Guest
|
Posted: Tue Dec 16, 2003 12:37 am Post subject: Re: Getting current Active Module count |
|
|
Application.ActiveCount = # Active WebModules modules processing requests
Application.InactiveCount = #WebModules in memory - not current processing a
web request
DaveH
"Glenn Thimmes" <glennthi (AT) NoSpam_msn (DOT) com> wrote
| Quote: | So should I assume that it is not possible to find out how many web
modules
are currently in the active module list?
"Glenn Thimmes" <glennthi (AT) NoSpam_msn (DOT) com> wrote in message
news:3fda0565$1 (AT) newsgroups (DOT) borland.com...
As each user logs into my web broker application, I am needing to find
out
how many users are already logged in and if the limit is reached log the
event and send them to a 'max concurrency reached' page. This is
difficult
since I do not have separate application and sessions levels.
I see I might be able legitimately reference the TWebApplication as
(self.Owner as TWebApplication), but it looks like the active module
list
is
private anyway. Alternatively, if I could create an object in the
initialization of the ISAPI dll that would be visible to all
instantiated
DataModules, they could each use that object to check, set the refcount
of
current connections.
Any suggestions on how I might accomplish this type of functionality in
a
Web Broker application? I see that this would be simple with WebSnap,
though WebSnap itself is NOT simple.
Thanks.
|
|
|
| Back to top |
|
 |
Glenn Thimmes Guest
|
Posted: Tue Dec 16, 2003 3:54 pm Post subject: Re: Getting current Active Module count |
|
|
Thanks for your help, Dave. I've added a response.Content :=
Application.ActiveCountin my web app so that I could confirm that this is
behaving the way I would like. When my first browser is opened, it comes up
as 1, then any following browsers that hit my page still get an ActiveCount
of 1. Right now I should be seeing an active count of about 10, but it
still gives me 1 as the count.
What am I missing?
"Dave Hackett" <dave.hackett (AT) ns (DOT) sympatico.com> wrote
| Quote: | Application.ActiveCount = # Active WebModules modules processing requests
Application.InactiveCount = #WebModules in memory - not current processing
a
web request
DaveH
"Glenn Thimmes" <glennthi (AT) NoSpam_msn (DOT) com> wrote in message
news:3fde46bc (AT) newsgroups (DOT) borland.com...
So should I assume that it is not possible to find out how many web
modules
are currently in the active module list?
"Glenn Thimmes" <glennthi (AT) NoSpam_msn (DOT) com> wrote in message
news:3fda0565$1 (AT) newsgroups (DOT) borland.com...
As each user logs into my web broker application, I am needing to find
out
how many users are already logged in and if the limit is reached log
the
event and send them to a 'max concurrency reached' page. This is
difficult
since I do not have separate application and sessions levels.
I see I might be able legitimately reference the TWebApplication as
(self.Owner as TWebApplication), but it looks like the active module
list
is
private anyway. Alternatively, if I could create an object in the
initialization of the ISAPI dll that would be visible to all
instantiated
DataModules, they could each use that object to check, set the
refcount
of
current connections.
Any suggestions on how I might accomplish this type of functionality
in
a
Web Broker application? I see that this would be simple with WebSnap,
though WebSnap itself is NOT simple.
Thanks.
|
|
|
| Back to top |
|
 |
DaveH Guest
|
Posted: Tue Dec 16, 2003 6:14 pm Post subject: Re: Getting current Active Module count |
|
|
You would need to have more then 1 browser hit the server at the exact same
time in order to see a larger number.
Think of this way...
1) A web request comes in
2) WebBroker looks at the InActiveList. If there is a Web Module available,
it gives the request to it and moves the Module into the Active list. If
there isn't, it creates a new WebModule, puts it into the active list and
gives it the request.
3) The Web Module handles the request and sends back the response.
4) WebBroker moves the Web Module back into the InActive List
So, since your Web Module is so fast (it just returns the count, right?), it
is probably finished the first request before the next one comes in - hence
Active Count = 1.
As a test, put a delay in the Action Handler - like a for loop. Don't
forget to actually use the stuff in the for loop or the compiler will strip
out the "unused" code.
DaveH
"Glenn Thimmes" <glennthi (AT) NoSpam_msn (DOT) com> wrote
| Quote: | Thanks for your help, Dave. I've added a response.Content :=
Application.ActiveCountin my web app so that I could confirm that this is
behaving the way I would like. When my first browser is opened, it comes
up
as 1, then any following browsers that hit my page still get an
ActiveCount
of 1. Right now I should be seeing an active count of about 10, but it
still gives me 1 as the count.
What am I missing?
"Dave Hackett" <dave.hackett (AT) ns (DOT) sympatico.com> wrote in message
news:3fde53ce$1 (AT) newsgroups (DOT) borland.com...
Application.ActiveCount = # Active WebModules modules processing
requests
Application.InactiveCount = #WebModules in memory - not current
processing
a
web request
DaveH
"Glenn Thimmes" <glennthi (AT) NoSpam_msn (DOT) com> wrote in message
news:3fde46bc (AT) newsgroups (DOT) borland.com...
So should I assume that it is not possible to find out how many web
modules
are currently in the active module list?
"Glenn Thimmes" <glennthi (AT) NoSpam_msn (DOT) com> wrote in message
news:3fda0565$1 (AT) newsgroups (DOT) borland.com...
As each user logs into my web broker application, I am needing to
find
out
how many users are already logged in and if the limit is reached log
the
event and send them to a 'max concurrency reached' page. This is
difficult
since I do not have separate application and sessions levels.
I see I might be able legitimately reference the TWebApplication as
(self.Owner as TWebApplication), but it looks like the active module
list
is
private anyway. Alternatively, if I could create an object in the
initialization of the ISAPI dll that would be visible to all
instantiated
DataModules, they could each use that object to check, set the
refcount
of
current connections.
Any suggestions on how I might accomplish this type of functionality
in
a
Web Broker application? I see that this would be simple with
WebSnap,
though WebSnap itself is NOT simple.
Thanks.
|
|
|
| Back to top |
|
 |
Glenn Thimmes Guest
|
Posted: Tue Dec 16, 2003 8:29 pm Post subject: Re: Getting current Active Module count |
|
|
Thanks for the explanation. That makes perfect sense to me now, and I
really should have seen that already. Shifting to this type of sessionless
paradigm is difficult when I am use to having a session level object around
during multiple requests.
Thanks again.
"DaveH" <daveh (AT) sympatico (DOT) com> wrote
| Quote: | You would need to have more then 1 browser hit the server at the exact
same
time in order to see a larger number.
Think of this way...
1) A web request comes in
2) WebBroker looks at the InActiveList. If there is a Web Module
available,
it gives the request to it and moves the Module into the Active list. If
there isn't, it creates a new WebModule, puts it into the active list and
gives it the request.
3) The Web Module handles the request and sends back the response.
4) WebBroker moves the Web Module back into the InActive List
So, since your Web Module is so fast (it just returns the count, right?),
it
is probably finished the first request before the next one comes in -
hence
Active Count = 1.
As a test, put a delay in the Action Handler - like a for loop. Don't
forget to actually use the stuff in the for loop or the compiler will
strip
out the "unused" code.
DaveH
"Glenn Thimmes" <glennthi (AT) NoSpam_msn (DOT) com> wrote in message
news:3fdf2aa0$1 (AT) newsgroups (DOT) borland.com...
Thanks for your help, Dave. I've added a response.Content :=
Application.ActiveCountin my web app so that I could confirm that this
is
behaving the way I would like. When my first browser is opened, it comes
up
as 1, then any following browsers that hit my page still get an
ActiveCount
of 1. Right now I should be seeing an active count of about 10, but it
still gives me 1 as the count.
What am I missing?
"Dave Hackett" <dave.hackett (AT) ns (DOT) sympatico.com> wrote in message
news:3fde53ce$1 (AT) newsgroups (DOT) borland.com...
Application.ActiveCount = # Active WebModules modules processing
requests
Application.InactiveCount = #WebModules in memory - not current
processing
a
web request
DaveH
"Glenn Thimmes" <glennthi (AT) NoSpam_msn (DOT) com> wrote in message
news:3fde46bc (AT) newsgroups (DOT) borland.com...
So should I assume that it is not possible to find out how many web
modules
are currently in the active module list?
"Glenn Thimmes" <glennthi (AT) NoSpam_msn (DOT) com> wrote in message
news:3fda0565$1 (AT) newsgroups (DOT) borland.com...
As each user logs into my web broker application, I am needing to
find
out
how many users are already logged in and if the limit is reached
log
the
event and send them to a 'max concurrency reached' page. This is
difficult
since I do not have separate application and sessions levels.
I see I might be able legitimately reference the TWebApplication
as
(self.Owner as TWebApplication), but it looks like the active
module
list
is
private anyway. Alternatively, if I could create an object in the
initialization of the ISAPI dll that would be visible to all
instantiated
DataModules, they could each use that object to check, set the
refcount
of
current connections.
Any suggestions on how I might accomplish this type of
functionality
in
a
Web Broker application? I see that this would be simple with
WebSnap,
though WebSnap itself is NOT simple.
Thanks.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|