473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Bad practices

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
Jul 19 '05 #1
3 1191
>1.) They use Session variables for almost everything.

Perhaps an inefficient use of memory, and might cause degradation of
performance, but shouldn't be equated with a memory leak. Each Session will
timeout eventually (depending on the default and/or timeout set in the script).
When the session is cleared, all session variables become eligible for garbage
collection.
2.) Connections aren't closed.


If the Connection is established within the a page variable, then the
connection is automatically closed when the page completes (another form of
garbage collection). However, the engine does use some connection sharing
arrangement, so the question is a bit more involved. A single connection may
remain opened in order to service other sessions as requested,

In any case, these two items may increase resource usage, but unless the server
software itself is buggered, they shouldn't cause that sort of symptoms. But
then, stranger things have happend.
Jul 19 '05 #2
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" <cp******@hotmail.com> wrote in message
news:OQ*************@tk2msftngp13.phx.gbl...
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

Jul 19 '05 #3
On Tue, 13 Jul 2004 15:33:18 -0400, "James Baker"
<cp******@hotmail.com> 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
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: byrocat | last post by:
I'm chasing after a documetn that was available on one of the Microsoft websites that was titled somethign like "MS SQL Server Best Practices" and detailed a nyumber of best practices about...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
13
by: john doe | last post by:
A quick question, about so-called 'best practices', I'm interested in which of A/B of the two examples people would choose, and why. public enum MyEnum { Option1 = 0, Option2 = 1, Option3 =...
2
by: Amelyan | last post by:
Could anyone recommend a book (or a web site) that defines best practices in ASP.NET application development? E.g. 1) Precede your control id's with type of control btnSubmit, txtName, etc. 2)...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
2
by: js | last post by:
I got this error when I moved my application to a new Windows 2003 server. I installed and recompiled the 'Microsoft.Practices.EnterpriseLibrary - June 2005" then added these assemblies to the...
0
by: job | last post by:
Mohamed Sharaf's has produced a Microsoft.Practices.EnterpriseLibrary production server installer: https://blogs.msdn.com/mohamed_sharafs_blog/archive/2005/09/18/470854.aspx Running the...
1
by: Pablo | last post by:
Hello all, Hope today finds you well. I'm looking to take my knowledge of best practices within the development lifecycle to the next level. Basically I want to follow industry recognised,...
3
by: John Dalberg | last post by:
I am looking for an ASP.NET application on CodePlex which exemplifies best practices for the following: - Use of interfaces - Seperation of the UI, business and data tiers - Data Tier that uses...
5
by: =?Utf-8?B?TWljaGFlbFF1aW5sYW4=?= | last post by:
In my development environment I can add references to the Microsoft Practices libraries and everything works ok. But when I copy the application to the test server I get the message "CS0234: The...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.