Bad practices

J

James Baker

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
 
M

Mark Schupp

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".
 
J

Jeff Cochran

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top