multi tasking?
by cj on 1/25/2008 11:11:00 AM
Strictly as an example, suppose I write a web service that takes an
employee number and then does some processing and returns their security
clearance, name, department or some such stuff. Again for arguments
sake say this processing takings about 15 seconds each time. Lastly
assume there are lots of people making inquiries via this web service
and at some times of the day we get a request every 2 or 3 seconds. Can
a web service start a new request if it hasn't finished the previous
one? Is it multi-tasking or multi-threaded by nature or is there
something I need to do to allow it to do this? The object is nobody
should have to wait for a previous request to finish for their request
to start.
Re: multi tasking?
by John Saunders [MVP] on 1/25/2008 11:16:00 AM
"cj" <cj@nospam.nospam> wrote in message
news:%23COKHb5XIHA.4896@TK2MSFTNGP06.phx.gbl...
> Strictly as an example, suppose I write a web service that takes an
> employee number and then does some processing and returns their security
> clearance, name, department or some such stuff. Again for arguments sake
> say this processing takings about 15 seconds each time. Lastly assume
> there are lots of people making inquiries via this web service and at some
> times of the day we get a request every 2 or 3 seconds. Can a web service
> start a new request if it hasn't finished the previous one? Is it
> multi-tasking or multi-threaded by nature or is there something I need to
> do to allow it to do this? The object is nobody should have to wait for a
> previous request to finish for their request to start.
ASP.NET will start a new worker thread per request.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Re: multi tasking?
by cj on 1/25/2008 11:23:00 AM
Excellent. I had hoped it would. Now bear with me a minute. If part
of the processing is to make a sql connection and look up data, I'd
assume that each thread would make it's own connection--correct?
John Saunders [MVP] wrote:
> "cj" <cj@nospam.nospam> wrote in message
> news:%23COKHb5XIHA.4896@TK2MSFTNGP06.phx.gbl...
>> Strictly as an example, suppose I write a web service that takes an
>> employee number and then does some processing and returns their security
>> clearance, name, department or some such stuff. Again for arguments sake
>> say this processing takings about 15 seconds each time. Lastly assume
>> there are lots of people making inquiries via this web service and at some
>> times of the day we get a request every 2 or 3 seconds. Can a web service
>> start a new request if it hasn't finished the previous one? Is it
>> multi-tasking or multi-threaded by nature or is there something I need to
>> do to allow it to do this? The object is nobody should have to wait for a
>> previous request to finish for their request to start.
>
> ASP.NET will start a new worker thread per request.
Re: multi tasking?
by Spam Catcher on 1/25/2008 9:38:00 PM
cj <cj@nospam.nospam> wrote in news:Ov$krh5XIHA.4684@TK2MSFTNGP06.phx.gbl:
> Excellent. I had hoped it would. Now bear with me a minute. If part
> of the processing is to make a sql connection and look up data, I'd
> assume that each thread would make it's own connection--correct?
Correct - each web service connection will request a new sql connection
from the sql connection pool.
However, you could use child threads to increase concurrency - but
depending on your application, the performance may or may not increase.
--
spamhoneypot@rogers.com (Do not e-mail)
Re: multi tasking?
by Dave on 1/25/2008 10:31:00 PM
just remember though, somewhere everything has to add up or you will run out
of one resource or another. having the web app run multi-threaded so users
don't have to wait for it is fine, but if each query still takes 15 seconds
from the database it has to be able to handle the multiple simultaneous
requests also. if the database server can't handle a request every 2 or 3
seconds eventually you will not be able to connect, it will crash, or
something else bad will happen.
"cj" <cj@nospam.nospam> wrote in message
news:Ov$krh5XIHA.4684@TK2MSFTNGP06.phx.gbl...
> Excellent. I had hoped it would. Now bear with me a minute. If part of
> the processing is to make a sql connection and look up data, I'd assume
> that each thread would make it's own connection--correct?
>
>
> John Saunders [MVP] wrote:
>> "cj" <cj@nospam.nospam> wrote in message
>> news:%23COKHb5XIHA.4896@TK2MSFTNGP06.phx.gbl...
>>> Strictly as an example, suppose I write a web service that takes an
>>> employee number and then does some processing and returns their security
>>> clearance, name, department or some such stuff. Again for arguments
>>> sake say this processing takings about 15 seconds each time. Lastly
>>> assume there are lots of people making inquiries via this web service
>>> and at some times of the day we get a request every 2 or 3 seconds. Can
>>> a web service start a new request if it hasn't finished the previous
>>> one? Is it multi-tasking or multi-threaded by nature or is there
>>> something I need to do to allow it to do this? The object is nobody
>>> should have to wait for a previous request to finish for their request
>>> to start.
>>
>> ASP.NET will start a new worker thread per request.
Re: multi tasking?
by cj on 1/26/2008 6:31:00 PM
This is just an example.
Dave wrote:
> just remember though, somewhere everything has to add up or you will run out
> of one resource or another. having the web app run multi-threaded so users
> don't have to wait for it is fine, but if each query still takes 15 seconds
> from the database it has to be able to handle the multiple simultaneous
> requests also. if the database server can't handle a request every 2 or 3
> seconds eventually you will not be able to connect, it will crash, or
> something else bad will happen.
>
> "cj" <cj@nospam.nospam> wrote in message
> news:Ov$krh5XIHA.4684@TK2MSFTNGP06.phx.gbl...
>> Excellent. I had hoped it would. Now bear with me a minute. If part of
>> the processing is to make a sql connection and look up data, I'd assume
>> that each thread would make it's own connection--correct?
>>
>>
>> John Saunders [MVP] wrote:
>>> "cj" <cj@nospam.nospam> wrote in message
>>> news:%23COKHb5XIHA.4896@TK2MSFTNGP06.phx.gbl...
>>>> Strictly as an example, suppose I write a web service that takes an
>>>> employee number and then does some processing and returns their security
>>>> clearance, name, department or some such stuff. Again for arguments
>>>> sake say this processing takings about 15 seconds each time. Lastly
>>>> assume there are lots of people making inquiries via this web service
>>>> and at some times of the day we get a request every 2 or 3 seconds. Can
>>>> a web service start a new request if it hasn't finished the previous
>>>> one? Is it multi-tasking or multi-threaded by nature or is there
>>>> something I need to do to allow it to do this? The object is nobody
>>>> should have to wait for a previous request to finish for their request
>>>> to start.
>>> ASP.NET will start a new worker thread per request.
>
>
Re: multi tasking?
by Steven Cheng[MSFT] on 1/28/2008 4:21:00 AM
------=_NextPart_0001_2156C4E1
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi Cj,
ASP.NET webservice use the same threading model as ASP.NET webform
application. ASP.NET runtime pickup a worker thread from .NET clr
threadpool to process each comming request and release it back to the pool
after finishs the request. Here is a very good reference about ASP.NET
threading model:
#Microsoft ASP.NET Threading
http://support.microsoft.com/default.aspx?scid=/servicedesks/webcasts/en/tra
nscripts/wct060503.asp
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Date: Sat, 26 Jan 2008 23:31:12 -0500
From: cj <cj@nospam.nospam>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Subject: Re: multi tasking?
This is just an example.
Dave wrote:
> just remember though, somewhere everything has to add up or you will run
out
> of one resource or another. having the web app run multi-threaded so
users
> don't have to wait for it is fine, but if each query still takes 15
seconds
> from the database it has to be able to handle the multiple simultaneous
> requests also. if the database server can't handle a request every 2 or
3
> seconds eventually you will not be able to connect, it will crash, or
> something else bad will happen.
>
> "cj" <cj@nospam.nospam> wrote in message
> news:Ov$krh5XIHA.4684@TK2MSFTNGP06.phx.gbl...
>> Excellent. I had hoped it would. Now bear with me a minute. If part
of
>> the processing is to make a sql connection and look up data, I'd assume
>> that each thread would make it's own connection--correct?
>>
>>
>> John Saunders [MVP] wrote:
>>> "cj" <cj@nospam.nospam> wrote in message
>>> news:%23COKHb5XIHA.4896@TK2MSFTNGP06.phx.gbl...
>>>> Strictly as an example, suppose I write a web service that takes an
>>>> employee number and then does some processing and returns their
security
>>>> clearance, name, department or some such stuff. Again for arguments
>>>> sake say this processing takings about 15 seconds each time. Lastly
>>>> assume there are lots of people making inquiries via this web service
>>>> and at some times of the day we get a request every 2 or 3 seconds.
Can
>>>> a web service start a new request if it hasn't finished the previous
>>>> one? Is it multi-tasking or multi-threaded by nature or is there
>>>> something I need to do to allow it to do this? The object is nobody
>>>> should have to wait for a previous request to finish for their request
>>>> to start.
>>> ASP.NET will start a new worker thread per request.
>
>
------=_NextPart_0001_2156C4E1
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit
{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\lang2052\f0\fs20 Hi Cj,
\par
\par ASP.NET webservice use the same threading model as ASP.NET webform application. ASP.NET runtime pickup a worker thread from .NET clr threadpool to process each comming request and release it back to the pool after finishs the request. Here is a very good reference about ASP.NET threading model:
\par
\par #Microsoft ASP.NET Threading
\par http://support.microsoft.com/default.aspx?scid=/servicedesks/webcasts/en/transcripts/wct060503.asp
\par
\par Sincerely,
\par
\par Steven Cheng
\par
\par Microsoft MSDN Online Support Lead
\par \tab
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par
\par
\par
\par
\par \pard\li720 --------------------
\par Date: Sat, 26 Jan 2008 23:31:12 -0500
\par From: cj <cj@nospam.nospam>
\par User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
\par MIME-Version: 1.0
\par Subject: Re: multi tasking?
\par
\par
\par This is just an example.
\par
\par Dave wrote:
\par > just remember though, somewhere everything has to add up or you will run out
\par > of one resource or another. having the web app run multi-threaded so users
\par > don't have to wait for it is fine, but if each query still takes 15 seconds
\par > from the database it has to be able to handle the multiple simultaneous
\par > requests also. if the database server can't handle a request every 2 or 3
\par > seconds eventually you will not be able to connect, it will crash, or
\par > something else bad will happen.
\par >
\par > "cj" <cj@nospam.nospam> wrote in message
\par > news:Ov$krh5XIHA.4684@TK2MSFTNGP06.phx.gbl...
\par >> Excellent. I had hoped it would. Now bear with me a minute. If part of
\par >> the processing is to make a sql connection and look up data, I'd assume
\par >> that each thread would make it's own connection--correct?
\par >>
\par >>
\par >> John Saunders [MVP] wrote:
\par >>> "cj" <cj@nospam.nospam> wrote in message
\par >>> news:%23COKHb5XIHA.4896@TK2MSFTNGP06.phx.gbl...
\par >>>> Strictly as an example, suppose I write a web service that takes an
\par >>>> employee number and then does some processing and returns their security
\par >>>> clearance, name, department or some such stuff. Again for arguments
\par >>>> sake say this processing takings about 15 seconds each time. Lastly
\par >>>> assume there are lots of people making inquiries via this web service
\par >>>> and at some times of the day we get a request every 2 or 3 seconds. Can
\par >>>> a web service start a new request if it hasn't finished the previous
\par >>>> one? Is it multi-tasking or multi-threaded by nature or is there
\par >>>> something I need to do to allow it to do this? The object is nobody
\par >>>> should have to wait for a previous request to finish for their request
\par >>>> to start.
\par >>> ASP.NET will start a new worker thread per request.
\par >
\par >
\par \pard
\par
\par }
------=_NextPart_0001_2156C4E1--