webservice response time

Discussion in 'ASP.NET WebServices' started by joaobana, Dec 27, 2009.

  1. Hi,
    I am developing an asp.net webservice and a webform to call it from javascript code every second (basically updating clock from server time)

    Everything works fine when tests locally. When i try running the app on server i get some disappointing performances. Breaking down the server response time into peaces this is what i get:

    ACTUAL PERFORMANCE
    --------------
    ClientConnected: 01:30:56:6132
    ClientDoneRequest: 01:30:56:6132
    Gateway Determination: 0ms
    DNS Lookup: 0ms
    TCP/IP Connect: 531ms
    ServerConnected: 01:30:57:1445
    ServerGotRequest: 01:30:57:1445
    ServerBeginResponse: 01:30:57:6445
    ServerDoneResponse: 01:30:57:6445
    ClientBeginResponse: 01:30:57:6445
    ClientDoneResponse: 01:30:57:6445

    Overall Elapsed: 00:00:01.0312500

    As you can see one of the major problems is the TCP/IP Connect time. Since Dicountasp.net doesn't allow persistent connections, is that a way to improve the connection open times?

    thanks in advance
     
  2. mjp

    mjp

    What possible need could you have to update a clock every second?
     
  3. mjp

    mjp

    Boy, I don't know how accurate you are going to be able to get any countdown script to be on a shared server.

    You're assuming those countdowns read the server time every second, but I would hazard a guess that they may not. You might try a code-based countdown that syncs to the server time every minute or so and see if that works for you.

    That might actually be more accurate than trying to update every second, as you are eliminating all of those unnecessary connections (and inevitable occasional failures).
     
  4. well, at first i thought the same, but after inspecting requests and responses from those websites i found out that a web service is called every second.
    That is because the countdown is updated every time a user places a bet (adding 20 secs to the countdown). Therefore every users' clock must be updated by the second.

    Anyway, in the previous post you wrote about a "shared server". Does it mean i can keep connections open in a Dedicated server? what are the cons?
    thanks
     
  5. mjp

    mjp

    You can configure a dedicated server any way you'd like, so maintaining a lot of open connections is possible. The downside of opening a connection is in most cases it will stay open indefinitely (or until you close it), which can eventually create a backlog of "zombie" connections, which can cause the server to reject new connections.
     
  6. Ok, so, following your suggestion i ended up reformulating the application. My clocks are now fully javascript thus being independent from server performance.
    However i still need to call an asp.net web service every second. For testing purposes my webservice webmethod is the following:

    [WebMethod]
    public bool Check(int sessionID)
    {
    return false;
    }


    Again, the performance is quite strange: sometimes it takes more than 1 second to run plus 0,5 second to open/close the connection.

    Question: not being an expert i might be quite an optimist, but since my local machine takes 0,0 s to run this, shouldn't a server (even a shared one) be at least as fast or am I overlooking something.

    Thanks for the help once more
     
  7. mjp

    mjp

    Your local server probably wouldn't complete the request in 0,0 seconds if it hosted hundreds of other sites, and they were all making connections at the same time. You can't really compare a development machine/server with a production shared server. They are not doing the same thing, they are not configured the same way, etc., etc.

    Generally speaking, your development server is always going to do everything faster than a production shared server.
     

Share This Page