473,786 Members | 2,399 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

maximum number of sessions....

Is there anyway to montior the number of user sessions from an asp.net
app\page?

The reason I ask is because I would like to throttle the number of
concurrent sessions to a website, i.e. limit the number of concurrent user
sessions lets say to 10,000 and if a user session exceeeds this amount they
would be redirected to a 'Server is to busy' screen.

I get the feeling there is no way to programmtically do this as I believe
the number of possible supported session is dependant on hardware and the
size of the data being stored in a session.

Cheers in advance

Ollie
Nov 18 '05 #1
4 3349
I've been using this code in global.asax, but the session count is flawed...
I just don't believe the results are correct :) I think I read somewhere
that the session_end is not firing, but someone else will have to tell you
about it.
function Session_Start(s ender:Object, e:EventArgs) {
Application.Loc k();
curUsers = (int)(Applicati on["howManyUse rs"]);
if (String(curUser s)!="NaN") {
curUsers++;
} else {
curUsers = 2;
}
Application["howManyUse rs"] = curUsers;
Application.UnL ock();
}
function Session_End(sen der:Object, e:EventArgs) {
Application.Loc k();
curUsers = (int)(Applicati on["howManyUse rs"]);
if (String(curUser s)!="NaN") {
curUsers--;
} else {
curUsers = -1;
}
Application["howManyUse rs"] = curUsers;
Application.UnL ock();
}

--
Jure ©pik
Nov 18 '05 #2
Cheers for the reply,

session_end events don't fire when you have a web farm (effectively when
ever you have out of process session state) - and the code you sent would
not work on a web farm either as the Application object is process specfic.

Cheers

Ollie Riches

"Carpe Diem" <we*******@carp ediem.si> wrote in message
news:OC******** ******@TK2MSFTN GP10.phx.gbl...
I've been using this code in global.asax, but the session count is flawed... I just don't believe the results are correct :) I think I read somewhere
that the session_end is not firing, but someone else will have to tell you
about it.
function Session_Start(s ender:Object, e:EventArgs) {
Application.Loc k();
curUsers = (int)(Applicati on["howManyUse rs"]);
if (String(curUser s)!="NaN") {
curUsers++;
} else {
curUsers = 2;
}
Application["howManyUse rs"] = curUsers;
Application.UnL ock();
}
function Session_End(sen der:Object, e:EventArgs) {
Application.Loc k();
curUsers = (int)(Applicati on["howManyUse rs"]);
if (String(curUser s)!="NaN") {
curUsers--;
} else {
curUsers = -1;
}
Application["howManyUse rs"] = curUsers;
Application.UnL ock();
}

--
Jure ©pik

Nov 18 '05 #3
there is a way but you will need to implement an httphandler to count the
sessions or use the session start event. typically, that sort of throttling
is done outside of code, from IIS.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Ollie" <ol**********@h otmail.com> wrote in message
news:u$******** ******@tk2msftn gp13.phx.gbl...
Is there anyway to montior the number of user sessions from an asp.net
app\page?

The reason I ask is because I would like to throttle the number of
concurrent sessions to a website, i.e. limit the number of concurrent user
sessions lets say to 10,000 and if a user session exceeeds this amount
they
would be redirected to a 'Server is to busy' screen.

I get the feeling there is no way to programmtically do this as I believe
the number of possible supported session is dependant on hardware and the
size of the data being stored in a session.

Cheers in advance

Ollie

Nov 18 '05 #4
I'm assuming you want to do this dynamically, since you probably know you
can set a fixed maximum # of sessions using IIS manager. If you aren't sure
what max # of sessions you should set it to, you could monitor the server
during load (or simulate the load) & make a note of traffic vs CPU or
whatever you're concerned about. You should not have a goal of running the
server up to 99% CPU, though -- shoot for 85%.

For dynamic, programmatic control, as Alvin said you're probably better off
(IMO) having a job outside of IIS monitoring the number of connections via
WMI or something, then setting the max user sessions in the metabase based
on some criteria.

--
Ben Strackany
www.developmentnow.com

<a href="http://www.development now.com">dn</a>
"Ollie" <ol**********@h otmail.com> wrote in message
news:u$******** ******@tk2msftn gp13.phx.gbl...
Is there anyway to montior the number of user sessions from an asp.net
app\page?

The reason I ask is because I would like to throttle the number of
concurrent sessions to a website, i.e. limit the number of concurrent user
sessions lets say to 10,000 and if a user session exceeeds this amount they would be redirected to a 'Server is to busy' screen.

I get the feeling there is no way to programmtically do this as I believe
the number of possible supported session is dependant on hardware and the
size of the data being stored in a session.

Cheers in advance

Ollie

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2668
by: Edgardo Sepulveda | last post by:
Hi, one question, is there a limit on the numbers of sessions that a client can have? i dont know why but suddently, as i handle a lot of the user information with sessions, and also have added a lot of new features,, my users are telling me that they are getting session timeout page, that i have for when it happens, but, why now? is there a way that i can count the number of sessions of a client? Thanks for your help, BTW, im using a...
15
10995
by: dee | last post by:
Hi, What is the maximum number of minutes for Session timeout that I can specify in web.config? Thanks. Dee
1
6920
by: cefrancke | last post by:
I have a Back End database (split) that is on a smokin' hot machine (dual processor, 2 gig RAM, XP Pro SP2) and I'm getting an error that says the database (back end file) is "opened exclusively" by someone else. I looked at the number of sessions and noticed that when the number of sessions were at 10, any new user launching the front end would get the "exclusive" error message. There is no security in place and no login required.
0
387
by: cefrancke | last post by:
I have a Back End database (split) that is on a smokin' hot machine (dual processor, 2 gig RAM, XP Pro SP2) and I'm getting an error that says the database (back end file) is "opened exclusively" by someone else. I looked at the number of sessions and noticed that when the number of sessions were at 10, any new user launching the front end would get the "exclusive" error message. There is no security in place and no login required.
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9492
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10360
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9960
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4064
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.