max hits

Results 1 to 3 of 3

Thread: max hits

  1. #1
    zia Guest

    Default max hits

    Is there a way by which you can control the<BR>number of hits to a particular page--- I mean<BR>only allow a specific amount of session variables.<BR>Example if my ASP page has about 3-4 sql query &<BR>then when many users hit that page there might be<BR>unncessary load on the server.So in order to avoid<BR>that I would want for example only 1000 users at a<BR>time to access that page & if 1001 user comes he <BR>gets to some other page or whatever message.<BR> So how do I keep track of that.

  2. #2
    Join Date
    Dec 1969

    Default RE: max hits

    You *could* maintain a counter variable, which could keep track of the current number of querries that you&#039;re processing. Then if the variable hits you MAX allowable value then you wouldn&#039;t run the querry again.... N.B when the current querry processing has completed it would decrement the counter and thus allow another querry to be executed<BR><BR>Or you could improve the performance of you querries/code<BR>Or user a bigger server

  3. #3
    a Guest

    Default RE: max hits

    you could use the APPLICATION object to store a &#039;hit counter&#039; i.e. APPLICATION("SQLHITS")<BR><BR>To ADD one on use<BR>APPLICATION.LOCK<BR>APPLICATION("SQLHITS") = APPLICATION("SQLHITS") + 1<BR>APPLICATION.UNLOCK<BR><BR>To subtract one change the plus to a minus<BR><BR>You could use this in two ways:<BR><BR>1) when the user first enters the page They check the APPLICATION object to see if there are enough connections free, if there is then they add one into the application object, If there is not enough then redirect them. At the bottom of the page subtract one from the APPLICATION OBJECT.<BR><BR>2) Use the global.asa and use session on start and session on end methods.(writing to the APPLICATION object) The only problem with this is that when the user closes their browser the value of the APPLICATION object will not decrease until their session has timed out (could be 20 mins as default)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts