Showing posts with label connections. Show all posts
Showing posts with label connections. Show all posts

Monday, March 19, 2012

Maximum user connections?

Newbie here.

I've got my database set up in SQL 2000, and have started an Access adp
for a front end. I have 10 licenses, and at the moment the only
accesses are the server through Remote Desktop and one person into the
ADP. I started getting ODBC timeout errors when running a complex
query, so I started poking around. In the logs there's messages saying
the maximum of 10 user connections has been reached, over and over
again. I'm not even certain that these problems are related, but it
doesn't look good.

Why are all 10 connections used when there's only the server and one
client? No one else has access to this server. And how can I stop the
ODBC timeout? That paticular complex query is the whole jsutification
for using SQL over Access, so I kind of need it to work. :)
Thanks in advance, maddman"Maddman" <maddman_75@.yahoo.com> wrote in message
news:1104864763.826733.217190@.f14g2000cwb.googlegr oups.com...
> Newbie here.
> I've got my database set up in SQL 2000, and have started an Access adp
> for a front end. I have 10 licenses, and at the moment the only
> accesses are the server through Remote Desktop and one person into the
> ADP. I started getting ODBC timeout errors when running a complex
> query, so I started poking around. In the logs there's messages saying
> the maximum of 10 user connections has been reached, over and over
> again. I'm not even certain that these problems are related, but it
> doesn't look good.
> Why are all 10 connections used when there's only the server and one
> client? No one else has access to this server. And how can I stop the
> ODBC timeout? That paticular complex query is the whole jsutification
> for using SQL over Access, so I kind of need it to work. :)
> Thanks in advance, maddman

I don't know much about ADPs or ODBC, but you can use sp_who2 to view the
current connections (from Query Analyzer):

exec sp_who2

Note that if you use Query Analyzer for your SQL coding, you may have
multiple connections open - plus another one for the Object Browser - so a
couple of active developers could easily use up the ten connections.

As for the timeout, it may be legitimate if the query runs for more than 30
seconds (which I think is the default for ODBC) - have you run it in Query
Analyzer to see how long it takes? You might also want to check if any
processes are blocking each other (the BlkBy column in the sp_who2 output),
as one connection could time out waiting for another to free a lock.

Simon|||Maddman (maddman_75@.yahoo.com) writes:
> I've got my database set up in SQL 2000, and have started an Access adp
> for a front end. I have 10 licenses, and at the moment the only
> accesses are the server through Remote Desktop and one person into the
> ADP. I started getting ODBC timeout errors when running a complex
> query, so I started poking around. In the logs there's messages saying
> the maximum of 10 user connections has been reached, over and over
> again. I'm not even certain that these problems are related, but it
> doesn't look good.
> Why are all 10 connections used when there's only the server and one
> client? No one else has access to this server. And how can I stop the
> ODBC timeout? That paticular complex query is the whole jsutification
> for using SQL over Access, so I kind of need it to work. :)
> Thanks in advance, maddman

As Simon said, the 10 connections may all come from the same machine.
You can easily have more 10 connections from Access to SQL Server if
you are not careful. sp_who2 as Simon mention should give the origin
of the connections.

It is not likely that the number of connections have anything to do with
the timeout, though.

You say you are using ODBC, but what precisely does this mean? If you
are using ADO, I would suggest that you rip out Driver={SQL Server} from
the connection string and replace it with Provider=SQLOLEDB. Not
that it will resolve the timeout problem, as the 30 seconds default
timeout will be there anyway.

If you are using ADO, set the .CommandTimeout on the Command and Connection
objects to 0, and there will be no more timeouts.

Of course, the query may need tuning as well, for instance adding better
indexes, but that's another story.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Ah, when I said 'query' I should have said 'View'. Can you tell I'm
just coming from Access? :)

Anyway, when I try to run the view by right-clicking and selecting
Return all rows I get the odbc timeout error. This makes no sense to
me, as the tables its looking at are all inside the database, none of
them are going over odbc. I get the same error if I try to view it
from Access. I increased by # of connections to 20, but that didn't
seem to help anything.

Just to be certain, I copied the SELECT statement from the View and ran
it in the Query Analyzer. It ran just fine, took about four minutes to
calculate everything. But I can't get the data as a view for some
reason.|||"Maddman" <maddman_75@.yahoo.com> wrote in message
news:1104937648.507533.88470@.c13g2000cwb.googlegro ups.com...
> Ah, when I said 'query' I should have said 'View'. Can you tell I'm
> just coming from Access? :)
> Anyway, when I try to run the view by right-clicking and selecting
> Return all rows I get the odbc timeout error. This makes no sense to
> me, as the tables its looking at are all inside the database, none of
> them are going over odbc. I get the same error if I try to view it
> from Access. I increased by # of connections to 20, but that didn't
> seem to help anything.
> Just to be certain, I copied the SELECT statement from the View and ran
> it in the Query Analyzer. It ran just fine, took about four minutes to
> calculate everything. But I can't get the data as a view for some
> reason.

4 minutes doesn't strike me as being an acceptable response time.
Perhaps you want to think about de-normalising and doing the calculations
you intimate in triggers...
Or some such.

As people have mentioned, you can clock up a number of connections from the
one access adp.
Perhaps the techniques used or number of licences need to be reconsidered as
well.
More licenses might be cheaper than a complete rewrite.

--
Regards,
Andy O'Neill|||Maddman (maddman_75@.yahoo.com) writes:
> Anyway, when I try to run the view by right-clicking and selecting
> Return all rows I get the odbc timeout error. This makes no sense to
> me, as the tables its looking at are all inside the database, none of
> them are going over odbc. I get the same error if I try to view it
> from Access. I increased by # of connections to 20, but that didn't
> seem to help anything.

I don't know what you mean here when you say that nothing goes over ODBC.
If that means that you are querying table in Access, you need to go to
an Access forum. If the tables really are in SQL Server, yes, then you
are going over ODBC (or OLE DB, depending on which client library you
are using). SQL Server is, just that, a server, and all communication
are through some sort of network connection.

> Just to be certain, I copied the SELECT statement from the View and ran
> it in the Query Analyzer. It ran just fine, took about four minutes to
> calculate everything. But I can't get the data as a view for some
> reason.

If it takes four minutes to run the query from Query Analyzer, and
the default timeout in Access is 30 seconds, guess what happens when
you submit the query from Access?

It appears that you need to increase the timeout. The number of
connections has not anything to do with it.

Now, how you increase the timeout in Access, is definitely a question for
an Access newsgroup. I left a hint in my previous post, but it appears
that you have some view in Access, and it should be clear by now, that
my knowledge of Access is non-existent.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||I understand the ODBC timeout when going through access. But when I go
to the View I have set up with this SELECT query, I get the same ODBC
timeout manager. Does it use ODBC to communicate within the components
of the Enterprise Manager?|||I took a look at the structure of the queries. What I've got here is
several views that add up bits of data per ID Code, then a final view
that summarized all of them together. I moved around when some of the
calculations are made and that took care of the problem. Went from 4
minutes to about 10 seconds.

Thanks guys!|||Maddman (maddman_75@.yahoo.com) writes:
> I understand the ODBC timeout when going through access. But when I go
> to the View I have set up with this SELECT query, I get the same ODBC
> timeout manager. Does it use ODBC to communicate within the components
> of the Enterprise Manager?

Eh? I'm sorry you have almost lost me completely.

But if you talk about retrieving the result from view in Enterprise
Manager, yes, you could get an ODBC timeout. Enterprise Manager is a
client, just like Access.

You could get an ODBC timeout in Query Analyzer as well. The difference
is that ODBC has a default timeout of 0, but you can configure one if
you like.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Friday, March 9, 2012

Maximum number of connections

Hi,

Could somebody tell what is the maximum number of concurrent connections that are supported in sql server 2005 developer edition?

thanks

SQL Server allowed 32767 connections per instance in SQL 2000. I don′t think they lowered it down. With 16 instances you could theoretically come up to 524272 connections (which is sort of unbelievable). I don′t know if your question has only an academic flavour or how many can be instantiated in the real world.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

Thanks jens but i'm talking with reference to the information posted here : http://channel9.msdn.com/ShowPost.aspx?PostID=173513

i'm pasting the relevant excerpts below.i'm only concerned with the information in red.

============================================================

Tyler Brown
Bullets change governments far surer than votes.

Mon, Mar 20 2006 4:55 PM

I'm not sure about the Express edition, but from what I understand, the Developer Edition is a full featured edition with minimal CAL's. It's meant for use in a development environment, and not a production environment, so it restricts the number of connections.

ben2004uk

Mon, Mar 20 2006 5:05 PM

AFAIK (Don't quote me) the Express has a connection limit of 25 and is designed for low-end apps / websites.

irascian
Irascible Ian

Mon, Mar 20 2006 5:42 PM

The others have answered it really. "Express" is the free lightweight version. "Developer" is the full Enterprise version with all the bells and whistles for developers to work against but limited in terms of CALs.

Ordinarily if you can get hold of it Developer Edition is the version to install, with one exception: Team Foundation Server doesn't support it and you need the Standard, Professional or Enterprise edition for that.
========================================================

Now my problem :

1) "Developer Edition is a full featured edition with minimal CAL's."

what is this minimal CAL?

2) "Express has a connection limit of 25 "

what is the connection limit for the developer edition?

Looking forward to ur reply

thanks

|||

Hi,

I don′t know about any limitation in Developer Edition, though its full featured. SQL Expresses only limitation are written in here:

http://msdn2.microsoft.com/en-us/library/ms165672.aspx

Keep in mind that the query governour has been removed, so the limitation of the MSDE is no longer valid.

HTH, Jens Suessmeyer.

http://msdn2.microsoft.com/en-us/library/ms165672.aspx

Keep in mind that the query governour has been removed, so the limitation of the MSDE is no longer valid.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Wednesday, March 7, 2012

Maximum Databases in ODBC

