Sunday, March 25, 2012
32000 User Connections (According to Performance Monitor)
I am dealing with a quite big application written in ASP communicating
directly with the database. The problem is that there is performance
problems with the DB and after investigating things a bit more I have
found that the number of User Connection are over 32000 according to
the Performance Monitor.
Yes, it would be better too have a 3-tier architecture but I am stuck
with what I have and have to do the best of the situation. I have gone
through every page to make sure that the ADO connection is closed and
that the connection object is set to nothing. I have also tried to
change the MAX Pool Size from everything from 50 upp to 500 and
Connection Lifetime I have set to 10. My conclusion is that I am
dealing with a leak somewhere (but I can not find it). My question is,
is there a way in SQL Server to clean up un-used user connection - let
them time out by them self.
Any suggestions? Anybody encountered anything similar? All ideas and
comments are welcomed.You could create a job that took the data from sp_who2 and compared the time
now to the LastBatch column. If they exceed your threshold disconnect them
with the KILL command.
Ensure your application can handle this and exit gracefully.
HTH. Ryan
<mathias_pettersson@.hotmail.com> wrote in message
news:1137510134.733734.249390@.g49g2000cwa.googlegroups.com...
> Hello,
> I am dealing with a quite big application written in ASP communicating
> directly with the database. The problem is that there is performance
> problems with the DB and after investigating things a bit more I have
> found that the number of User Connection are over 32000 according to
> the Performance Monitor.
> Yes, it would be better too have a 3-tier architecture but I am stuck
> with what I have and have to do the best of the situation. I have gone
> through every page to make sure that the ADO connection is closed and
> that the connection object is set to nothing. I have also tried to
> change the MAX Pool Size from everything from 50 upp to 500 and
> Connection Lifetime I have set to 10. My conclusion is that I am
> dealing with a leak somewhere (but I can not find it). My question is,
> is there a way in SQL Server to clean up un-used user connection - let
> them time out by them self.
> Any suggestions? Anybody encountered anything similar? All ideas and
> comments are welcomed.
>|||Just out of interest how much memory does your server have..?
Each connection takes around 24KB, you've got 24Kb * 320000 which is about
750Mb gone from SQL Server.
HTH. Ryan
"Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
news:uoYfth3GGHA.1032@.TK2MSFTNGP11.phx.gbl...
> You could create a job that took the data from sp_who2 and compared the
> time
> now to the LastBatch column. If they exceed your threshold disconnect them
> with the KILL command.
> Ensure your application can handle this and exit gracefully.
> --
> HTH. Ryan
> <mathias_pettersson@.hotmail.com> wrote in message
> news:1137510134.733734.249390@.g49g2000cwa.googlegroups.com...
>|||The server has 1GB of RAM and dual 2.4Ghz processors
32000 User Connections (According to Performance Monitor)
I am dealing with a quite big application written in ASP communicating
directly with the database. The problem is that there is performance
problems with the DB and after investigating things a bit more I have
found that the number of User Connection are over 32000 according to
the Performance Monitor.
Yes, it would be better too have a 3-tier architecture but I am stuck
with what I have and have to do the best of the situation. I have gone
through every page to make sure that the ADO connection is closed and
that the connection object is set to nothing. I have also tried to
change the MAX Pool Size from everything from 50 upp to 500 and
Connection Lifetime I have set to 10. My conclusion is that I am
dealing with a leak somewhere (but I can not find it). My question is,
is there a way in SQL Server to clean up un-used user connection - let
them time out by them self.
Any suggestions? Anybody encountered anything similar? All ideas and
comments are welcomed.
You could create a job that took the data from sp_who2 and compared the time
now to the LastBatch column. If they exceed your threshold disconnect them
with the KILL command.
Ensure your application can handle this and exit gracefully.
HTH. Ryan
<mathias_pettersson@.hotmail.com> wrote in message
news:1137510134.733734.249390@.g49g2000cwa.googlegr oups.com...
> Hello,
> I am dealing with a quite big application written in ASP communicating
> directly with the database. The problem is that there is performance
> problems with the DB and after investigating things a bit more I have
> found that the number of User Connection are over 32000 according to
> the Performance Monitor.
> Yes, it would be better too have a 3-tier architecture but I am stuck
> with what I have and have to do the best of the situation. I have gone
> through every page to make sure that the ADO connection is closed and
> that the connection object is set to nothing. I have also tried to
> change the MAX Pool Size from everything from 50 upp to 500 and
> Connection Lifetime I have set to 10. My conclusion is that I am
> dealing with a leak somewhere (but I can not find it). My question is,
> is there a way in SQL Server to clean up un-used user connection - let
> them time out by them self.
> Any suggestions? Anybody encountered anything similar? All ideas and
> comments are welcomed.
>
|||Just out of interest how much memory does your server have..?
Each connection takes around 24KB, you've got 24Kb * 320000 which is about
750Mb gone from SQL Server.
HTH. Ryan
"Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
news:uoYfth3GGHA.1032@.TK2MSFTNGP11.phx.gbl...
> You could create a job that took the data from sp_who2 and compared the
> time
> now to the LastBatch column. If they exceed your threshold disconnect them
> with the KILL command.
> Ensure your application can handle this and exit gracefully.
> --
> HTH. Ryan
> <mathias_pettersson@.hotmail.com> wrote in message
> news:1137510134.733734.249390@.g49g2000cwa.googlegr oups.com...
>
|||The server has 1GB of RAM and dual 2.4Ghz processors
32000 User Connections (According to Performance Monitor)
I am dealing with a quite big application written in ASP communicating
directly with the database. The problem is that there is performance
problems with the DB and after investigating things a bit more I have
found that the number of User Connection are over 32000 according to
the Performance Monitor.
Yes, it would be better too have a 3-tier architecture but I am stuck
with what I have and have to do the best of the situation. I have gone
through every page to make sure that the ADO connection is closed and
that the connection object is set to nothing. I have also tried to
change the MAX Pool Size from everything from 50 upp to 500 and
Connection Lifetime I have set to 10. My conclusion is that I am
dealing with a leak somewhere (but I can not find it). My question is,
is there a way in SQL Server to clean up un-used user connection - let
them time out by them self.
Any suggestions? Anybody encountered anything similar? All ideas and
comments are welcomed.You could create a job that took the data from sp_who2 and compared the time
now to the LastBatch column. If they exceed your threshold disconnect them
with the KILL command.
Ensure your application can handle this and exit gracefully.
--
HTH. Ryan
<mathias_pettersson@.hotmail.com> wrote in message
news:1137510134.733734.249390@.g49g2000cwa.googlegroups.com...
> Hello,
> I am dealing with a quite big application written in ASP communicating
> directly with the database. The problem is that there is performance
> problems with the DB and after investigating things a bit more I have
> found that the number of User Connection are over 32000 according to
> the Performance Monitor.
> Yes, it would be better too have a 3-tier architecture but I am stuck
> with what I have and have to do the best of the situation. I have gone
> through every page to make sure that the ADO connection is closed and
> that the connection object is set to nothing. I have also tried to
> change the MAX Pool Size from everything from 50 upp to 500 and
> Connection Lifetime I have set to 10. My conclusion is that I am
> dealing with a leak somewhere (but I can not find it). My question is,
> is there a way in SQL Server to clean up un-used user connection - let
> them time out by them self.
> Any suggestions? Anybody encountered anything similar? All ideas and
> comments are welcomed.
>|||Just out of interest how much memory does your server have..?
Each connection takes around 24KB, you've got 24Kb * 320000 which is about
750Mb gone from SQL Server.
--
HTH. Ryan
"Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
news:uoYfth3GGHA.1032@.TK2MSFTNGP11.phx.gbl...
> You could create a job that took the data from sp_who2 and compared the
> time
> now to the LastBatch column. If they exceed your threshold disconnect them
> with the KILL command.
> Ensure your application can handle this and exit gracefully.
> --
> HTH. Ryan
> <mathias_pettersson@.hotmail.com> wrote in message
> news:1137510134.733734.249390@.g49g2000cwa.googlegroups.com...
>> Hello,
>> I am dealing with a quite big application written in ASP communicating
>> directly with the database. The problem is that there is performance
>> problems with the DB and after investigating things a bit more I have
>> found that the number of User Connection are over 32000 according to
>> the Performance Monitor.
>> Yes, it would be better too have a 3-tier architecture but I am stuck
>> with what I have and have to do the best of the situation. I have gone
>> through every page to make sure that the ADO connection is closed and
>> that the connection object is set to nothing. I have also tried to
>> change the MAX Pool Size from everything from 50 upp to 500 and
>> Connection Lifetime I have set to 10. My conclusion is that I am
>> dealing with a leak somewhere (but I can not find it). My question is,
>> is there a way in SQL Server to clean up un-used user connection - let
>> them time out by them self.
>> Any suggestions? Anybody encountered anything similar? All ideas and
>> comments are welcomed.
>|||The server has 1GB of RAM and dual 2.4Ghz processorssql
Tuesday, March 6, 2012
2005: using SMO
I am learning SQL Server 2005. I would like to write a procedure
making database backup using SMO. According to my book I should write
such code:
using Microsoft.SqlServer.Management.SMO;
public static void MakeBackup()
{
Server server = new Server("localhost");
Backup backup = new Backup();
backup.Action = BackupActionType.Database;
backup.BackupSetName = "Backup copy";
backup.BackupSetDescription = "Backup copy";
backup.Database = "DemoSQLServer";
backup.Devices.AddDevice("C:\\DemoSQLServer.bak",
DeviceType.File);
backup.SqlBackup(server);
}
The code cannot be compiled because of error:
The type or namespace name 'Management' does not exist in the
namespace 'Microsoft.SqlServer'.
Please help to correct the problem - I cannot find proper name of SMO
namespace. Is the code OK?
Thank you very much
/RAM/I tried adding references to Microsoft.SqlServer.ConnectionInfo and
Microsoft.SqlServer.Smo - and I could build assembly. But then I
cannot create assembly in SQL Server:
"An exception occured while executing a Transact statement or batch
(Microsoft.SqlServer.Express.ConnectionInfo).
Assembly 'microsoft.sqlserver.smo, version=9.0.242.0, culture=neutral,
publictoken=89845dcd8080cc91.' was not found in the SQL catalog.
(Microsoft SQL Server, Error: 6503)"
Could you help me to solve it...|||R.A.M. (r_ahimsa_m@.poczta.onet.pl) writes:
Quote:
Originally Posted by
I tried adding references to Microsoft.SqlServer.ConnectionInfo and
Microsoft.SqlServer.Smo - and I could build assembly. But then I
cannot create assembly in SQL Server:
>
"An exception occured while executing a Transact statement or batch
(Microsoft.SqlServer.Express.ConnectionInfo).
Assembly 'microsoft.sqlserver.smo, version=9.0.242.0, culture=neutral,
publictoken=89845dcd8080cc91.' was not found in the SQL catalog.
(Microsoft SQL Server, Error: 6503)"
>
Could you help me to solve it...
There is a smaller set of .Net Fx assemblies that are loaded by default
in SQL Server. Apparently Microsoft.SqlServer.Smo is not one of them.
You could create an assembly in your database for the DLL with CREATE
ASSEMBLY, but I suspect that there is a reason why this DLL is not
loaded. I don't think the intention is that SMO is to be called from
within SQL Server. (But I have stayed away from SMO, so I don't really
know for sure.)
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
2005: Business Intelligence Development Studio?
I am learning SQLServer 2005 Express Edition. I wanted to learn Report
Designer which - according to my tutorial book - is part of Business
Intelligence Development Studio. I can't find it in Internet. Could
you help me plase?
Thank you very much!
/RAM/It only comes with Express Advanced Services and not Express, they are both
free.
--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"R.A.M." <r_ahimsa_m@.poczta.onet.plwrote in message
news:p2f6b2d20jnmn9mfdvsh8504p5d4aml0s0@.4ax.com...
Quote:
Originally Posted by
Hello,
I am learning SQLServer 2005 Express Edition. I wanted to learn Report
Designer which - according to my tutorial book - is part of Business
Intelligence Development Studio. I can't find it in Internet. Could
you help me plase?
Thank you very much!
/RAM/
>
<tonyrogerson@.sqlserverfaq.comwrote:
Quote:
Originally Posted by
>It only comes with Express Advanced Services and not Express, they are both
>free.
I have just installed Express Edition Advanced Services. I see no
Business Intelligence application. What should I do?
Please help.
/RAM/|||I have installed also SQLEXPR_TOOLKIT.EXE. Now I see "SQL Server
Business Intelligence Development Studio" in the Start menu with a
link to "C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\devenv.exe" - but I do not have such file. What should I
do? Please help
/RAM/
2005: BACKUP
I am learning SQL Server 2005. I need to know how to make a backup of
a database. I tried (according to my book):
BACKUP DATABASE DemoSQLServer TO DISK = "G:\DemoSQLServer.bak"
But I got error:
Incorrect syntax near 'G:\DemoSQLServer.bak'.
Please help.
Thank you very much.
/RAM/RAM (r_ahimsa_m@.poczta.onet.pl) writes:
Quote:
Originally Posted by
I am learning SQL Server 2005. I need to know how to make a backup of
a database. I tried (according to my book):
BACKUP DATABASE DemoSQLServer TO DISK = "G:\DemoSQLServer.bak"
But I got error:
Incorrect syntax near 'G:\DemoSQLServer.bak'.
Please help.
If the book fails, try Books Online.
Generally, in T-SQL, single quote is used as the string delimiter. (Although
it is possible with a legacy setting in force also use double quote as
string delimiter, but this is not recommended.)
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||The error is the double quotes! You need to use single quotes to
specify the filename. The statement should be rewritten as:
BACKUP DATABASE DemoSQLServer TO DISK = 'G:\DemoSQLServer.bak'
N.I.T.I.N.
RAM wrote:
Quote:
Originally Posted by
Hello,
I am learning SQL Server 2005. I need to know how to make a backup of
a database. I tried (according to my book):
BACKUP DATABASE DemoSQLServer TO DISK = "G:\DemoSQLServer.bak"
But I got error:
Incorrect syntax near 'G:\DemoSQLServer.bak'.
Please help.
Thank you very much.
/RAM/
wrote:
Quote:
Originally Posted by
>The error is the double quotes! You need to use single quotes to
>specify the filename. The statement should be rewritten as:
>BACKUP DATABASE DemoSQLServer TO DISK = 'G:\DemoSQLServer.bak'
Thanks,
but I have another problem:
Cannot open backup device 'G:\DemoSQLServer.bak'. Operating system
error 5(Access denied.).
(Changing drive don't help.)
I have no problem with accessing drives from other applications. I had
no problems with SQL Server setup.
Please help.
/RAM/|||"RAM" <r_ahimsa_m@.poczta.onet.plwrote in message
news:6lkec292thjpbhkm7b2h03unpeg045jhp2@.4ax.com...
Quote:
Originally Posted by
On 25 Jul 2006 00:24:24 -0700, "NiTiN" <emailme.nitin@.gmail.com>
wrote:
>
Quote:
Originally Posted by
The error is the double quotes! You need to use single quotes to
specify the filename. The statement should be rewritten as:
BACKUP DATABASE DemoSQLServer TO DISK = 'G:\DemoSQLServer.bak'
>
Thanks,
but I have another problem:
Cannot open backup device 'G:\DemoSQLServer.bak'. Operating system
error 5(Access denied.).
>
(Changing drive don't help.)
I have no problem with accessing drives from other applications. I had
no problems with SQL Server setup.
SQL Server itself for some reason doesn't have access to this drive.
If it's local, check permissions.
If it's remote, change it to a UNC path and make sure the user has domain
priviliges.
Quote:
Originally Posted by
>
Please help.
/RAM/
>
Quote:
Originally Posted by
Cannot open backup device 'G:\DemoSQLServer.bak'. Operating system
error 5(Access denied.).
>
(Changing drive don't help.)
Hi!
My guess is that you need to grant filesystem privileges to the account
that SQL Server runs as. That account is usually sysopr.
N.I.T.I.N.|||>My guess is that you need to grant filesystem privileges to the account
Quote:
Originally Posted by
>that SQL Server runs as. That account is usually sysopr.
I have little experience with Microsoft software...
On my Windows XP computer I have two accounts Robert (admin) and
Guest. I have installed SQL Server 2005 on Robert's account. I haven't
found information about sysopr in BOL nor Internet. Could you help me
please?
/RAM/|||A few months ago I could create backup using right-click menu, now I
cannot. What's going on?
/RAM/|||RAM (r_ahimsa_m@.poczta.onet.pl) writes:
Quote:
Originally Posted by
but I have another problem:
Cannot open backup device 'G:\DemoSQLServer.bak'. Operating system
error 5(Access denied.).
>
(Changing drive don't help.)
I have no problem with accessing drives from other applications. I had
no problems with SQL Server setup.
Is that a local drive or a network drive?
Presumably the service account for SQL Server does not have access to
this place. Keep in mind that SQL Server is a server application that
logs on its own.
Start SQL Server Configuraiton Manager. Select "SQL Server 2005 Services".
Find the SQL Server service you have problem with. Double-click. Here
you can see under which account SQL Server runs. If you change, you will
have to restart SQL Server.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx