A guest's language is obscene. What should I do?
ASP Page Counter
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ASP web-programming > ASP Page Counter 12 September 2008 19:48:02

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

ASP Page Counter

Paul W Smith 12 September 2008 19:48:02
 I have written a hit counter, which I believe counts the times my page is
hit by a user for each unique session by the user.

The relevant part of my code is below:


If IsEmpty(Session("To­talCount")) Then

' Increment or reset the count
If Weekday(Date(),vbSu­nday) = 1 And dtDate <> Date then
iCount = 1
Else
iCount = iCount + 1
End If
dtDate = Date

End If

Session("TotalCount­")= iCount

The page is www.middlesexccl.co­m


My issue is I cannot believe the number of hits I am getting - or more
accurately should I trust the number of hits I am getting.

When I first go to the URL I see the count increased by one, but it does not
incredment if I reload the page.

Is there any techniques that the clubs involved could be using, i.e. some
sort of 'fancy' linking to the page from their web site which might be
causing the count to be incremented unduely? I am sorry if that sounds a
little vague but I cannot udnerstand where the hits are coming from.

If anyone has any other odeas on how to test this please let me have
details.

Many thanks to all those who give this isue their attention.

Paul Smith


Add comment
McKirahan 15 August 2008 14:53:11 permanent link ]
 "Paul W Smith" <pws@NOSPAM.twelve.­me.uk> wrote in message
news:Oq3L4Us$IHA.22­44@TK2MSFTNGP05.phx.­gbl...

[snip]

My issue is I cannot believe the number of hits I am getting - or more
accurately should I trust the number of hits I am getting.

Check your raw Web log files.

They'll identify the date, time, and ip address of each "hit".

FTP into your site; if you can't find them then ask your Web host.


Add comment
Paul W Smith 15 August 2008 16:13:38 permanent link ]
 
My issue is I cannot believe the number of hits I am getting - or more
accurately should I trust the number of hits I am getting.
Check your raw Web log files.
They'll identify the date, time, and ip address of each "hit".
FTP into your site; if you can't find them then ask your Web host.

Thank for that great advice - found some explainations of web pages on web,
and after some integration of the log files for the week, I can see that my
hit count is actually pretty accurate!


Add comment
Daniel Crichton 18 August 2008 18:33:04 permanent link ]
 Paul wrote on Fri, 15 Aug 2008 11:53:57 +0100:

I have written a hit counter, which I believe counts the times my page
is hit by a user for each unique session by the user.

The relevant part of my code is below:


If IsEmpty(Session("To­talCount")) Then

' Increment or reset the count
If Weekday(Date(),vbSu­nday) = 1 And dtDate <> Date then iCount
= 1
Else iCount = iCount + 1
End If dtDate = Date

End If

Session("TotalCount­")= iCount



My issue is I cannot believe the number of hits I am getting - or more
accurately should I trust the number of hits I am getting.

When I first go to the URL I see the count increased by one, but it
does not incredment if I reload the page.

Is there any techniques that the clubs involved could be using, i.e.
some sort of 'fancy' linking to the page from their web site which
might be causing the count to be incremented unduely? I am sorry if
that sounds a little vague but I cannot udnerstand where the hits are
coming from.

If anyone has any other odeas on how to test this please let me have
details.

Many thanks to all those who give this isue their attention.

Paul Smith


The Session object is a per-session object, so you'll only see a TotalCount
value for your own session. Also, as you only increment if
Session("TotalCount­") is empty, it will only increment once. Looking at the
code you posted, there is no way that could be the only code handling the
counter on that site.

For a counter that tracks sessions for you site, look into using the
Application object in the Session_OnStart event in global.asa. This would
allow you to increment the counter by 1 for each new Session that is
created, and is visible to any page that can read the Application object.

For instance, look at this: http://www.asptutor­ial.info/script/acti­veuserscounter/

However, note that this only records the number of active sessions - to get
the total number of sessions since reset, drop the Session_OnEnd event code.
If you want actual hits to pages, you will need to add code into every ASP
page on your site to increment an Application variable, eg.

Application.Lock
If IsEmpty(Application­("TotalHits")) then
Application("TotalH­its") = 1
Else
Application("TotalH­its") = Applicaton("TotalHi­ts") + 1
End If
Application.Unlock

