What should I do so that n number of persons can view my website live

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cmrhema
    Contributor
    • Jan 2007
    • 375

    What should I do so that n number of persons can view my website live

    Hi,

    "I want that my website should be viewable to 10,000 persons at the same time.
    Also they might insert, or delete data from the database.
    How will you do it".

    This was one of the questions posed in an interview.
    Apart from poolsize, what should I answer for the above question.


    Regards
    cmrhema
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    You can do that using application and session variables.... Look into application events and session event in global.asax
    1. On your Page_load of main page you can increment the Application["NoOfUsers"] counter.
    1.1 If Application["NoOfUsers"] > yourMaxNo then redirect to another page specifying reason otherwise allow to view site ...
    2. On session_end or Logout you could decrement the counter (Application["NoOfUsers"])

    Comment

    • cmrhema
      Contributor
      • Jan 2007
      • 375

      #3
      Originally posted by DeepBlue
      You can do that using application and session variables.... Look into application events and session event in global.asax
      1. On your Page_load of main page you can increment the Application["NoOfUsers"] counter.
      1.1 If Application["NoOfUsers"] > yourMaxNo then redirect to another page specifying reason otherwise allow to view site ...
      2. On session_end or Logout you could decrement the counter (Application["NoOfUsers"])


      Thanks DeepBlue,
      I would like to share one more information, the site will be hosted on windows server 2000. Should I do any thing in the IIS.

      Regards
      cmrhema

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        Originally posted by cmrhema
        Hi,

        "I want that my website should be viewable to 10,000 persons at the same time.
        Also they might insert, or delete data from the database.
        How will you do it".

        This was one of the questions posed in an interview.
        Apart from poolsize, what should I answer for the above question.


        Regards
        cmrhema
        "In all jobs we come across areas where we don't already know the answer. One of my strengths is that I'm not afraid to admit I don't have all the answers and am readily willing to spend as much of my own free time to research the areas I don't know, such as this one, until I have a reasonable solution to the problem."

        Though if you ask me, it sounds like the interview process was a way for an I.T. person who didn't know the answer, to pick the brains of a 100 consultants without paying for their time. All it takes is to post one job opening and you will have 500 applicants all eager to answer every question asked in as much detail as possible to show they know more than the other 499 people applying.

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          This isn't exactly an ASP.NET question. ASP.NET doesn't really care how many people are connect to it...so long as it has enough memory and resources to operate.

          It's more of an IIS configuration question and the question is just begging for more questions:

          Are all 10,000 people using the web application at the same time?
          Does a single web server support this load of people?
          If not can the ASP.NET application run in a Web Farm?

          It doesn't sound like the greatest interview question ever....it all depends on the application, the network, and the server configuration for the system.

          -Frinny

          Comment

          • cmrhema
            Contributor
            • Jan 2007
            • 375

            #6
            Frinnvale, I think as you said, the interviewer was expecting me to answer the webfarm and webgarden concepts.

            Comment

            • Bassem
              Contributor
              • Dec 2008
              • 344

              #7
              Hey,
              What about the user closed the browser, how can you decrement the count.
              Will you keep track the user?How?
              I think when a user request an URL, ASP will create the corresponding XML then the browser will load. Now the user is offline until get another request.

              Comment

              • Frinavale
                Recognized Expert Expert
                • Oct 2006
                • 9749

                #8
                You should implement a JavaScript method that handles the window.OnBefore Unload event. The onbeforeunload event happens when the page is unloading in the browser. This could mean that the user's preforming a postback, or moving to a different page in your site so you need to be sure to take this into account when implementing this method. In this method you could make an Ajax call to the server to indicate the user has logged out or "left".

                Comment

                • Bassem
                  Contributor
                  • Dec 2008
                  • 344

                  #9
                  OK I think the interview question was about the concurrency control to the access a database. the dirty data and that issues.
                  I read very little about, and found the SQL-trigger and you can set a column to each table (datetime) to get when was the last access to this row and updating according to it.

                  Comment

                  • Bassem
                    Contributor
                    • Dec 2008
                    • 344

                    #10
                    Originally posted by Frinavale
                    In this method you could make an Ajax call to the server to indicate the user has logged out or "left".
                    Is closing the browser when you still on the page firing the event that invoke this method?
                    Last edited by Bassem; Mar 26 '09, 09:24 PM. Reason: add "firing the event that invoke this method?"

                    Comment

                    • Frinavale
                      Recognized Expert Expert
                      • Oct 2006
                      • 9749

                      #11
                      It's fired when the web page is unloading...jus t before it's unloaded.

                      So, yes, it is fired when the window is closed while the user is viewing the page.

                      Once the page is completely unloaded JavaScript is no longer available, so this event onbeforeunload is really useful for a bunch of reasons. You can use it to ask the user if they're sure about leaving the page, and let them cancel the unload process...I use it to check for unsaved changes on pages that have a lot of input fields to make the user aware that they are about to lose everything the entered. But I've also helped people use it to logout users once they've left the website.

                      Check out this article for more information.

                      Comment

                      • Bassem
                        Contributor
                        • Dec 2008
                        • 344

                        #12
                        Thanks Frinny,
                        The article you posted there is very interesting I'll try to do it even I didn't look for before but now it seems very important.

                        Comment

                        Working...