What is the maximum number of Databases you can have connections to using
ODBC connection to SQL? I am talking hear about the entries in ODBC Data
Sources as System DSN's.
Anyone got any ideas? Assume Windows XP SP2 workstation and Windows 20003
server with MS SQL 2000 SP4.
In fact is there any limit to the number of MSSQL databases you can have on
one server. I know its a bit like how longs a piece of string, but lets
assume as an average that each database is about 20Mb in size and has about
100 tables.
Hi
Maximum number of databases per SQL Server instance: 32'767.
As to ODBC Data Sources, well since ODBC is nearing end of life I don't
think anyone is interested anymore. I could imagine that one of the 16 bit
number limits could be hit (256, 1024 or 32'737).
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Rowland Costin" <technical@.selven.co.uk> wrote in message
news:%23TMk65EwFHA.1148@.TK2MSFTNGP11.phx.gbl...
> What is the maximum number of Databases you can have connections to using
> ODBC connection to SQL? I am talking hear about the entries in ODBC Data
> Sources as System DSN's.
> Anyone got any ideas? Assume Windows XP SP2 workstation and Windows 20003
> server with MS SQL 2000 SP4.
> In fact is there any limit to the number of MSSQL databases you can have
> on one server. I know its a bit like how longs a piece of string, but lets
> assume as an average that each database is about 20Mb in size and has
> about 100 tables.
>
|||What is replacing ODBC?
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:OSaSXGIwFHA.3548@.tk2msftngp13.phx.gbl...
> Hi
> Maximum number of databases per SQL Server instance: 32'767.
> As to ODBC Data Sources, well since ODBC is nearing end of life I don't
> think anyone is interested anymore. I could imagine that one of the 16 bit
> number limits could be hit (256, 1024 or 32'737).
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Rowland Costin" <technical@.selven.co.uk> wrote in message
> news:%23TMk65EwFHA.1148@.TK2MSFTNGP11.phx.gbl...
>
|||Hi,
OLE DB. It's not really a "replacement" for ODBC but a newer technology.
Cindy Winegarden MCSD, Microsoft Most Valuable Professional
cindy_winegarden@.msn.com www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden
"Preacher Man" <nospam> wrote in message
news:OebocSIwFHA.3720@.TK2MSFTNGP14.phx.gbl...
> What is replacing ODBC?
[vbcol=seagreen]

Maximum Databases in ODBC

What is the maximum number of Databases you can have connections to using
ODBC connection to SQL? I am talking hear about the entries in ODBC Data
Sources as System DSN's.
Anyone got any ideas? Assume Windows XP SP2 workstation and Windows 20003
server with MS SQL 2000 SP4.
In fact is there any limit to the number of MSSQL databases you can have on
one server. I know its a bit like how longs a piece of string, but lets
assume as an average that each database is about 20Mb in size and has about
100 tables.Hi
Maximum number of databases per SQL Server instance: 32'767.
As to ODBC Data Sources, well since ODBC is nearing end of life I don't
think anyone is interested anymore. I could imagine that one of the 16 bit
number limits could be hit (256, 1024 or 32'737).
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Rowland Costin" <technical@.selven.co.uk> wrote in message
news:%23TMk65EwFHA.1148@.TK2MSFTNGP11.phx.gbl...
> What is the maximum number of Databases you can have connections to using
> ODBC connection to SQL? I am talking hear about the entries in ODBC Data
> Sources as System DSN's.
> Anyone got any ideas? Assume Windows XP SP2 workstation and Windows 20003
> server with MS SQL 2000 SP4.
> In fact is there any limit to the number of MSSQL databases you can have
> on one server. I know its a bit like how longs a piece of string, but lets
> assume as an average that each database is about 20Mb in size and has
> about 100 tables.
>|||What is replacing ODBC?
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:OSaSXGIwFHA.3548@.tk2msftngp13.phx.gbl...
> Hi
> Maximum number of databases per SQL Server instance: 32'767.
> As to ODBC Data Sources, well since ODBC is nearing end of life I don't
> think anyone is interested anymore. I could imagine that one of the 16 bit
> number limits could be hit (256, 1024 or 32'737).
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Rowland Costin" <technical@.selven.co.uk> wrote in message
> news:%23TMk65EwFHA.1148@.TK2MSFTNGP11.phx.gbl...
>|||Hi,
OLE DB. It's not really a "replacement" for ODBC but a newer technology.
Cindy Winegarden MCSD, Microsoft Most Valuable Professional
cindy_winegarden@.msn.com www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden
"Preacher Man" <nospam> wrote in message
news:OebocSIwFHA.3720@.TK2MSFTNGP14.phx.gbl...
> What is replacing ODBC?
[vbcol=seagreen]

maximum Data flow tasks execution

Hi guys,

i got a foreach loop that has about 20 data flow tasks(same database connections but different extractions) but i notice that when i execute the project it only runs 4 data flow tasks at a time.

i know that there is an option for each data flow to set the "Engine Threads", but is there a way to set the thereads in a foreach loop or for the whole project so it will execute all data flow tasks in one go for each loop.

please help?

Here is a interesting document that talks about: Integration Services: Performance Tuning Techniques that may be helpful to understand how to get better performance.

http://www.microsoft.com/technet/prodtechnol/sql/2005/ssisperf.mspx

BTW what kind of hardaware do you have? wanting to run 20 data flow tasks in parallel sounds somehow unrealistic to me.

Rafael Salas

|||

Thanks for the post Rafael,

hmm, it wasn't exactly what i was looking for but it certainly gave me a good knowledge SSIS performance tuning.

the examplease that they had they were all in side data flows tasks, my problem sort of lies outside, inside a foreach loop. why it's only running 4 tasks at a time, there must be a counter somewhere.

but your link sort of gave me an idea of doing the extraction in another way. but it's going to be a lot of work, since i've already made my project.

you see what i'm doing is, i'm doing an overnight extract from the main datasbase to my data warehouse, has 20 scripts (all different sources and different destination). the reason it's inside a forloop is i've got many database sources that uses the same scripts to extract data.

the destination sql server is pretty good (SSIS runs on). it's a XEON 2 CPUs with 4gb RAM. resources is not an issue, well at least i think it's not. even if it's not enough i can get more CPUs and RAM to it, to get the job done faster.

cheers

AJ

Maximum connections for SQL 2000 Developer Edition

I can't seem to find this info online anywhere. What's
the maximum connections for SQL 2000 Developer Edition?
We have a server running several instances of Developer
edition so does they have the share these connections or
is it a max connections per instance?
Thanks,
Van
Hi
Technically 32 737 per instance, but you will run out of TCP ports long
before a multi-instance installation can max out.
Developer Edition is Enterprise Edition with licensing limitations.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Van Jones" <anonymous@.discussions.microsoft.com> wrote in message
news:129201c55266$1fbd2b00$a601280a@.phx.gbl...
>I can't seem to find this info online anywhere. What's
> the maximum connections for SQL 2000 Developer Edition?
> We have a server running several instances of Developer
> edition so does they have the share these connections or
> is it a max connections per instance?
> Thanks,
> Van

Monday, February 20, 2012

Max Worker Threads and User Connections

Hi

we run SQL 2005 Enterprise on W2003 Enterprise 32 bit on 8 dual core Xeon 7020 with 32Gb RAM.

The max worker thread settings is 0 now. But 3d party consultancy which monitors our servers on the POP is suggesting to make this figure to be 1200. They said - there are 1000 connections at peak time. I am going to check if it is correct...

But my question is - is it proper thing to do to set worker thread number that high? (BOL says - MS doesnt recommend more than 1024 on 32 bit systems)

Is it that useful to match number of connections with number of threads?

Thank you

P.S. that consultancy let us down several times. I dont trust then at all.. I need a real reason to change such a thing

Well, I probably wouldn't recommend it generally speaking.

First off, just because there are 1000 connections at a given time, definately doesn't imply that there are 1000 concurrent processing requests...connections are frequently idle in many types of systems processing 'think' time by end users, or just sitting idle in a connection pool (.NET or otherwise). If you are using connection pooling, I'm sure you'll find that many of your connections are idle a fair amount of the time...

In a 32-bit system, on startup Sql server will reserve enough memory to load it's own binaries in, then some to handle 8kb and greater memory requests (typically 128mb by default, but can be modified using a startup switch), then enough memory to be able to allocate stacks for the total number of threads possible to use, which is determined by your 'max worker thread' setting.

Each thread stack is uses about .5mb of memory, which means using a setting of 1200 will result in a reserved space of about 600mb for just stack allocation on a 32bit box. Bear in mind that on a 32bit box of this size (assuming you aren't using a /3gb or /USERVA switch...if you are you ain't going to get to use most of your physical memory), the maximum VAS for a user-mode process like Sql server is 2gb, so stack space is going to use over a 1/4 of that space alone.

By default, in Sql 2005 on a 32bit box, Sql Server will dynamically handle threading using a simple algorithm where with 4 procs or less, 256 max threads will be used, then an additional 8 threads per CPU...in the case of a 16-way machine (yours is an 8-way dual core, 16 schedulers), Sql will use a max thread dynamic setting of 352 on that machine. If you bump that to 1200, your allocating about 850 more than the dyamic configuration would.

Given what I mentioned earlier about the fact that many connections are typically idle a fair amount of time, connections will pool the thread use at the OS level, and typically the dynamic default configuration is hightly recommend.

I'd ask the consultants to provide you extensive documentation on why they think it would be beneficial...typically, recommending something like this would take some extensive testing, and intimate knowledge of a system...

HTH,

|||

Thank you Chad,

I have same ideas but just needed some authoritative information to argue with the consulters.

I really hate 'solutions' made from thin air. I refused to do any changes and requested concrete measures have been made before they decided on the advice. I think they have none.

Might be there is a chance they are right (that advice was given to resolve issues I addressed in my previous topic: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=436762&SiteID=1). Fortunately these accidents havent repeated since I went through the application and put some NOLOCKs into critical places..

max worker threads

We have some SQL Servers that receive high number of connections and stored
procedure calls.
Every once in a while, we may have a bad query plan and then one stored proc
blocks the other stored procs and in no time, we are out of worker threads
and no one can connect
Have you come across such situations ? If so, how did you handle it ? Is it
safe to increase the max worker threads ? What are the consequences ?
The default setting for the 'max worker threads' option is 255,But if the
number of user connections surpasses this value the thread pooling will be
used. For example, if the maximum number of the user connections to your SQL
Server box is equal to 255, you can set the 'max worker threads' options to
255, this frees up resources for SQL Server to use elsewhere. If the maximum
number of the user connections to your SQL Server box is equal to 500, you
can set the 'max worker threads' options to 500, this can improve SQL Server
performance because thread pooling will not be used.
In your case , it sounds like it's worth investigating the query plan
problem , as increasing the worker threads will take up extra resources on
your server
Jack Vamvas
"Hassan" <hassan@.hotmail.com> wrote in message
news:OJXF8Sk8FHA.2192@.TK2MSFTNGP14.phx.gbl...
> We have some SQL Servers that receive high number of connections and
stored
> procedure calls.
> Every once in a while, we may have a bad query plan and then one stored
proc
> blocks the other stored procs and in no time, we are out of worker threads
> and no one can connect
> Have you come across such situations ? If so, how did you handle it ? Is
it
> safe to increase the max worker threads ? What are the consequences ?
>
|||Hi Jack
The number of connections is not related to the number of worker threads
quite as simply as you've described.
Connetions only use threads while they're actually executing. When
connections are in idle state (usually a majority of the time in typical
OLTP apps), there are no threads associated with the connection. This
asynchronous design allows any given number of threads to service a far
larger number of connections.
The way to tell if SQL Server is running short on threads is to use the
Windows Perfmon.exe & monitor the process object sqlservr instance's thread
count counter. If the process SQL Server is running has close to 255
threads, it might be worth increasing Max Worker Threads.
In my experience, this is typically when an OLTP application has thousands
of user connections running, as statistically, this translates to ~255
connections executing concurrently therefore requiring at least 255
threads..
As for the original question, it may help to increase the number of workers,
but keep in mind that this means that SQL Server will be able to schedule
that many more threads to perform concurrent work & you need to take into
account your server resources when making this decision. This is a gross
simplification, but in my experience increasing Max Worker Threads past 255
on systems with fewer than 4 CPUs has rarely helped much as these servers
usually don't have the capacity to process in increased concurrent workload
for example. It should hurt much to increase this setting & see for yourself
whether this helps SQL Server get its work done more effieciently or whether
it contributes further to the problem by increasing context switching etc.
HTH
Regards,
Greg Linwood
SQL Server MVP
"Jack Vamvas" <info@.nospam.com> wrote in message
news:dm9qf9$o1r$1@.nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
>
> The default setting for the 'max worker threads' option is 255,But if the
> number of user connections surpasses this value the thread pooling will be
> used. For example, if the maximum number of the user connections to your
> SQL
> Server box is equal to 255, you can set the 'max worker threads' options
> to
> 255, this frees up resources for SQL Server to use elsewhere. If the
> maximum
> number of the user connections to your SQL Server box is equal to 500, you
> can set the 'max worker threads' options to 500, this can improve SQL
> Server
> performance because thread pooling will not be used.
> In your case , it sounds like it's worth investigating the query plan
> problem , as increasing the worker threads will take up extra resources on
> your server
> Jack Vamvas
> "Hassan" <hassan@.hotmail.com> wrote in message
> news:OJXF8Sk8FHA.2192@.TK2MSFTNGP14.phx.gbl...
> stored
> proc
> it
>
|||I looked at the thread counter for sqlservr process and it states around
180.
What does that mean ?
Are there 180 threads running concurrently ?
If so, would that mean that when i run sp_who2 active, i should see a high
number of connections atleast around 180 or so..
Thats not the case.
Can you tell me more ?
"Greg Linwood" <g_linwood@.hotmail.com> wrote in message
news:OwBcDBt8FHA.2576@.TK2MSFTNGP12.phx.gbl...
> Hi Jack
> The number of connections is not related to the number of worker threads
> quite as simply as you've described.
> Connetions only use threads while they're actually executing. When
> connections are in idle state (usually a majority of the time in typical
> OLTP apps), there are no threads associated with the connection. This
> asynchronous design allows any given number of threads to service a far
> larger number of connections.
> The way to tell if SQL Server is running short on threads is to use the
> Windows Perfmon.exe & monitor the process object sqlservr instance's
> thread count counter. If the process SQL Server is running has close to
> 255 threads, it might be worth increasing Max Worker Threads.
> In my experience, this is typically when an OLTP application has thousands
> of user connections running, as statistically, this translates to ~255
> connections executing concurrently therefore requiring at least 255
> threads..
> As for the original question, it may help to increase the number of
> workers, but keep in mind that this means that SQL Server will be able to
> schedule that many more threads to perform concurrent work & you need to
> take into account your server resources when making this decision. This is
> a gross simplification, but in my experience increasing Max Worker Threads
> past 255 on systems with fewer than 4 CPUs has rarely helped much as these
> servers usually don't have the capacity to process in increased concurrent
> workload for example. It should hurt much to increase this setting & see
> for yourself whether this helps SQL Server get its work done more
> effieciently or whether it contributes further to the problem by
> increasing context switching etc.
> HTH
> Regards,
> Greg Linwood
> SQL Server MVP
> "Jack Vamvas" <info@.nospam.com> wrote in message
> news:dm9qf9$o1r$1@.nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
>
|||And after 5 mins, I looked at it and it was 247. But I did sp_who2 active
and saw just 2 user processes running.
Yes its a busy system with 4000 connections but did not appear i was running
under pressure or am I and dont know about it
"Hassan" <hassan@.hotmail.com> wrote in message
news:%23djxvyt8FHA.1140@.tk2msftngp13.phx.gbl...
>I looked at the thread counter for sqlservr process and it states around
>180.
> What does that mean ?
> Are there 180 threads running concurrently ?
> If so, would that mean that when i run sp_who2 active, i should see a high
> number of connections atleast around 180 or so..
> Thats not the case.
> Can you tell me more ?
> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> news:OwBcDBt8FHA.2576@.TK2MSFTNGP12.phx.gbl...
>
|||Hi Hassan
180 threads, means exactly that - there are 180 worker threads in SQL Server
windows process. Most would be worker threads (rather than dedicated system
threads), waiting for queries or i/o work to service. Having 180 threads
doesn't imply any system pressure on its own. It does suggest that, of your
~ 4000 connections, you might typically see peaks of ~ 180 queries actually
running concurrently.
It's possible for the # of threads to exceed connections and vice versa due
to the thread pooling model SQL Server uses in its work scheduling engine
(UMS). There's no directl correlation you can draw to assume that the number
of threads is either higher or lower than the number of connections at any
time. It's perfectly reasonable to see more threads than connections for
example where many connections may have been in use but close. The threads
will hang around in the pool for a while before SQL Server decides to trim
the worker pool. I don't have any info on exactly how or when it does this
trimming, but this is a fairly common design in multi-threaded server
programming..
It's certainly far more common to see the # of threads far lower than the #
of connections though, so if you see the # of threads > connections for
extended periods, there's possibly something wrong.
Regards,
Greg Linwood
SQL Server MVP
"Hassan" <hassan@.hotmail.com> wrote in message
news:uqs1e7t8FHA.3880@.TK2MSFTNGP12.phx.gbl...
> And after 5 mins, I looked at it and it was 247. But I did sp_who2 active
> and saw just 2 user processes running.
> Yes its a busy system with 4000 connections but did not appear i was
> running under pressure or am I and dont know about it
>
> "Hassan" <hassan@.hotmail.com> wrote in message
> news:%23djxvyt8FHA.1140@.tk2msftngp13.phx.gbl...
>

max worker threads

We have some SQL Servers that receive high number of connections and stored
procedure calls.
Every once in a while, we may have a bad query plan and then one stored proc
blocks the other stored procs and in no time, we are out of worker threads
and no one can connect
Have you come across such situations ? If so, how did you handle it ? Is it
safe to increase the max worker threads ? What are the consequences ?The default setting for the 'max worker threads' option is 255,But if the
number of user connections surpasses this value the thread pooling will be
used. For example, if the maximum number of the user connections to your SQL
Server box is equal to 255, you can set the 'max worker threads' options to
255, this frees up resources for SQL Server to use elsewhere. If the maximum
number of the user connections to your SQL Server box is equal to 500, you
can set the 'max worker threads' options to 500, this can improve SQL Server
performance because thread pooling will not be used.
In your case , it sounds like it's worth investigating the query plan
problem , as increasing the worker threads will take up extra resources on
your server
Jack Vamvas
"Hassan" <hassan@.hotmail.com> wrote in message
news:OJXF8Sk8FHA.2192@.TK2MSFTNGP14.phx.gbl...
> We have some SQL Servers that receive high number of connections and
stored
> procedure calls.
> Every once in a while, we may have a bad query plan and then one stored
proc
> blocks the other stored procs and in no time, we are out of worker threads
> and no one can connect
> Have you come across such situations ? If so, how did you handle it ? Is
it
> safe to increase the max worker threads ? What are the consequences ?
>|||Hi Jack
The number of connections is not related to the number of worker threads
quite as simply as you've described.
Connetions only use threads while they're actually executing. When
connections are in idle state (usually a majority of the time in typical
OLTP apps), there are no threads associated with the connection. This
asynchronous design allows any given number of threads to service a far
larger number of connections.
The way to tell if SQL Server is running short on threads is to use the
Windows Perfmon.exe & monitor the process object sqlservr instance's thread
count counter. If the process SQL Server is running has close to 255
threads, it might be worth increasing Max Worker Threads.
In my experience, this is typically when an OLTP application has thousands
of user connections running, as statistically, this translates to ~255
connections executing concurrently therefore requiring at least 255
threads..
As for the original question, it may help to increase the number of workers,
but keep in mind that this means that SQL Server will be able to schedule
that many more threads to perform concurrent work & you need to take into
account your server resources when making this decision. This is a gross
simplification, but in my experience increasing Max Worker Threads past 255
on systems with fewer than 4 CPUs has rarely helped much as these servers
usually don't have the capacity to process in increased concurrent workload
for example. It should hurt much to increase this setting & see for yourself
whether this helps SQL Server get its work done more effieciently or whether
it contributes further to the problem by increasing context switching etc.
HTH
Regards,
Greg Linwood
SQL Server MVP
"Jack Vamvas" <info@.nospam.com> wrote in message
news:dm9qf9$o1r$1@.nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
>
> The default setting for the 'max worker threads' option is 255,But if the
> number of user connections surpasses this value the thread pooling will be
> used. For example, if the maximum number of the user connections to your
> SQL
> Server box is equal to 255, you can set the 'max worker threads' options
> to
> 255, this frees up resources for SQL Server to use elsewhere. If the
> maximum
> number of the user connections to your SQL Server box is equal to 500, you
> can set the 'max worker threads' options to 500, this can improve SQL
> Server
> performance because thread pooling will not be used.
> In your case , it sounds like it's worth investigating the query plan
> problem , as increasing the worker threads will take up extra resources on
> your server
> Jack Vamvas
> "Hassan" <hassan@.hotmail.com> wrote in message
> news:OJXF8Sk8FHA.2192@.TK2MSFTNGP14.phx.gbl...
> stored
> proc
> it
>|||I looked at the thread counter for sqlservr process and it states around
180.
What does that mean ?
Are there 180 threads running concurrently ?
If so, would that mean that when i run sp_who2 active, i should see a high
number of connections atleast around 180 or so..
Thats not the case.
Can you tell me more ?
"Greg Linwood" <g_linwood@.hotmail.com> wrote in message
news:OwBcDBt8FHA.2576@.TK2MSFTNGP12.phx.gbl...
> Hi Jack
> The number of connections is not related to the number of worker threads
> quite as simply as you've described.
> Connetions only use threads while they're actually executing. When
> connections are in idle state (usually a majority of the time in typical
> OLTP apps), there are no threads associated with the connection. This
> asynchronous design allows any given number of threads to service a far
> larger number of connections.
> The way to tell if SQL Server is running short on threads is to use the
> Windows Perfmon.exe & monitor the process object sqlservr instance's
> thread count counter. If the process SQL Server is running has close to
> 255 threads, it might be worth increasing Max Worker Threads.
> In my experience, this is typically when an OLTP application has thousands
> of user connections running, as statistically, this translates to ~255
> connections executing concurrently therefore requiring at least 255
> threads..
> As for the original question, it may help to increase the number of
> workers, but keep in mind that this means that SQL Server will be able to
> schedule that many more threads to perform concurrent work & you need to
> take into account your server resources when making this decision. This is
> a gross simplification, but in my experience increasing Max Worker Threads
> past 255 on systems with fewer than 4 CPUs has rarely helped much as these
> servers usually don't have the capacity to process in increased concurrent
> workload for example. It should hurt much to increase this setting & see
> for yourself whether this helps SQL Server get its work done more
> effieciently or whether it contributes further to the problem by
> increasing context switching etc.
> HTH
> Regards,
> Greg Linwood
> SQL Server MVP
> "Jack Vamvas" <info@.nospam.com> wrote in message
> news:dm9qf9$o1r$1@.nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
>|||And after 5 mins, I looked at it and it was 247. But I did sp_who2 active
and saw just 2 user processes running.
Yes its a busy system with 4000 connections but did not appear i was running
under pressure or am I and dont know about it
"Hassan" <hassan@.hotmail.com> wrote in message
news:%23djxvyt8FHA.1140@.tk2msftngp13.phx.gbl...
>I looked at the thread counter for sqlservr process and it states around
>180.
> What does that mean ?
> Are there 180 threads running concurrently ?
> If so, would that mean that when i run sp_who2 active, i should see a high
> number of connections atleast around 180 or so..
> Thats not the case.
> Can you tell me more ?
> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> news:OwBcDBt8FHA.2576@.TK2MSFTNGP12.phx.gbl...
>|||Hi Hassan
180 threads, means exactly that - there are 180 worker threads in SQL Server
windows process. Most would be worker threads (rather than dedicated system
threads), waiting for queries or i/o work to service. Having 180 threads
doesn't imply any system pressure on its own. It does suggest that, of your
~ 4000 connections, you might typically see peaks of ~ 180 queries actually
running concurrently.
It's possible for the # of threads to exceed connections and vice versa due
to the thread pooling model SQL Server uses in its work scheduling engine
(UMS). There's no directl correlation you can draw to assume that the number
of threads is either higher or lower than the number of connections at any
time. It's perfectly reasonable to see more threads than connections for
example where many connections may have been in use but close. The threads
will hang around in the pool for a while before SQL Server decides to trim
the worker pool. I don't have any info on exactly how or when it does this
trimming, but this is a fairly common design in multi-threaded server
programming..
It's certainly far more common to see the # of threads far lower than the #
of connections though, so if you see the # of threads > connections for
extended periods, there's possibly something wrong.
Regards,
Greg Linwood
SQL Server MVP
"Hassan" <hassan@.hotmail.com> wrote in message
news:uqs1e7t8FHA.3880@.TK2MSFTNGP12.phx.gbl...
> And after 5 mins, I looked at it and it was 247. But I did sp_who2 active
> and saw just 2 user processes running.
> Yes its a busy system with 4000 connections but did not appear i was
> running under pressure or am I and dont know about it
>
> "Hassan" <hassan@.hotmail.com> wrote in message
> news:%23djxvyt8FHA.1140@.tk2msftngp13.phx.gbl...
>

max worker threads

We have some SQL Servers that receive high number of connections and stored
procedure calls.
Every once in a while, we may have a bad query plan and then one stored proc
blocks the other stored procs and in no time, we are out of worker threads
and no one can connect
Have you come across such situations ? If so, how did you handle it ? Is it
safe to increase the max worker threads ? What are the consequences ?The default setting for the 'max worker threads' option is 255,But if the
number of user connections surpasses this value the thread pooling will be
used. For example, if the maximum number of the user connections to your SQL
Server box is equal to 255, you can set the 'max worker threads' options to
255, this frees up resources for SQL Server to use elsewhere. If the maximum
number of the user connections to your SQL Server box is equal to 500, you
can set the 'max worker threads' options to 500, this can improve SQL Server
performance because thread pooling will not be used.
In your case , it sounds like it's worth investigating the query plan
problem , as increasing the worker threads will take up extra resources on
your server
Jack Vamvas
"Hassan" <hassan@.hotmail.com> wrote in message
news:OJXF8Sk8FHA.2192@.TK2MSFTNGP14.phx.gbl...
> We have some SQL Servers that receive high number of connections and
stored
> procedure calls.
> Every once in a while, we may have a bad query plan and then one stored
proc
> blocks the other stored procs and in no time, we are out of worker threads
> and no one can connect
> Have you come across such situations ? If so, how did you handle it ? Is
it
> safe to increase the max worker threads ? What are the consequences ?
>|||Hi Jack
The number of connections is not related to the number of worker threads
quite as simply as you've described.
Connetions only use threads while they're actually executing. When
connections are in idle state (usually a majority of the time in typical
OLTP apps), there are no threads associated with the connection. This
asynchronous design allows any given number of threads to service a far
larger number of connections.
The way to tell if SQL Server is running short on threads is to use the
Windows Perfmon.exe & monitor the process object sqlservr instance's thread
count counter. If the process SQL Server is running has close to 255
threads, it might be worth increasing Max Worker Threads.
In my experience, this is typically when an OLTP application has thousands
of user connections running, as statistically, this translates to ~255
connections executing concurrently therefore requiring at least 255
threads..
As for the original question, it may help to increase the number of workers,
but keep in mind that this means that SQL Server will be able to schedule
that many more threads to perform concurrent work & you need to take into
account your server resources when making this decision. This is a gross
simplification, but in my experience increasing Max Worker Threads past 255
on systems with fewer than 4 CPUs has rarely helped much as these servers
usually don't have the capacity to process in increased concurrent workload
for example. It should hurt much to increase this setting & see for yourself
whether this helps SQL Server get its work done more effieciently or whether
it contributes further to the problem by increasing context switching etc.
HTH
Regards,
Greg Linwood
SQL Server MVP
"Jack Vamvas" <info@.nospam.com> wrote in message
news:dm9qf9$o1r$1@.nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
>
> The default setting for the 'max worker threads' option is 255,But if the
> number of user connections surpasses this value the thread pooling will be
> used. For example, if the maximum number of the user connections to your
> SQL
> Server box is equal to 255, you can set the 'max worker threads' options
> to
> 255, this frees up resources for SQL Server to use elsewhere. If the
> maximum
> number of the user connections to your SQL Server box is equal to 500, you
> can set the 'max worker threads' options to 500, this can improve SQL
> Server
> performance because thread pooling will not be used.
> In your case , it sounds like it's worth investigating the query plan
> problem , as increasing the worker threads will take up extra resources on
> your server
> Jack Vamvas
> "Hassan" <hassan@.hotmail.com> wrote in message
> news:OJXF8Sk8FHA.2192@.TK2MSFTNGP14.phx.gbl...
>> We have some SQL Servers that receive high number of connections and
> stored
>> procedure calls.
>> Every once in a while, we may have a bad query plan and then one stored
> proc
>> blocks the other stored procs and in no time, we are out of worker
>> threads
>> and no one can connect
>> Have you come across such situations ? If so, how did you handle it ? Is
> it
>> safe to increase the max worker threads ? What are the consequences ?
>>
>|||I looked at the thread counter for sqlservr process and it states around
180.
What does that mean ?
Are there 180 threads running concurrently ?
If so, would that mean that when i run sp_who2 active, i should see a high
number of connections atleast around 180 or so..
Thats not the case.
Can you tell me more ?
"Greg Linwood" <g_linwood@.hotmail.com> wrote in message
news:OwBcDBt8FHA.2576@.TK2MSFTNGP12.phx.gbl...
> Hi Jack
> The number of connections is not related to the number of worker threads
> quite as simply as you've described.
> Connetions only use threads while they're actually executing. When
> connections are in idle state (usually a majority of the time in typical
> OLTP apps), there are no threads associated with the connection. This
> asynchronous design allows any given number of threads to service a far
> larger number of connections.
> The way to tell if SQL Server is running short on threads is to use the
> Windows Perfmon.exe & monitor the process object sqlservr instance's
> thread count counter. If the process SQL Server is running has close to
> 255 threads, it might be worth increasing Max Worker Threads.
> In my experience, this is typically when an OLTP application has thousands
> of user connections running, as statistically, this translates to ~255
> connections executing concurrently therefore requiring at least 255
> threads..
> As for the original question, it may help to increase the number of
> workers, but keep in mind that this means that SQL Server will be able to
> schedule that many more threads to perform concurrent work & you need to
> take into account your server resources when making this decision. This is
> a gross simplification, but in my experience increasing Max Worker Threads
> past 255 on systems with fewer than 4 CPUs has rarely helped much as these
> servers usually don't have the capacity to process in increased concurrent
> workload for example. It should hurt much to increase this setting & see
> for yourself whether this helps SQL Server get its work done more
> effieciently or whether it contributes further to the problem by
> increasing context switching etc.
> HTH
> Regards,
> Greg Linwood
> SQL Server MVP
> "Jack Vamvas" <info@.nospam.com> wrote in message
> news:dm9qf9$o1r$1@.nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
>>
>> The default setting for the 'max worker threads' option is 255,But if the
>> number of user connections surpasses this value the thread pooling will
>> be
>> used. For example, if the maximum number of the user connections to your
>> SQL
>> Server box is equal to 255, you can set the 'max worker threads' options
>> to
>> 255, this frees up resources for SQL Server to use elsewhere. If the
>> maximum
>> number of the user connections to your SQL Server box is equal to 500,
>> you
>> can set the 'max worker threads' options to 500, this can improve SQL
>> Server
>> performance because thread pooling will not be used.
>> In your case , it sounds like it's worth investigating the query plan
>> problem , as increasing the worker threads will take up extra resources
>> on
>> your server
>> Jack Vamvas
>> "Hassan" <hassan@.hotmail.com> wrote in message
>> news:OJXF8Sk8FHA.2192@.TK2MSFTNGP14.phx.gbl...
>> We have some SQL Servers that receive high number of connections and
>> stored
>> procedure calls.
>> Every once in a while, we may have a bad query plan and then one stored
>> proc
>> blocks the other stored procs and in no time, we are out of worker
>> threads
>> and no one can connect
>> Have you come across such situations ? If so, how did you handle it ? Is
>> it
>> safe to increase the max worker threads ? What are the consequences ?
>>
>>
>|||And after 5 mins, I looked at it and it was 247. But I did sp_who2 active
and saw just 2 user processes running.
Yes its a busy system with 4000 connections but did not appear i was running
under pressure or am I and dont know about it
"Hassan" <hassan@.hotmail.com> wrote in message
news:%23djxvyt8FHA.1140@.tk2msftngp13.phx.gbl...
>I looked at the thread counter for sqlservr process and it states around
>180.
> What does that mean ?
> Are there 180 threads running concurrently ?
> If so, would that mean that when i run sp_who2 active, i should see a high
> number of connections atleast around 180 or so..
> Thats not the case.
> Can you tell me more ?
> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> news:OwBcDBt8FHA.2576@.TK2MSFTNGP12.phx.gbl...
>> Hi Jack
>> The number of connections is not related to the number of worker threads
>> quite as simply as you've described.
>> Connetions only use threads while they're actually executing. When
>> connections are in idle state (usually a majority of the time in typical
>> OLTP apps), there are no threads associated with the connection. This
>> asynchronous design allows any given number of threads to service a far
>> larger number of connections.
>> The way to tell if SQL Server is running short on threads is to use the
>> Windows Perfmon.exe & monitor the process object sqlservr instance's
>> thread count counter. If the process SQL Server is running has close to
>> 255 threads, it might be worth increasing Max Worker Threads.
>> In my experience, this is typically when an OLTP application has
>> thousands of user connections running, as statistically, this translates
>> to ~255 connections executing concurrently therefore requiring at least
>> 255 threads..
>> As for the original question, it may help to increase the number of
>> workers, but keep in mind that this means that SQL Server will be able to
>> schedule that many more threads to perform concurrent work & you need to
>> take into account your server resources when making this decision. This
>> is a gross simplification, but in my experience increasing Max Worker
>> Threads past 255 on systems with fewer than 4 CPUs has rarely helped much
>> as these servers usually don't have the capacity to process in increased
>> concurrent workload for example. It should hurt much to increase this
>> setting & see for yourself whether this helps SQL Server get its work
>> done more effieciently or whether it contributes further to the problem
>> by increasing context switching etc.
>> HTH
>> Regards,
>> Greg Linwood
>> SQL Server MVP
>> "Jack Vamvas" <info@.nospam.com> wrote in message
>> news:dm9qf9$o1r$1@.nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
>>
>> The default setting for the 'max worker threads' option is 255,But if
>> the
>> number of user connections surpasses this value the thread pooling will
>> be
>> used. For example, if the maximum number of the user connections to your
>> SQL
>> Server box is equal to 255, you can set the 'max worker threads' options
>> to
>> 255, this frees up resources for SQL Server to use elsewhere. If the
>> maximum
>> number of the user connections to your SQL Server box is equal to 500,
>> you
>> can set the 'max worker threads' options to 500, this can improve SQL
>> Server
>> performance because thread pooling will not be used.
>> In your case , it sounds like it's worth investigating the query plan
>> problem , as increasing the worker threads will take up extra resources
>> on
>> your server
>> Jack Vamvas
>> "Hassan" <hassan@.hotmail.com> wrote in message
>> news:OJXF8Sk8FHA.2192@.TK2MSFTNGP14.phx.gbl...
>> We have some SQL Servers that receive high number of connections and
>> stored
>> procedure calls.
>> Every once in a while, we may have a bad query plan and then one stored
>> proc
>> blocks the other stored procs and in no time, we are out of worker
>> threads
>> and no one can connect
>> Have you come across such situations ? If so, how did you handle it ?
>> Is
>> it
>> safe to increase the max worker threads ? What are the consequences ?
>>
>>
>>
>|||Hi Hassan
180 threads, means exactly that - there are 180 worker threads in SQL Server
windows process. Most would be worker threads (rather than dedicated system
threads), waiting for queries or i/o work to service. Having 180 threads
doesn't imply any system pressure on its own. It does suggest that, of your
~ 4000 connections, you might typically see peaks of ~ 180 queries actually
running concurrently.
It's possible for the # of threads to exceed connections and vice versa due
to the thread pooling model SQL Server uses in its work scheduling engine
(UMS). There's no directl correlation you can draw to assume that the number
of threads is either higher or lower than the number of connections at any
time. It's perfectly reasonable to see more threads than connections for
example where many connections may have been in use but close. The threads
will hang around in the pool for a while before SQL Server decides to trim
the worker pool. I don't have any info on exactly how or when it does this
trimming, but this is a fairly common design in multi-threaded server
programming..
It's certainly far more common to see the # of threads far lower than the #
of connections though, so if you see the # of threads > connections for
extended periods, there's possibly something wrong.
Regards,
Greg Linwood
SQL Server MVP
"Hassan" <hassan@.hotmail.com> wrote in message
news:uqs1e7t8FHA.3880@.TK2MSFTNGP12.phx.gbl...
> And after 5 mins, I looked at it and it was 247. But I did sp_who2 active
> and saw just 2 user processes running.
> Yes its a busy system with 4000 connections but did not appear i was
> running under pressure or am I and dont know about it
>
> "Hassan" <hassan@.hotmail.com> wrote in message
> news:%23djxvyt8FHA.1140@.tk2msftngp13.phx.gbl...
>>I looked at the thread counter for sqlservr process and it states around
>>180.
>> What does that mean ?
>> Are there 180 threads running concurrently ?
>> If so, would that mean that when i run sp_who2 active, i should see a
>> high number of connections atleast around 180 or so..
>> Thats not the case.
>> Can you tell me more ?
>> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
>> news:OwBcDBt8FHA.2576@.TK2MSFTNGP12.phx.gbl...
>> Hi Jack
>> The number of connections is not related to the number of worker threads
>> quite as simply as you've described.
>> Connetions only use threads while they're actually executing. When
>> connections are in idle state (usually a majority of the time in typical
>> OLTP apps), there are no threads associated with the connection. This
>> asynchronous design allows any given number of threads to service a far
>> larger number of connections.
>> The way to tell if SQL Server is running short on threads is to use the
>> Windows Perfmon.exe & monitor the process object sqlservr instance's
>> thread count counter. If the process SQL Server is running has close to
>> 255 threads, it might be worth increasing Max Worker Threads.
>> In my experience, this is typically when an OLTP application has
>> thousands of user connections running, as statistically, this translates
>> to ~255 connections executing concurrently therefore requiring at least
>> 255 threads..
>> As for the original question, it may help to increase the number of
>> workers, but keep in mind that this means that SQL Server will be able
>> to schedule that many more threads to perform concurrent work & you need
>> to take into account your server resources when making this decision.
>> This is a gross simplification, but in my experience increasing Max
>> Worker Threads past 255 on systems with fewer than 4 CPUs has rarely
>> helped much as these servers usually don't have the capacity to process
>> in increased concurrent workload for example. It should hurt much to
>> increase this setting & see for yourself whether this helps SQL Server
>> get its work done more effieciently or whether it contributes further to
>> the problem by increasing context switching etc.
>> HTH
>> Regards,
>> Greg Linwood
>> SQL Server MVP
>> "Jack Vamvas" <info@.nospam.com> wrote in message
>> news:dm9qf9$o1r$1@.nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
>>
>> The default setting for the 'max worker threads' option is 255,But if
>> the
>> number of user connections surpasses this value the thread pooling will
>> be
>> used. For example, if the maximum number of the user connections to
>> your SQL
>> Server box is equal to 255, you can set the 'max worker threads'
>> options to
>> 255, this frees up resources for SQL Server to use elsewhere. If the
>> maximum
>> number of the user connections to your SQL Server box is equal to 500,
>> you
>> can set the 'max worker threads' options to 500, this can improve SQL
>> Server
>> performance because thread pooling will not be used.
>> In your case , it sounds like it's worth investigating the query plan
>> problem , as increasing the worker threads will take up extra resources
>> on
>> your server
>> Jack Vamvas
>> "Hassan" <hassan@.hotmail.com> wrote in message
>> news:OJXF8Sk8FHA.2192@.TK2MSFTNGP14.phx.gbl...
>> We have some SQL Servers that receive high number of connections and
>> stored
>> procedure calls.
>> Every once in a while, we may have a bad query plan and then one
>> stored
>> proc
>> blocks the other stored procs and in no time, we are out of worker
>> threads
>> and no one can connect
>> Have you come across such situations ? If so, how did you handle it ?
>> Is
>> it
>> safe to increase the max worker threads ? What are the consequences ?
>>
>>
>>
>>
>

Max Woprked threads

We consistently have between 550 and 600 connections. The server has 8gb of ram and is a dediocated sql server (advanced and enterpirse editions so awe has been enabled) would performance inpro9ve if the mas threats is set to say 550?
Moses
I prefer using a default value of the max worker threads. Microsoft states
that it is best for most systems.
Before you changed the default value did you recieve the message from SQL
Server "The working thread limit of 255 has been reached."?
"Moses" <anonymous@.discussions.microsoft.com> wrote in message
news:1C89340C-DF46-42BC-BA9D-46427C6D1CE9@.microsoft.com...
> We consistently have between 550 and 600 connections. The server has 8gb
of ram and is a dediocated sql server (advanced and enterpirse editions so
awe has been enabled) would performance inpro9ve if the mas threats is set
to say 550?
|||You don't need anywhere near as many worker threads as you have users.
Unless you are seeing entries in the error log stating you are running out
of worker threads I would not touch that setting.
Andrew J. Kelly SQL MVP
"Moses" <anonymous@.discussions.microsoft.com> wrote in message
news:1C89340C-DF46-42BC-BA9D-46427C6D1CE9@.microsoft.com...
> We consistently have between 550 and 600 connections. The server has 8gb
of ram and is a dediocated sql server (advanced and enterpirse editions so
awe has been enabled) would performance inpro9ve if the mas threats is set
to say 550?

Max Woprked threads

We consistently have between 550 and 600 connections. The server has 8gb of ram and is a dediocated sql server (advanced and enterpirse editions so awe has been enabled) would performance inpro9ve if the mas threats is set to say 550?Moses
I prefer using a default value of the max worker threads. Microsoft states
that it is best for most systems.
Before you changed the default value did you recieve the message from SQL
Server "The working thread limit of 255 has been reached."?
"Moses" <anonymous@.discussions.microsoft.com> wrote in message
news:1C89340C-DF46-42BC-BA9D-46427C6D1CE9@.microsoft.com...
> We consistently have between 550 and 600 connections. The server has 8gb
of ram and is a dediocated sql server (advanced and enterpirse editions so
awe has been enabled) would performance inpro9ve if the mas threats is set
to say 550?|||You don't need anywhere near as many worker threads as you have users.
Unless you are seeing entries in the error log stating you are running out
of worker threads I would not touch that setting.
--
Andrew J. Kelly SQL MVP
"Moses" <anonymous@.discussions.microsoft.com> wrote in message
news:1C89340C-DF46-42BC-BA9D-46427C6D1CE9@.microsoft.com...
> We consistently have between 550 and 600 connections. The server has 8gb
of ram and is a dediocated sql server (advanced and enterpirse editions so
awe has been enabled) would performance inpro9ve if the mas threats is set
to say 550?

Max Woprked threads

We consistently have between 550 and 600 connections. The server has 8gb of
ram and is a dediocated sql server (advanced and enterpirse editions so awe
has been enabled) would performance inpro9ve if the mas threats is set to sa
y 550?Moses
I prefer using a default value of the max worker threads. Microsoft states
that it is best for most systems.
Before you changed the default value did you recieve the message from SQL
Server "The working thread limit of 255 has been reached."?
"Moses" <anonymous@.discussions.microsoft.com> wrote in message
news:1C89340C-DF46-42BC-BA9D-46427C6D1CE9@.microsoft.com...
> We consistently have between 550 and 600 connections. The server has 8gb
of ram and is a dediocated sql server (advanced and enterpirse editions so
awe has been enabled) would performance inpro9ve if the mas threats is set
to say 550?|||You don't need anywhere near as many worker threads as you have users.
Unless you are seeing entries in the error log stating you are running out
of worker threads I would not touch that setting.
Andrew J. Kelly SQL MVP
"Moses" <anonymous@.discussions.microsoft.com> wrote in message
news:1C89340C-DF46-42BC-BA9D-46427C6D1CE9@.microsoft.com...
> We consistently have between 550 and 600 connections. The server has 8gb
of ram and is a dediocated sql server (advanced and enterpirse editions so
awe has been enabled) would performance inpro9ve if the mas threats is set
to say 550?