all groups > sql server notification services > february 2005 >
You're in the

sql server notification services

group:

10000 notification deliveries...


Re: 10000 notification deliveries... Colin Meek [MSFT]
2/11/2005 7:43:27 AM
sql server notification services: My guess is that the delivery protocol is timing out on these large batches.
You can increase the IHttpDeliveryProtocol "MaxShutdown" argument to prevent
timeouts. For details on configuring the IHttpDeliveryProtocol, see:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlntsv/htm/nsp_advancedtopics_8at1.asp

- Colin Meek [MSFT]

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.

Please do not send a-mail directly to this alias. This alias is for
newsgroup purposes only.
--

[quoted text, click to view]
xmlns="http://www.microsoft.com/MicrosoftNotificationServices/ConfigurationF
ileSchema">
[quoted text, click to view]
<ApplicationDefinitionFilePath>ApplicationDefinition.xml</ApplicationDefinit
ionFilePath>
[quoted text, click to view]
xmlns="http://www.microsoft.com/MicrosoftNotificationServices/ApplicationDef
initionFileSchema">
[quoted text, click to view]
10000 notification deliveries... Mert Sakarya
2/11/2005 10:38:23 AM
I am running NS on a single desktop machine, which hosts NS, SQL Server and
IIS for testing (I know this is not nice deployment environment).
I created 10000 users who are subscribed to an event. I used
HTTPDeliveryProtocol for the notifications created.

The quantum time is 30 secs both for NS and delivery. I have increased the
NotificationThrottle to 11000.
The DigestDelivery and MulticastDelivery are both false. (this is what I
want to test, each Notification is to be handled one by one)
I set the retry schedeule to 30 Secs (which only worked once for failed
events).

I fired the event, everything worked fine and I had 10000 Notification
deliveries to handle...
So NS Started making web requests (on the same development machine).

As result I've had about 200 succesfull deliveries, 800 failed deliveries
(on the second retry, I've 200 more successfull deliveries so I was left
with 600 failed deliveries) and 9000 undelivered notifications (where their
delivery status is 0, - the successful ones are 6 and failed ones are 4, I
believe).
The IIS couldn't handle more... Later NS didn't even tried to handle the
left 9000 deliveries. (Note the numbers are not exact, they are rounded to
100 or to 1000)

Retrying failed delivereies is not a good solution. By assuming the IIS can
handle 100 requests per second, how can I send notifications in group of 100
in every (for example)3 seconds.

For more information, the ICF and ADF files are below:

Regards,
Mert Sakarya

ICF File:

<?xml version="1.0" encoding="utf-8"?>
<NotificationServicesInstance xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.microsoft.com/MicrosoftNotificationServices/ConfigurationFileSchema">
<InstanceName>Content</InstanceName>
<SqlServerSystem>%_SQLServer_%</SqlServerSystem>
<Applications>
<Application>
<ApplicationName>Alerts</ApplicationName>
<BaseDirectoryPath>C:\SQL-NS\Content\Application</BaseDirectoryPath>
<ApplicationDefinitionFilePath>ApplicationDefinition.xml</ApplicationDefinitionFilePath>
<Parameters>
<Parameter>
<Name>_NSServer_</Name>
<Value>%_NSServer_%</Value>
</Parameter>
<Parameter>
<Name>_ApplicationBaseDirectoryPath_</Name>
<Value>C:\SQL-NS\Content\Application</Value>
</Parameter>
</Parameters>
</Application>
</Applications>

<Protocols>
<Protocol>
<ProtocolName>SMS</ProtocolName>
<ClassName>HttpExtension</ClassName>
</Protocol>
</Protocols>

