Bad practices

Discussion in 'ASP General' started by James Baker, Jul 13, 2004.

  1. James Baker

    James Baker Guest

    I recently started working for a company and I'm obviously working with some
    existing pages. I've noticed that a few things that concern me, but I'm not
    necessarily sure of the implications.

    1.) They use Session variables for almost everything. Some are never even
    used, others could be handled in more efficient ways. They don't use them
    for objects, just for a *ton* of variables. Will this present a problem?

    2.) Connections aren't closed. There are several pages that have
    connections that never end up closing. Are these connections released when
    the end user shuts the browser, or could this result in the machine growing
    slower over time and ultimately needing to be shut down?

    The reason I ask these questions is, they end up shutting down the server at
    least once every two days because the sites lock up and nothing works
    properly. Something is gradually causing it to go down. It isn't really my
    place to say anything, but if I could offer some suggestions to them, it'd
    be worthwhile to me. Any thoughts?

    Thanks,
    James
     
    James Baker, Jul 13, 2004
    #1
    1. Advertising

  2. James Baker

    Mark Schupp Guest

    Session variables use server memory so they will affect the scalability of
    the site. If the site is only moderately loaded then session variables
    should not be causing the problem. However, if a session variable is not
    "necessary" then it should not be created. Heavily loaded sites may need to
    take measures to eliminate all session variables through the use of cookies
    and/or databases.

    Unclosed connections are "supposed" to be closed when the variable
    containing them goes out of scope. They are often associated with
    performance problems and server-hangs. My rule is that "If you open it,
    close it. If you create it, delete it".

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "James Baker" <> wrote in message
    news:...
    > I recently started working for a company and I'm obviously working with

    some
    > existing pages. I've noticed that a few things that concern me, but I'm

    not
    > necessarily sure of the implications.
    >
    > 1.) They use Session variables for almost everything. Some are never

    even
    > used, others could be handled in more efficient ways. They don't use them
    > for objects, just for a *ton* of variables. Will this present a problem?
    >
    > 2.) Connections aren't closed. There are several pages that have
    > connections that never end up closing. Are these connections released

    when
    > the end user shuts the browser, or could this result in the machine

    growing
    > slower over time and ultimately needing to be shut down?
    >
    > The reason I ask these questions is, they end up shutting down the server

    at
    > least once every two days because the sites lock up and nothing works
    > properly. Something is gradually causing it to go down. It isn't really

    my
    > place to say anything, but if I could offer some suggestions to them, it'd
    > be worthwhile to me. Any thoughts?
    >
    > Thanks,
    > James
    >
    >
     
    Mark Schupp, Jul 13, 2004
    #2
    1. Advertising

  3. James Baker

    Jeff Cochran Guest

    On Tue, 13 Jul 2004 15:33:18 -0400, "James Baker"
    <> wrote:

    >I recently started working for a company and I'm obviously working with some
    >existing pages. I've noticed that a few things that concern me, but I'm not
    >necessarily sure of the implications.
    >
    >1.) They use Session variables for almost everything. Some are never even
    >used, others could be handled in more efficient ways. They don't use them
    >for objects, just for a *ton* of variables. Will this present a problem?


    Maybe. Maybe not. I can't see the code or the system from my desk.
    Have they ever caused a problem? Did you ask why things are the way
    they are?

    >2.) Connections aren't closed. There are several pages that have
    >connections that never end up closing. Are these connections released when
    >the end user shuts the browser, or could this result in the machine growing
    >slower over time and ultimately needing to be shut down?


    Released on a number of occasions, session ending, timeouts, etc. But
    should always be closed.

    >The reason I ask these questions is, they end up shutting down the server at
    >least once every two days because the sites lock up and nothing works
    >properly. Something is gradually causing it to go down. It isn't really my
    >place to say anything, but if I could offer some suggestions to them, it'd
    >be worthwhile to me. Any thoughts?


    The items you mention may have nothing to do with the server locking
    up, and there are many possibilities that you haven't mentioned.
    Without a lot more detail, we can't diagnose their problems. Nor
    probably is it our responsibility unless they ask.

    Jeff
     
    Jeff Cochran, Jul 13, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vipindeep
    Replies:
    1
    Views:
    413
    Rogue Chameleon
    Oct 22, 2004
  2. Replies:
    0
    Views:
    899
  3. Eric Anderson

    Bad Transform or Bad Engine?

    Eric Anderson, Oct 4, 2005, in forum: XML
    Replies:
    1
    Views:
    380
    Peter Flynn
    Oct 5, 2005
  4. vipindeep
    Replies:
    1
    Views:
    411
    Victor Bazarov
    Oct 21, 2004
  5. rantingrick
    Replies:
    44
    Views:
    1,248
    Peter Pearson
    Jul 13, 2010
Loading...

Share This Page