Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Wednesday, March 28, 2012

max degree parallelism

hi,
i've set 'max degree of parallelism' to 1 because some sql request hanged.
Now when i connect, how can i set the parallelism to 4 for a session.
Is there a command like this :
'alter session set max degree of parallelism 4' ?

Thanks

Paulpaul (nomail@.nomail.com) writes:

Quote:

Originally Posted by

i've set 'max degree of parallelism' to 1 because some sql request hanged.
Now when i connect, how can i set the parallelism to 4 for a session.
Is there a command like this :
'alter session set max degree of parallelism 4' ?


There are only places you can control the degrees of parallelism: at
server level and at query level.

If you have a problem with parallelism going awry with a certain query,
the best is to add OPTION (MAXDOP 1) to that query. If you set "max
degree of parallelism" on server level 1, for any query where you want
parallelism, you need to use OPTION (MAXDOP 0) to get all CPUs, or any
other number to get a certain number of CPUs.

The most common reason to change the configuration parameter to reflect
the number of physical CPU cores when you have hyper-threaded CPU. That
is, if you have two dual-core CPUs that are hyperthread, set the
parameter to 4.

If you have plenty of CPUs, you may still want to reduce the number, so
that a single query cannot monopolize the CPU power.

Setting the parameter to 1 because of a single query is not a good idea.
Better is to fix the query.

--
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|||thanks for your reply
i've 4 hyperthread cpu
i've effectively set the degree to 1 because one batch (consist of several
queries) runned with ~220 threads
i don't know why the optimiser choosed this but the fact is the server was
unstable ("and many error like Process ID 85:80 owns resources that are
blocking processes on Scheduler 4.")
the batch takes 3h to complete with max degree = 0 and 3mn with max degree =
1
So i've set the max degree = 1 bacause i don't know if others requets (like
dynamic) can also generate ~200 threads

"Erland Sommarskog" <esquel@.sommarskog.sewrote in message
news:Xns989A725ABC0D7Yazorman@.127.0.0.1...

Quote:

Originally Posted by

paul (nomail@.nomail.com) writes:

Quote:

Originally Posted by

i've set 'max degree of parallelism' to 1 because some sql request


hanged.

Quote:

Originally Posted by

Quote:

Originally Posted by

Now when i connect, how can i set the parallelism to 4 for a session.
Is there a command like this :
'alter session set max degree of parallelism 4' ?


>
There are only places you can control the degrees of parallelism: at
server level and at query level.
>
If you have a problem with parallelism going awry with a certain query,
the best is to add OPTION (MAXDOP 1) to that query. If you set "max
degree of parallelism" on server level 1, for any query where you want
parallelism, you need to use OPTION (MAXDOP 0) to get all CPUs, or any
other number to get a certain number of CPUs.
>
The most common reason to change the configuration parameter to reflect
the number of physical CPU cores when you have hyper-threaded CPU. That
is, if you have two dual-core CPUs that are hyperthread, set the
parameter to 4.
>
If you have plenty of CPUs, you may still want to reduce the number, so
that a single query cannot monopolize the CPU power.
>
Setting the parameter to 1 because of a single query is not a good idea.
Better is to fix the query.
>
--
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

|||paul (nomail@.nomail.com) writes:

Quote:

Originally Posted by

i've 4 hyperthread cpu
i've effectively set the degree to 1 because one batch (consist of
several queries) runned with ~220 threads i don't know why the optimiser
choosed this but the fact is the server was unstable ("and many error
like Process ID 85:80 owns resources that are blocking processes on
Scheduler 4.") the batch takes 3h to complete with max degree = 0 and
3mn with max degree = 1 So i've set the max degree = 1 bacause i don't
know if others requets (like dynamic) can also generate ~200 threads


Certainly it would be a good idea to identify the queries in the batch
that gets a wild parallel plan, and OPTION (MAXDOP 1). At least if you
want to be able to use parallelism elsewhere.

As for why the optimizer generates a parallel plan that takes 3h to complete
I don't know, but I've certainly see it happen more than once.

--
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|||To add on to Erland's response, excessive parallelism can be a symptom that
query and index tuning is needed. The optimizer will sometimes throw
processors at the problem to compensate.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"paul" <nomail@.nomail.comwrote in message
news:elturg$6s3$1@.s1.news.oleane.net...

Quote:

Originally Posted by

thanks for your reply
i've 4 hyperthread cpu
i've effectively set the degree to 1 because one batch (consist of several
queries) runned with ~220 threads
i don't know why the optimiser choosed this but the fact is the server was
unstable ("and many error like Process ID 85:80 owns resources that are
blocking processes on Scheduler 4.")
the batch takes 3h to complete with max degree = 0 and 3mn with max degree
=
1
So i've set the max degree = 1 bacause i don't know if others requets
(like
dynamic) can also generate ~200 threads
>
>
>
>
>
>
"Erland Sommarskog" <esquel@.sommarskog.sewrote in message
news:Xns989A725ABC0D7Yazorman@.127.0.0.1...

Quote:

Originally Posted by

>paul (nomail@.nomail.com) writes:

Quote:

Originally Posted by

i've set 'max degree of parallelism' to 1 because some sql request


hanged.

Quote:

Originally Posted by

Quote:

Originally Posted by

Now when i connect, how can i set the parallelism to 4 for a session.
Is there a command like this :
'alter session set max degree of parallelism 4' ?


>>
>There are only places you can control the degrees of parallelism: at
>server level and at query level.
>>
>If you have a problem with parallelism going awry with a certain query,
>the best is to add OPTION (MAXDOP 1) to that query. If you set "max
>degree of parallelism" on server level 1, for any query where you want
>parallelism, you need to use OPTION (MAXDOP 0) to get all CPUs, or any
>other number to get a certain number of CPUs.
>>
>The most common reason to change the configuration parameter to reflect
>the number of physical CPU cores when you have hyper-threaded CPU. That
>is, if you have two dual-core CPUs that are hyperthread, set the
>parameter to 4.
>>
>If you have plenty of CPUs, you may still want to reduce the number, so
>that a single query cannot monopolize the CPU power.
>>
>Setting the parameter to 1 because of a single query is not a good idea.
>Better is to fix the query.
>>
>--
>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


>
>

|||Dan Guzman (guzmanda@.nospam-online.sbcglobal.net) writes:

Quote:

Originally Posted by

To add on to Erland's response, excessive parallelism can be a symptom
that query and index tuning is needed. The optimizer will sometimes
throw processors at the problem to compensate.


Yeah, but in those cases the query usually don't complete in three seconds
if constraint to one CPU!

--
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|||Yeah, but in those cases the query usually don't complete in three seconds

Quote:

Originally Posted by

if constraint to one CPU!


True, but I've seen overly aggressive parallel plans that completed
significantly faster without parallelism. In many of those cases, tuning
eliminated parallelism entirely and the single-threaded query ran much
faster too. IMHO, tuning is a often better than fiddling with MAXDOP.

However, in Paul's case, the difference is much more pronounced (3 minutes
vs. 3 hours) and apparently introduced instability. I'm not sure what
service pack he's running but there are optimizer fixes/enhancements in all
the SQL 2000 SPs.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Erland Sommarskog" <esquel@.sommarskog.sewrote in message
news:Xns989AB0A9CE989Yazorman@.127.0.0.1...

Quote:

Originally Posted by

Dan Guzman (guzmanda@.nospam-online.sbcglobal.net) writes:

Quote:

Originally Posted by

>To add on to Erland's response, excessive parallelism can be a symptom
>that query and index tuning is needed. The optimizer will sometimes
>throw processors at the problem to compensate.


>
Yeah, but in those cases the query usually don't complete in three seconds
if constraint to one CPU!
>
>
--
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

Monday, March 26, 2012

Max connections for SQl 2000 on Win XP Pro

Hi,
I'm a teacher in VB and use SQL 2000 on a laptop with Windows XP Pro.
My class has 20 students, can they connect to the sql database on my laptop?
Thanks inadvanced.
Danny
Greetings from BelgiumYes they can. I guess the students will be running very
small test queries against the sql server on your laptop.
>--Original Message--
>Hi,
>I'm a teacher in VB and use SQL 2000 on a laptop with
Windows XP Pro.
>My class has 20 students, can they connect to the sql
database on my laptop?
>Thanks inadvanced.
>Danny
>Greetings from Belgium
>
>.
>|||Why Not?
Scenario 1: If students want to work on SQL Server .
You all must be within the same network/domain.
Install SQL Server client in their PC and then configure
the client if needed. Usually SQLServer Client identifies
the other Servers in the same domain automatically. If the
server is in different domain, then you have to configure
the client(Use Named Piped Protocol/TCPIP).
Scenario 2: Just if the students want to connect and query
the SQL Server database from VB applications, then use
ODBC connectivity in your application.
Hope this helps. If not, please reply with your questions
in detail.
-SQLVarad (MCDBA-1999, MCSE-1999)
Greetings from USA
>--Original Message--
>Hi,
>I'm a teacher in VB and use SQL 2000 on a laptop with
Windows XP Pro.
>My class has 20 students, can they connect to the sql
database on my laptop?
>Thanks inadvanced.
>Danny
>Greetings from Belgium
>
>.
>|||<anonymous@.discussions.microsoft.com> schreef in bericht
news:02f901c398c2$79845960$a101280a@.phx.gbl...
> Yes they can. I guess the students will be running very
> small test queries against the sql server on your laptop.
>
Thanks for the quick answer.
Yes, its for learning ADO
What are the max connection for SQL server on XP Pro or Win 2000 Pro?
Is there a difference must I install Windows 2000 or Windows 2003 server on
the laptop for te connections to te SQL database?
Greetings
Danny
> >--Original Message--
> >Hi,
> >
> >I'm a teacher in VB and use SQL 2000 on a laptop with
> Windows XP Pro.
> >My class has 20 students, can they connect to the sql
> database on my laptop?
> >
> >Thanks inadvanced.
> >
> >Danny
> >Greetings from Belgium
> >
> >
> >.
> >|||"SQLVarad" <SQLVarad@.hotmail.com> schreef in bericht
news:001601c398c3$e1c6c250$a601280a@.phx.gbl...
> Why Not?
> Scenario 1: If students want to work on SQL Server .
> You all must be within the same network/domain.
> Install SQL Server client in their PC and then configure
> the client if needed. Usually SQLServer Client identifies
> the other Servers in the same domain automatically. If the
> server is in different domain, then you have to configure
> the client(Use Named Piped Protocol/TCPIP).
> Scenario 2: Just if the students want to connect and query
> the SQL Server database from VB applications, then use
> ODBC connectivity in your application.
> Hope this helps. If not, please reply with your questions
> in detail.
> -SQLVarad (MCDBA-1999, MCSE-1999)
> Greetings from USA
>
All the students must connect to the same sql database on the laptop. The
students use ADO for the connection.
But my question was, can all the students (20) connect the same time on the
sql database.
Thanks for your answer
Greetings form Belgium
Danny
> >--Original Message--
> >Hi,
> >
> >I'm a teacher in VB and use SQL 2000 on a laptop with
> Windows XP Pro.
> >My class has 20 students, can they connect to the sql
> database on my laptop?
> >
> >Thanks inadvanced.
> >
> >Danny
> >Greetings from Belgium
> >
> >
> >.
> >|||The answer is yes...they may all connect at the same time...
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Redder In Nood" <redderinnood@.hotmail-brolinpakjes.com> wrote in message
news:YAzlb.98327$FX6.4638829@.phobos.telenet-ops.be...
> "SQLVarad" <SQLVarad@.hotmail.com> schreef in bericht
> news:001601c398c3$e1c6c250$a601280a@.phx.gbl...
> > Why Not?
> >
> > Scenario 1: If students want to work on SQL Server .
> >
> > You all must be within the same network/domain.
> > Install SQL Server client in their PC and then configure
> > the client if needed. Usually SQLServer Client identifies
> > the other Servers in the same domain automatically. If the
> > server is in different domain, then you have to configure
> > the client(Use Named Piped Protocol/TCPIP).
> >
> > Scenario 2: Just if the students want to connect and query
> > the SQL Server database from VB applications, then use
> > ODBC connectivity in your application.
> >
> > Hope this helps. If not, please reply with your questions
> > in detail.
> >
> > -SQLVarad (MCDBA-1999, MCSE-1999)
> > Greetings from USA
> >
> All the students must connect to the same sql database on the laptop. The
> students use ADO for the connection.
> But my question was, can all the students (20) connect the same time on
the
> sql database.
> Thanks for your answer
> Greetings form Belgium
> Danny
> > >--Original Message--
> > >Hi,
> > >
> > >I'm a teacher in VB and use SQL 2000 on a laptop with
> > Windows XP Pro.
> > >My class has 20 students, can they connect to the sql
> > database on my laptop?
> > >
> > >Thanks inadvanced.
> > >
> > >Danny
> > >Greetings from Belgium
> > >
> > >
> > >.
> > >
>|||1. The actual number of user connections allowed also
depends on the version of SQL Server you are using and the
limits of your application(s) and hardware. SQL Server
allows a maximum of 32,767 user connections.
Because user connections is dynamic (self-configuring
option), SQL Server adjusts the maximum number of user
connections automatically as needed, up to the maximum
value allowable. For example, if only 10 users are logged
in, 10 user connection objects are allocated. In most
cases, you should not need to change the value for this
option. By default , it allows maximum users.
2. Sorry. Your questions is not clear to me. Can you
expalin in detail?
Thanks,
SQLVarad (MCDBA-1999,MCSE1999)
>--Original Message--
><anonymous@.discussions.microsoft.com> schreef in bericht
>news:02f901c398c2$79845960$a101280a@.phx.gbl...
>> Yes they can. I guess the students will be running very
>> small test queries against the sql server on your
laptop.
>Thanks for the quick answer.
>Yes, its for learning ADO
>What are the max connection for SQL server on XP Pro or
Win 2000 Pro?
>Is there a difference must I install Windows 2000 or
Windows 2003 server on
>the laptop for te connections to te SQL database?
>Greetings
>Danny
>
>> >--Original Message--
>> >Hi,
>> >
>> >I'm a teacher in VB and use SQL 2000 on a laptop with
>> Windows XP Pro.
>> >My class has 20 students, can they connect to the sql
>> database on my laptop?
>> >
>> >Thanks inadvanced.
>> >
>> >Danny
>> >Greetings from Belgium
>> >
>> >
>> >.
>> >
>
>.
>|||"Wayne Snyder" <wsnyder@.computeredservices.com> schreef in bericht
news:OgB%23MdMmDHA.2776@.tk2msftngp13.phx.gbl...
> The answer is yes...they may all connect at the same time...
>
Thanks for teh quich anwer.
Danny
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Computer Education Services Corporation (CESC), Charlotte, NC
> www.computeredservices.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
>
> "Redder In Nood" <redderinnood@.hotmail-brolinpakjes.com> wrote in message
> news:YAzlb.98327$FX6.4638829@.phobos.telenet-ops.be...
> >
> > "SQLVarad" <SQLVarad@.hotmail.com> schreef in bericht
> > news:001601c398c3$e1c6c250$a601280a@.phx.gbl...
> > > Why Not?
> > >
> > > Scenario 1: If students want to work on SQL Server .
> > >
> > > You all must be within the same network/domain.
> > > Install SQL Server client in their PC and then configure
> > > the client if needed. Usually SQLServer Client identifies
> > > the other Servers in the same domain automatically. If the
> > > server is in different domain, then you have to configure
> > > the client(Use Named Piped Protocol/TCPIP).
> > >
> > > Scenario 2: Just if the students want to connect and query
> > > the SQL Server database from VB applications, then use
> > > ODBC connectivity in your application.
> > >
> > > Hope this helps. If not, please reply with your questions
> > > in detail.
> > >
> > > -SQLVarad (MCDBA-1999, MCSE-1999)
> > > Greetings from USA
> > >
> > All the students must connect to the same sql database on the laptop.
The
> > students use ADO for the connection.
> > But my question was, can all the students (20) connect the same time on
> the
> > sql database.
> >
> > Thanks for your answer
> > Greetings form Belgium
> > Danny
> >
> > > >--Original Message--
> > > >Hi,
> > > >
> > > >I'm a teacher in VB and use SQL 2000 on a laptop with
> > > Windows XP Pro.
> > > >My class has 20 students, can they connect to the sql
> > > database on my laptop?
> > > >
> > > >Thanks inadvanced.
> > > >
> > > >Danny
> > > >Greetings from Belgium
> > > >
> > > >
> > > >.
> > > >
> >
> >
>|||Hi Wayne!
I thought that a non-server OS has connection limitations. I surely had then years ago when students
tried to run against my machine. However, this might be IPC sessions (redirector/workstation) and
only apply to Named Pipes, whereas TCP/IP Winsockets is fine...?
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:OgB%23MdMmDHA.2776@.tk2msftngp13.phx.gbl...
> The answer is yes...they may all connect at the same time...
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Computer Education Services Corporation (CESC), Charlotte, NC
> www.computeredservices.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
>
> "Redder In Nood" <redderinnood@.hotmail-brolinpakjes.com> wrote in message
> news:YAzlb.98327$FX6.4638829@.phobos.telenet-ops.be...
> >
> > "SQLVarad" <SQLVarad@.hotmail.com> schreef in bericht
> > news:001601c398c3$e1c6c250$a601280a@.phx.gbl...
> > > Why Not?
> > >
> > > Scenario 1: If students want to work on SQL Server .
> > >
> > > You all must be within the same network/domain.
> > > Install SQL Server client in their PC and then configure
> > > the client if needed. Usually SQLServer Client identifies
> > > the other Servers in the same domain automatically. If the
> > > server is in different domain, then you have to configure
> > > the client(Use Named Piped Protocol/TCPIP).
> > >
> > > Scenario 2: Just if the students want to connect and query
> > > the SQL Server database from VB applications, then use
> > > ODBC connectivity in your application.
> > >
> > > Hope this helps. If not, please reply with your questions
> > > in detail.
> > >
> > > -SQLVarad (MCDBA-1999, MCSE-1999)
> > > Greetings from USA
> > >
> > All the students must connect to the same sql database on the laptop. The
> > students use ADO for the connection.
> > But my question was, can all the students (20) connect the same time on
> the
> > sql database.
> >
> > Thanks for your answer
> > Greetings form Belgium
> > Danny
> >
> > > >--Original Message--
> > > >Hi,
> > > >
> > > >I'm a teacher in VB and use SQL 2000 on a laptop with
> > > Windows XP Pro.
> > > >My class has 20 students, can they connect to the sql
> > > database on my laptop?
> > > >
> > > >Thanks inadvanced.
> > > >
> > > >Danny
> > > >Greetings from Belgium
> > > >
> > > >
> > > >.
> > > >
> >
> >
>