You could then, if you wanted, display the number of sessions and the number
of hits as counters on your site. You might want to combine this with the
Application_OnStart­ even in global.asa to initialise the "TotalHits" value,
then you only need the incrementing line in each page rather than the entire
If ... End If block.

Don't forget that the figures will be lost if the IIS process is
recycled/stopped/st­arted though.

--
Dan


Add comment
Evertjan. 18 August 2008 18:47:38 permanent link ]
 Daniel Crichton wrote on 18 aug 2008 in
microsoft.public.in­etserver.asp.general­:

Application.Lock
If IsEmpty(Application­("TotalHits")) then
Application("TotalH­its") = 1
Else
Application("TotalH­its") = Applicaton("TotalHi­ts") + 1
End If
Application.Unlock

I do not think a lock will be usefull/neccesary for a single statement.

Don't forget that the figures will be lost if the IIS process is
recycled/stopped/st­arted though.

So it is not usefull at all, methinks,
better use a database or a single file.

---------------

The application stored counter could be used for counting the number of
"active" visitors, since they are zero at a new application start anyway.

The count up and count down could be put in the global asa session subs.

Perha[s the OP wanted that.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
Daniel Crichton 18 August 2008 18:56:17 permanent link ]
 Evertjan. wrote on 18 Aug 2008 15:47:38 GMT:

Daniel Crichton wrote on 18 aug 2008 in
microsoft.public.in­etserver.asp.general­:

Application.Lock
If IsEmpty(Application­("TotalHits")) then
Application("TotalH­its") = 1
Else
Application("TotalH­its") = Applicaton("TotalHi­ts") + 1
End If
Application.Unlock


I do not think a lock will be usefull/neccesary for a single statement.

Probably not, but it's been a while since I looked into the effects of
locking.

Don't forget that the figures will be lost if the IIS process is
recycled/stopped/st­arted though.

So it is not usefull at all, methinks, better use a database or a
single file.

It's useful if you only need a rough idea of what's going on.

---------------

The application stored counter could be used for counting the number of
"active" visitors, since they are zero at a new application start
anyway.

The count up and count down could be put in the global asa session
subs.

Perha[s the OP wanted that.

Which is what I linked to :)­

--
Dan


Add comment
Evertjan. 21 August 2008 19:13:34 permanent link ]
 Anthony Jones wrote on 20 aug 2008 in
microsoft.public.in­etserver.asp.general­:

"Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9AFEB4FBFC4­F0eejj99@194.109.133­.242...
Daniel Crichton wrote on 18 aug 2008 in
microsoft.public.in­etserver.asp.general­:
Application.Lock
If IsEmpty(Application­("TotalHits")) then
Application("TotalH­its") = 1
Else
Application("TotalH­its") = Applicaton("TotalHi­ts") + 1
End If
Application.Unlock
I do not think a lock will be usefull/neccesary for a single statement.
Request A arrives
Request B arrices
Thread handling A reads Totalhits (its 10)
Thread handling B reads TotalHits (its still 10)
Thread handling B assigns 11 to TotalHits
Thread handling A also assigns 11 to TotalHits
Technically then the Lock is necessary although in reality it might not
actually matter.

That could be true, but it also could be,
that ASP in singlethreaded on a per statement basis.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
Anthony Jones 22 August 2008 00:33:03 permanent link ]
 "Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B01B961237­E8eejj99@194.109.133­.242...
Anthony Jones wrote on 20 aug 2008 in
microsoft.public.in­etserver.asp.general­:
"Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9AFEB4FBFC4­F0eejj99@194.109.133­.242...
Daniel Crichton wrote on 18 aug 2008 in
microsoft.public.in­etserver.asp.general­:
Application.Lock
If IsEmpty(Application­("TotalHits")) then
Application("TotalH­its") = 1
Else
Application("TotalH­its") = Applicaton("TotalHi­ts") + 1
End If
Application.Unlock
I do not think a lock will be usefull/neccesary for a single statement.
Request A arrives
Request B arrices
Thread handling A reads Totalhits (its 10)
Thread handling B reads TotalHits (its still 10)
Thread handling B assigns 11 to TotalHits
Thread handling A also assigns 11 to TotalHits
Technically then the Lock is necessary although in reality it might not
actually matter.
That could be true, but it also could be,
that ASP in singlethreaded on a per statement basis.