<DeliveryChannels>
<DeliveryChannel>
<DeliveryChannelName>SMSChannel</DeliveryChannelName>
<ProtocolName>SMS</ProtocolName>
<Arguments>
<Argument>
<Name>ProtocolProviderClassName</Name>
<Value>HTTPDeliveryProtocol.HTTPDeliveryProtocol</Value>
</Argument>
<Argument>
<Name>ProtocolProviderAssemblyName</Name>
<Value>C:\SQL-NS\Content\DeliveryProtocol\HttpDeliveryProtocol.dll</Value>
</Argument>
<Argument>
<Name>PostURL</Name>
<!--
<Value>http://localhost/webapplication2/data.aspx</Value> -->
<Value>https://kisamesaj.e-kolay.net/sendsms.aspx</Value>
</Argument>
</Arguments>
</DeliveryChannel>
<DeliveryChannel>
<DeliveryChannelName>FileChannel</DeliveryChannelName>
<ProtocolName>File</ProtocolName>
<Arguments>
<Argument>
<Name>FileName</Name>
<Value>C:\SQL-NS\Content\Output\Notifications\FileNotifications.txt</Value>
</Argument>
</Arguments>
</DeliveryChannel>
<DeliveryChannel>
<DeliveryChannelName>SMTPChannel</DeliveryChannelName>
<ProtocolName>SMTP</ProtocolName>
<Arguments>
<Argument><Name>SmtpServer</Name><Value></Value></Argument>
<Argument><Name>BodyEncoding</Name><Value>utf-8</Value></Argument>
</Arguments>
</DeliveryChannel>
</DeliveryChannels>

</NotificationServicesInstance>


ADF File

<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.microsoft.com/MicrosoftNotificationServices/ApplicationDefinitionFileSchema">
<Version>
<Major>1</Major>
<Minor>1</Minor>
<Build>1</Build>
<Revision>0</Revision>
</Version>
<EventClasses>
<EventClass>
<EventClassName>CategoryEvent</EventClassName>
<Schema>
<Field>
<FieldName>CategoryId</FieldName>
<FieldType>INT</FieldType>
<FieldTypeMods>NOT NULL</FieldTypeMods>
</Field>
</Schema>
</EventClass>
</EventClasses>

<SubscriptionClasses>
<SubscriptionClass>
<SubscriptionClassName>UpdatedContent</SubscriptionClassName>
<Schema>
<Field>
<FieldName>CategoryId</FieldName>
<FieldType>INT</FieldType>
<FieldTypeMods>NOT NULL</FieldTypeMods>
</Field>
</Schema>
<EventRules>
<EventRule>
<RuleName>MatchNewNewsByCategory</RuleName>
<Action>
SELECT dbo.NewContentNotify(
subscriptions.SubscriberId,
N'DefaultDevice',
N'en-US',
content.CategoryName,
content.Description)
FROM CategoryEvent events
JOIN NotificationData..CategoryData content
ON events.CategoryId = content.CategoryId
JOIN UpdatedContent subscriptions ON
subscriptions.CategoryId = content.CategoryId
</Action>
<EventClassName>CategoryEvent</EventClassName>
</EventRule>
</EventRules>
</SubscriptionClass>
<SubscriptionClass>
<SubscriptionClassName>ScheduledContent</SubscriptionClassName>
<Schema>
<Field>
<FieldName>CategoryId</FieldName>
<FieldType>INT</FieldType>
<FieldTypeMods>NOT NULL</FieldTypeMods>
</Field>
</Schema>
<ScheduledRules>
<ScheduledRule>
<RuleName>MatchScheduledContent</RuleName>
<Action>
INSERT INTO
ScheduledContentProcessingTimes(SubscriberId, LastProcessingTime)
SELECT subscription.SubscriberId,
subscription.Created
FROM ScheduledContent subscription
WHERE NOT EXISTS (
Re: 10000 notification deliveries... Shyam Pather [MSFT]
2/11/2005 11:45:49 AM
Actually, I think the meta-question here is how to get NS to work within
defined capacity limits in the output pipe. This depends on the delivery
protocol, but in the case of HTTP, there are two main knobs:

ConnectionLimit and AsyncPosts (both specified in the delivery channel
configuration in the ICF).

ConnectionLimit defines the number of concurrent connections the distributor
may make to the server.
AsyncPosts defines the maximum number of post requests to the server that
may be outstanding at one time.

Also, you can turn down the level of parallelism in the distibutor via the
<ThreadPoolSize> element in the distributor configuration. If you set this
to 1, the distributor can only process one work item at a time. If you use
this in conjunction with the <NotificationBatchSize> element to control
batch size, you can control the number of notifications the distributor
tries to send at once.

It's unfortunate that there isn't a more direct method of controlling these
parameters, but some combination of the above should work for you.

Thanks
-shyam
--
Learn more about SQL-NS:
http://www.amazon.com/exec/obidos/tg/detail/-/0672326647/
---------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
---------------------------------------------
[quoted text, click to view]
AddThis Social Bookmark Button