SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 multiple spids for same user
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

lauramayer
Posting Yak Master

USA
152 Posts

Posted - 05/06/2004 :  09:32:14  Show Profile  Reply with Quote
Good morning,

This is a design/performance question. We have an application that was created in house that for each time a user references a program up to 10 spids are created. Sometimes more. They are all sleeping, there are no open transactions, most of them are awaiting command and the wait type is not waiting. They are all using some CPU not a great deal mind you. My question is does something like this hinder performance? At any one time there are over 1000 spids created. I think it does. The developer wants proof. Anyone have any thoughts?

Thanks

Laura

tkizer
Almighty SQL Goddess

USA
35020 Posts

Posted - 05/06/2004 :  12:57:56  Show Profile  Visit tkizer's Homepage  Reply with Quote
At some point, yes it would hinder performance. Each spid uses approximately 12KB of memory on the database server. But even a thousand spids isn't a lot of memory. Why does each user need a bunch of spids? What is the developers reason for doing this?

Tara
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

USA
4184 Posts

Posted - 05/06/2004 :  14:34:06  Show Profile  Visit derrickleggett's Homepage  Send derrickleggett an AOL message  Send derrickleggett a Yahoo! Message  Reply with Quote
It sounds like he's not using connection pooling correctly, which is a much bigger issue??? Does each user also have their own User Connection into the database?

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
35020 Posts

Posted - 05/06/2004 :  14:39:59  Show Profile  Visit tkizer's Homepage  Reply with Quote
Each spid actually consumes 12 KB + (3 * Network Packet Size). The default network packet size is 4KB. So 24KB. Although in another section in BOL, it says each takes approximately 40KB.

Tara
Go to Top of Page

lauramayer
Posting Yak Master

USA
152 Posts

Posted - 05/07/2004 :  12:22:03  Show Profile  Reply with Quote
Tara--I'm not really sure, he told me that's the only way you can do it. Which I doubt.

Derrick-- Yes, each user has there own connection.

Thanks for all the help at least I have something tangible to tell him.

Thanks again

Laura
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
35020 Posts

Posted - 05/07/2004 :  12:24:00  Show Profile  Visit tkizer's Homepage  Reply with Quote
The developer needs to look into connection pooling.

Tara
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

USA
4184 Posts

Posted - 05/07/2004 :  12:32:39  Show Profile  Visit derrickleggett's Homepage  Send derrickleggett an AOL message  Send derrickleggett a Yahoo! Message  Reply with Quote
Yeah, each user having his own connection would be really bad in a high transaction, multi-user database. And, it's not the only way to do it. Tell him to look up data connections on the internet or buy a book. :)




MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

nr
SQLTeam MVY

United Kingdom
12543 Posts

Posted - 05/07/2004 :  20:26:49  Show Profile  Visit nr's Homepage  Reply with Quote
Creating 10 connections just sounds like bad coding. Connection pooling isn't going to help as the connections are being held open.
You need to look at the design of the app.

It probably won't have a lot of affect on the server but will make any diagnosis of problems a lot more difficult due to the number of spids that you will have to look through.

The app should try to use a single connection. Sounds like it is client - server so it's ok to maintain the connection. You will be able to see from the server the last time the connection did anything so will know if it's active or not.
Would be better if the app disconnected after a period of inactivity though.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

lauramayer
Posting Yak Master

USA
152 Posts

Posted - 05/10/2004 :  07:48:53  Show Profile  Reply with Quote
Morning,

I have another piece related or not I don't know. I ran sp_lock and have almost all locks at the database level, table or extant level. Mostly database though. Could this also be affecting performance?

Thanks

Laura
Go to Top of Page

shenkev
Starting Member

1 Posts

Posted - 06/04/2004 :  12:40:13  Show Profile  Reply with Quote
Hi Lura,

I'm very interesting in your question as I have the same. Have you find out the reason each user open more than one SPID? Is there a way that you connect to SQL with single SPID and stay with it all the time?

Thanks,

Kevin

quote:
Originally posted by lauramayer

Good morning,

This is a design/performance question. We have an application that was created in house that for each time a user references a program up to 10 spids are created. Sometimes more. They are all sleeping, there are no open transactions, most of them are awaiting command and the wait type is not waiting. They are all using some CPU not a great deal mind you. My question is does something like this hinder performance? At any one time there are over 1000 spids created. I think it does. The developer wants proof. Anyone have any thoughts?

Thanks

Laura


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000