The only time that would be true is if the whole site is single threaded due
to debugging being enabled.


--
Anthony Jones - MVP ASP/ASP.NET


Add comment
Evertjan. 22 August 2008 17:42:17 permanent link ]
 Anthony Jones wrote on 21 aug 2008 in
microsoft.public.in­etserver.asp.general­:

Technically then the Lock is necessary although in reality it might
not actually matter.

That could be true, but it also could be,
that ASP in singlethreaded on a per statement basis.

The only time that would be true is if the whole site is single
threaded due to debugging being enabled.

Why?

There is no advantage to multithread a single "let" statement,
and in global.asa it even is detrimental.
So it is just the choice of the VBS interpreter programmer.

Do we know, or can we test this?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
Anthony Jones 22 August 2008 18:34:46 permanent link ]
 "Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B02A9E6BAB­E6eejj99@194.109.133­.242...
Anthony Jones wrote on 21 aug 2008 in
microsoft.public.in­etserver.asp.general­:
Technically then the Lock is necessary although in reality it might
not actually matter.
That could be true, but it also could be,
that ASP in singlethreaded on a per statement basis.
The only time that would be true is if the whole site is single
threaded due to debugging being enabled.
Why?
There is no advantage to multithread a single "let" statement,
and in global.asa it even is detrimental.
So it is just the choice of the VBS interpreter programmer.
Do we know, or can we test this?

I don't think you've quite grasped the concept yet.

Let me step you through my earlier example more slowly (to keep things
simple I'll assume one cpu)

Request A arrives
ASP takes a session object matching the Session cookie
ASP takes an existing scripting context not currently in use
ASP takes the script that the path indicates
ASP takes an idle thread from a thread pool (we'll give this thread an
ID of 1)
ASP puts this lot together and starts executing the script on thread 1

Request B arrives

ASP takes a session object matching the Session cookie
ASP takes an existing scripting context not currently in use
ASP takes the script that the path indicates
ASP takes an idle thread from a thread pool (we'll give this thread an
ID of 2)
ASP puts this lot together and starts executing the script on thread 2


Thread 1 handling A reads Totalhits (its 10)
Dispite what may seem the line:-
Application("TotalH­its") = Applicaton("TotalHi­ts") + 1
is not a single atomic operation
There is a read, there is an add and there is a write (with plenty in
between)
all of which may be pre-empted at any time.
At this point thread 1 has merely read the value then its pre-empted
and the scheduler starts executing Thread 2

Thread 2 handling B reads TotalHits (its still 10)
Here thread 2 has read the same value neither thread has written yet.
Hence it has read the same value

Thread 2 handling B assigns 11 to TotalHits
The addition is performed and the value written back to the application
object
Thread 2 completes in the knowledge of a job well done.

Thread 1 handling A also assigns 11 to TotalHits
Thread 1 resumes where it left off
It has just read the value it has no idea that it has changed since
It performs the addition and writes the value 11 back to the application
Thread 2 complete in the knowledge of a job well done.

Do you see it now?


--
Anthony Jones - MVP ASP/ASP.NET


Add comment
Evertjan. 22 August 2008 19:30:43 permanent link ]
 Anthony Jones wrote on 22 aug 2008 in
microsoft.public.in­etserver.asp.general­:

Thread 1 handling A reads Totalhits (its 10)
Dispite what may seem the line:-
Application("TotalH­its") = Applicaton("TotalHi­ts") + 1
is not a single atomic operation
There is a read, there is an add and there is a write (with plenty in
between)
all of which may be pre-empted at any time.
At this point thread 1 has merely read the value then its pre-empted
and the scheduler starts executing Thread 2
[ etc ]


You are so wrong in thinking,
that because it is logical,
it is implemented that way.

While it could very well be the case,
the logic does not prove the factual implementation.

Ony the source code or the testing can prove it.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
Anthony Jones 22 August 2008 22:12:11 permanent link ]
 "Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B02BC49671­23eejj99@194.109.133­.242...
