Showing posts with label user. Show all posts
Showing posts with label user. 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

Maximum Request Length Exceeded Help!

I have a report that has 14 user supplied parameters. When I added a 15th parameter and deployed the report, I get an error of Maximum Request Length Exceeded when I try to set up a subscription to the report. All of the subscriptions on the report are failing now and users are getting rather upset.

Please help! How do I get rid of the Maximum Request Length Exceeded error?

Thanks!

i'm not entirely sure, but shortening your parameter names may help.

ie: CustomerLocation to 'Loc'

|||

Redmanmc wrote:

I have a report that has 14 user supplied parameters. When I added a 15th parameter and deployed the report, I get an error of Maximum Request Length Exceeded when I try to set up a subscription to the report. All of the subscriptions on the report are failing now and users are getting rather upset.

Please help! How do I get rid of the Maximum Request Length Exceeded error?

Thanks!

did you ever find a fix for this problem? i seemed to have stumbled upon it myself. thanks

|||

Unfortunently I have not found a solution to the problem yet. I tried reducing the length of the variable names but it did not fix the problem.

If anyone out there has a fix please yell out!

|||

good news.. found a fix for this.

it's actually the same fix for file uploads that exceed the default 4mb set by IIS. however, the change needs to made to the report manager web.config file and not the report server web.config file. that's why it didn't work for me the first time.

here is an article that talks about it http://support.softartisans.com/kbview_825.aspx

if you have kept the default installation directory, the file you edit is:

C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportManager\Web.config

Just add the maxRequestLength property here and set a size appropriate to you. Not to large to discourage DoS attacks.

The example below is 10mb

<httpRuntime executionTimeout="9000" maxRequestLength="10240"/>

hope it helps.

Wednesday, March 7, 2012

Maximum Attribute Values

I have a procedure that detarmines the maximum current values of user table
attributes. However I don't know how to use SQL to get the maximum value of
a
datatype. Can anyone help?There's no way to get them via SQL AFAIK, but you can just look them up in
Books Online, under the specific datatypes.
Jacco Schalkwijk
SQL Server MVP
"marcmc" <marcmc@.discussions.microsoft.com> wrote in message
news:247D52AD-2959-493F-9DC5-E38E6F031EF7@.microsoft.com...
>I have a procedure that detarmines the maximum current values of user table
> attributes. However I don't know how to use SQL to get the maximum value
> of a
> datatype. Can anyone help?|||To add to Jacco's response, you can also get the min/max permissible values
for numeric types in .Net application code using constants in the
System.Data.SqlTypes namespace (e.g. SqlInt32.MaxValue).
Hope this helps.
Dan Guzman
SQL Server MVP
"marcmc" <marcmc@.discussions.microsoft.com> wrote in message
news:247D52AD-2959-493F-9DC5-E38E6F031EF7@.microsoft.com...
>I have a procedure that detarmines the maximum current values of user table
> attributes. However I don't know how to use SQL to get the maximum value
> of a
> datatype. Can anyone help?|||try looking at the system table systypes
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Build, Comparison and Synchronization from Source Control = Database change
management for SQL Server
"marcmc" wrote:

> I have a procedure that detarmines the maximum current values of user tabl
e
> attributes. However I don't know how to use SQL to get the maximum value o
f a
> datatype. Can anyone help?|||Thx
So you can't get them in SQL? How then does it know ehen they are exceeded?
"Dan Guzman" wrote:

> To add to Jacco's response, you can also get the min/max permissible value
s
> for numeric types in .Net application code using constants in the
> System.Data.SqlTypes namespace (e.g. SqlInt32.MaxValue).
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "marcmc" <marcmc@.discussions.microsoft.com> wrote in message
> news:247D52AD-2959-493F-9DC5-E38E6F031EF7@.microsoft.com...
>
>|||> So you can't get them in SQL? How then does it know ehen they are
exceeded?
because the engine is not written in tsql.|||I know that it's not recommended to query system tables directly, but isn't
the information accessible through the systypes table.
INT is listed with a length of 4 but you can easily calculate the max and
min values from this.
The problem that I see would be that Microsoft modifies this table in the
future.
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote
in message news:ustFpMBQFHA.3544@.TK2MSFTNGP12.phx.gbl...
> There's no way to get them via SQL AFAIK, but you can just look them up in
> Books Online, under the specific datatypes.
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "marcmc" <marcmc@.discussions.microsoft.com> wrote in message
> news:247D52AD-2959-493F-9DC5-E38E6F031EF7@.microsoft.com...
>|||Because an overflow exception is thrown by the engine.
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Blog - http://spaces.msn.com/members/drsql/
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"marcmc" <marcmc@.discussions.microsoft.com> wrote in message
news:E68737B1-89BA-4915-A1F0-EF816A91DF05@.microsoft.com...
> Thx
> So you can't get them in SQL? How then does it know ehen they are
> exceeded?
>
> "Dan Guzman" wrote:
>|||I know of no way to get this info in Transact-SQL. The characteristics of
built-in datatypes are hard-coded in the engine code so these don't need to
be stored as meta-data or exposed.
Hope this helps.
Dan Guzman
SQL Server MVP
"marcmc" <marcmc@.discussions.microsoft.com> wrote in message
news:E68737B1-89BA-4915-A1F0-EF816A91DF05@.microsoft.com...
> Thx
> So you can't get them in SQL? How then does it know ehen they are
> exceeded?
>
> "Dan Guzman" wrote:
>|||Keep in mind that underneath SQL's engine is a simple check that detemrines
whether the numeric data it is trying to store is larger than the byte thres
hold
(Integer=4, SmallInt=2, TinyInt=1). It's not "storing" the maximum decimal v
alue
per se. You just have to know that the range of an integer is 2^31 to 2^31-1
.
Thomas
"marcmc" <marcmc@.discussions.microsoft.com> wrote in message
news:E68737B1-89BA-4915-A1F0-EF816A91DF05@.microsoft.com...
> Thx
> So you can't get them in SQL? How then does it know ehen they are exceeded
?
>
> "Dan Guzman" wrote:
>

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..