Anthony Jones wrote on 22 aug 2008 in
microsoft.public.in­etserver.asp.general­:
Thread 1 handling A reads Totalhits (its 10)
Dispite what may seem the line:-
Application("TotalH­its") = Applicaton("TotalHi­ts") + 1
is not a single atomic operation
There is a read, there is an add and there is a write (with plenty
in
between)
all of which may be pre-empted at any time.
At this point thread 1 has merely read the value then its pre-empted
and the scheduler starts executing Thread 2
[ etc ]
You are so wrong in thinking,
that because it is logical,
it is implemented that way.
While it could very well be the case,
the logic does not prove the factual implementation.
Ony the source code or the testing can prove it.


Here is a fact the VBScript engine has no idea what an application object
is.

Here is another fact VBScript does not compile to native code.

Here is another fact VBScript doesn't create a zillion critical sections
around simple assignment statements.

You can lead a horse to water but you can't make it drink.


--
Anthony Jones - MVP ASP/ASP.NET


Add comment
Evertjan. 22 August 2008 23:35:39 permanent link ]
 Anthony Jones wrote on 22 aug 2008 in
microsoft.public.in­etserver.asp.general­:

Here is a fact the VBScript engine has no idea what an application object
is.
Here is another fact VBScript does not compile to native code.
Here is another fact VBScript doesn't create a zillion critical sections
around simple assignment statements.
You can lead a horse to water but you can't make it drink.

All these things are circumstancial,
and do not prove a thing.

It still might be that a let statement in global.asa is internally
singlethreaded, because it was felt convenient.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
Anthony Jones 22 August 2008 23:57:33 permanent link ]
 "Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B02E5CFCC7­92eejj99@194.109.133­.242...
Anthony Jones wrote on 22 aug 2008 in
microsoft.public.in­etserver.asp.general­:
Here is a fact the VBScript engine has no idea what an application
object
is.
Here is another fact VBScript does not compile to native code.
Here is another fact VBScript doesn't create a zillion critical sections
around simple assignment statements.
You can lead a horse to water but you can't make it drink.
All these things are circumstancial,
and do not prove a thing.
It still might be that a let statement in global.asa is internally
singlethreaded, because it was felt convenient.


(sigh) Well you're entitled to hold to whatever beliefs you want to.

For the record so that no one else under any illusion this:-

application("thing"­) = application("thing"­) + 1

is not threadsafe. In order ensure the value is updated correctly the
application object must be locked.



--
Anthony Jones - MVP ASP/ASP.NET


Add comment
Evertjan. 23 August 2008 01:22:48 permanent link ]
 Anthony Jones wrote on 22 aug 2008 in
microsoft.public.in­etserver.asp.general­:

All these things are circumstancial,
and do not prove a thing.
It still might be that a let statement in global.asa is internally
singlethreaded, because it was felt convenient.
(sigh) Well you're entitled to hold to whatever beliefs you want to.
For the record so that no one else under any illusion this:-

What record?

application("thing"­) = application("thing"­) + 1
is not threadsafe. In order ensure the value is updated correctly the
application object must be locked.

This is probably true, bot only probably so.

Have you any reason to be more sure than that?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
Chris Hohmann 27 August 2008 03:05:01 permanent link ]
 "Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B03D508D9A­4Eeejj99@194.109.133­.242...
Anthony Jones wrote on 23 aug 2008 in
microsoft.public.in­etserver.asp.general­:
I'm sorry you seem to me to be pre-disposed to reject any reason or
facts I present to you.
I am not, I constantly say that your idea is probably true,
but it is not true, simply because you say so.
I have debugged at the machine level VB and VBScript applications.
I have built applications which act as scripting hosts (ASP is such an
application).
Good for you, I have not read your c.v., you did not tell me your
credentials till now, you either are well versed in VB ans VBS, or at
least
you think you are.
That all does not mean that others like me should believe you an your
word.
I do not think for a moment that you are dishonest, btw.
I have sufficient insight into what is going on under-the-hood to know
that what I've stated is a fact.
Oh, Anthony, it is not about what you yourself think to be a fact,
that you have proved beond reasonable doubt.
However, your stand that that is enough reason to require that others
believe you, is, perhaps also because of your self expressed
infallability,
unreasonable.
You did not express, that you tested the let assignment line in
interpreting global.asa to be internally multitreaded, or have looked at
the assembly or intermediate code for that.
You only express fact from inference that you believe it is generally that
way.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

http://msdn.microso­ft.com/en-us/library­/ms525184.aspx

From the Application.Lock documentation:
"A page does not need to lock the application object to edit the application
collection. If one page tries to edit the application collection without
locking and a second page also tries to edit the collection, no error is
sent by IIS and the Application object ends up in an inconsistent state."


Add comment
Evertjan. 27 August 2008 11:15:58 permanent link ]
 Chris Hohmann wrote on 27 aug 2008 in
microsoft.public.in­etserver.asp.general­:

From the Application.Lock documentation:
"A page does not need to lock the application object to edit the
application collection. If one page tries to edit the application
collection without locking and a second page also tries to edit the
collection, no error is sent by IIS and the Application object ends up
in an inconsistent state."

One would need to know what they mean by "not need" in this case, Chris.
How can a state ever be inconsistent?

And I doubt the documentation writers of MS always know what past
implementors did manage to put in the code. Remember the still present
"endif" allowance bug in VBS single line if-else-then?

The next interesting Q is, how we could ever test this inconsistency,
and more so prove the possible absense of such inconsistency.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
Chris Hohmann 27 August 2008 20:49:48 permanent link ]
 Responses inline.

"Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B07686EEFD­C2eejj99@194.109.133­.242...
Chris Hohmann wrote on 27 aug 2008 in
microsoft.public.in­etserver.asp.general­:
From the Application.Lock documentation:
"A page does not need to lock the application object to edit the
application collection. If one page tries to edit the application
collection without locking and a second page also tries to edit the
collection, no error is sent by IIS and the Application object ends up
in an inconsistent state."
One would need to know what they mean by "not need" in this case, Chris.

I assume they meant that no error is thrown if you attempt to modify the
application object without using lock/unlock. There's a contact link at the
bottom of the page if you'd like to request clarification.

How can a state ever be inconsistent?

Anthony already gave an example of inconsistent state.

And I doubt the documentation writers of MS always know what past
implementors did manage to put in the code. Remember the still present
"endif" allowance bug in VBS single line if-else-then?

No way to know for sure unless you ask. I don't remember the still present
"endif" allowance.

The next interesting Q is, how we could ever test this inconsistency,
and more so prove the possible absense of such inconsistency.

Use the hit count example without the lock/unlock and send 100 simultaneous
requests.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Add comment
Evertjan. 27 August 2008 21:38:04 permanent link ]
 Chris Hohmann wrote on 27 aug 2008 in
microsoft.public.in­etserver.asp.general­:

One would need to know what they mean by "not need" in this case,
Chris.
I assume they meant that no error is thrown if you attempt to modify
the application object without using lock/unlock. There's a contact
link at the bottom of the page if you'd like to request clarification.
How can a state ever be inconsistent?
Anthony already gave an example of inconsistent state.

A state is a state, [because a computer is a state machine].
so it can never be inconsistent.

And I doubt the documentation writers of MS always know what past
implementors did manage to put in the code. Remember the still
present "endif" allowance bug in VBS single line if-else-then?
No way to know for sure unless you ask.

No, in such an organisation, no one will know what happened years before.

I don't remember the still present "endif" allowance.

"We" talked about it a few? years ago on usenet:

if bool then do() end if

should give an error because it should have been just:

if bool then do()

as "end if" is only defined for the [younger] multiline if statement:

if bool then
do()
end if

And is was said by MS that the error was recognized and corrected before,
and then the great corporation websites protested, as their sites had to
much "inconsistent" ;-)­ pages to change them overnight.

So the error was reintroduced.

The next interesting Q is, how we could ever test this inconsistency,
and more so prove the possible absense of such inconsistency.
Use the hit count example without the lock/unlock and send 100
simultaneous requests.

Simultaneous? How would you do that?

From one machine, they would necessarily not be simultaneous,
and for 100 machines, well, I doubt you could synchronize with some
precision.

And if no strange things happen, as I expect also in the case of absesne
of implied lock, because you cannot do the simultaneous job. would that
prove anything?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
Chris Hohmann 27 August 2008 23:36:28 permanent link ]
 
"Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B07D1E7A6C­6Deejj99@194.109.133­.242...
Chris Hohmann wrote on 27 aug 2008 in
microsoft.public.in­etserver.asp.general­:
One would need to know what they mean by "not need" in this case,
Chris.
I assume they meant that no error is thrown if you attempt to modify
the application object without using lock/unlock. There's a contact
link at the bottom of the page if you'd like to request clarification.
How can a state ever be inconsistent?
Anthony already gave an example of inconsistent state.
A state is a state, [because a computer is a state machine].
so it can never be inconsistent.

Just because you say it doesn't make it so.

And I doubt the documentation writers of MS always know what past
implementors did manage to put in the code. Remember the still
present "endif" allowance bug in VBS single line if-else-then?
No way to know for sure unless you ask.
No, in such an organisation, no one will know what happened years before.

You are making a blind assertion here. Have you interviewed every single
person Microsoft?

I don't remember the still present "endif" allowance.
"We" talked about it a few? years ago on usenet:
if bool then do() end if
should give an error because it should have been just:
if bool then do()
as "end if" is only defined for the [younger] multiline if statement:
if bool then
do()
end if
And is was said by MS that the error was recognized and corrected before,
and then the great corporation websites protested, as their sites had to
much "inconsistent" ;-)­ pages to change them overnight.
So the error was reintroduced.

None of the above changes the fact that I do not recall this discussion. And
more to the point, I do not understand what the argument is. Are you saying
that one error in the ASP documentation/code calls into question ASP in it's
entirety?

The next interesting Q is, how we could ever test this inconsistency,
and more so prove the possible absense of such inconsistency.
Use the hit count example without the lock/unlock and send 100
simultaneous requests.
Simultaneous? How would you do that?
From one machine, they would necessarily not be simultaneous,
and for 100 machines, well, I doubt you could synchronize with some
precision.

Why don't you try it and let us know how it goes?

And if no strange things happen, as I expect also in the case of absesne
of implied lock, because you cannot do the simultaneous job. would that
prove anything?

No.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Add comment
Anthony Jones 28 August 2008 00:47:02 permanent link ]
 "Chris Hohmann" <nothanks@anonymous­.com> wrote in message
news:%23HE4VSICJHA.­5196@TK2MSFTNGP04.ph­x.gbl...
"Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B07D1E7A6C­6Deejj99@194.109.133­.242...
Simultaneous? How would you do that?
From one machine, they would necessarily not be simultaneous,
and for 100 machines, well, I doubt you could synchronize with some
precision.
Why don't you try it and let us know how it goes?
And if no strange things happen, as I expect also in the case of absesne
of implied lock, because you cannot do the simultaneous job. would that
prove anything?
No.


You could create a repro with just two machines. Have both hammer the
server in large but finite loop. The resulting accumulated count in the
application object should be the sum of loops for both machines. It would
be interesting to see how large the loop would need to be before an
inconsistency would become clear. Or how many additional machines would be
needed.

I grant though in such a simplistic test, conditions may still consipire to
serialise the requests.

(Actually such a test could be produced on a single machine using WinHTTP to
simulate several machines).

I've actually given up trying to convince Evertjan, this sort of thread
hasn't cropped in quite sometime, I'm disappointed that is has now.

--
Anthony Jones - MVP ASP/ASP.NET


Add comment


Evertjan. 28 August 2008 01:23:44 permanent link ]
 Anthony Jones wrote on 27 aug 2008 in
microsoft.public.in­etserver.asp.general­:

I've actually given up trying to convince Evertjan, this sort of thread
hasn't cropped in quite sometime, I'm disappointed that is has now.

Antony,

Why disappointed ?

Are you disappointed not being able to convince someone due to non
convincing arguments?

All the time I stated that you are probably right in your assertion,
but that does not mean it is a fact, as you claimed.

That is why it is theoretically interesting to conceive a test.

In practice it is unimportant, as the exact number of user hits will be
contaminated by the number of bot/crawler hits that no one wants to include
in such count.

Possibly you [general you] can show in such a test, that events are lost,
but the opposite, that no event counts can be lost seems unreachable.

I doubt you [general you] can get enough semiconcurrent page requests where
there is no loss due to a sort of denial of service to test it reliably.

The only way would be reseaching and analyzing the source code. Seems an
hypothetical possiblility.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
Chris Hohmann 28 August 2008 03:37:37 permanent link ]
 "Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B08405F39A­7eejj99@194.109.133.­242...
Anthony Jones wrote on 27 aug 2008 in
microsoft.public.in­etserver.asp.general­:
I've actually given up trying to convince Evertjan, this sort of thread
hasn't cropped in quite sometime, I'm disappointed that is has now.
Antony,
Why disappointed ?
Are you disappointed not being able to convince someone due to non
convincing arguments?
All the time I stated that you are probably right in your assertion,
but that does not mean it is a fact, as you claimed.

"All the time" -> hyperbole

That is why it is theoretically interesting to conceive a test.

Unsupported statement of fact.

In practice it is unimportant, as the exact number of user hits will be
contaminated by the number of bot/crawler hits that no one wants to
include
in such count.

Unsupported statement of fact.

Possibly you [general you] can show in such a test, that events are lost,
but the opposite, that no event counts can be lost seems unreachable.

Says you.

I doubt you [general you] can get enough semiconcurrent page requests
where
there is no loss due to a sort of denial of service to test it reliably.

Says you.

The only way would be reseaching and analyzing the source code. Seems an
hypothetical possiblility.

Hyperbole and unsupported statement of fact.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Wouldn't it be easier to admit you were wrong and move on?


Add comment


Evertjan. 28 August 2008 10:35:15 permanent link ]
 Chris Hohmann wrote on 28 aug 2008 in
microsoft.public.in­etserver.asp.general­:

Says you.
[..]
Says you.
[..]
Hyperbole and unsupported statement of fact.

[please do not quote signatures on usenet]

Wouldn't it be easier to admit you were wrong and move on?

Says you. Sorry I take that back, such childish words.

Wrong in what?

What is wrong with you guys?

I do not state facts, I state lack of facts.

I state a hypothesis, that it is not easy and probably not possible to test
an asp behavour by the suggested method.

But please move on, I am done with you two on this subject.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
Chris Hohmann 28 August 2008 21:44:20 permanent link ]
 "Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B086187846­93eejj99@194.109.133­.242...
But please move on, I am done with you two on this subject.

I win.


Add comment


Evertjan. 29 August 2008 17:27:27 permanent link ]
 Chris Hohmann wrote on 28 aug 2008 in
microsoft.public.in­etserver.asp.general­:

"Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B086187846­93eejj99@194.109.133­.242...
But please move on, I am done with you two on this subject.
I win.

My childeren loved that too, when they were young.
I am glad to have been of service.

Have a wonderful weekend.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
Phillip Windell 12 September 2008 19:48:02 permanent link ]
 "Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns9B07686EEFD­C2eejj99@194.109.133­.242...
Chris Hohmann wrote on 27 aug 2008 in
microsoft.public.in­etserver.asp.general­:
From the Application.Lock documentation:
"A page does not need to lock the application object to edit the
application collection. If one page tries to edit the application
collection without locking and a second page also tries to edit the
collection, no error is sent by IIS and the Application object ends up
in an inconsistent state."
One would need to know what they mean by "not need" in this case, Chris.
How can a state ever be inconsistent?

Hi guys!
I'm not expert but let me see if I can answer that question by what the
documentation meant. If anything it will help me know if I am following this
correctly.

"not need" = means the value can be altered even if the application is not
locked [implied: even though it is a bad idea]

resulting "inconsistant" = two processes, unaware or each other due to the
absents of a lock, can set the value causing an inconsistancy. For example
each process add "1" to the value, but the final resulting value can end up
incremented by 1 from the original value rather than being incremented by
1,...and then be incremented by 1 again against the resulting value of the
first incrementation. The inconsistancy is that you have a final value of
"1" over the original value instead of "2" over the original value.

Basically the same problem of two users writing to the same field in the
same record of a poorly designed database that results in either incorrect
values in the field, or at worst a corrupt databse?

--
Phillip Windell
www.wandtv.com

The views expressed, are my own and not those of my employer, or Microsoft,
or anyone else associated with me, including my cats.
-------------------­--------------------­--------------


Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ASP web-programming > ASP Page Counter 12 September 2008 19:48:02

see also:
Performance with different index types
Re: PQgetResultSet Problem
Re: starting posgresql for the first…
пройди тесты:
see also:
first blood
ABOUT GLOBAL WARMING
Hello!

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .