Windows Server AppFabric

handsgridServers

Dec 4, 2013 (3 years and 8 months ago)

323 views

GLOBALLOGIC

Windows Server
AppFabric

Hosting features for WCF
services


Pallav Kumar

2/22/2013






Windows Server AppFabric is a set of extensions for Windows Server that includes caching and hosting
services for services based on Windows Communication Foundation (WCF) and Windows Workflow
Foundation (WF). This
manuscript

talks about the
Hosting

feature
s provided by AppFabric for WCF
services.

WHAT

AppFabric is a set of middleware technologies for Windows Server, released by Microsoft. It consists of
two main feature areas:



AppFabric Hosting



AppFabric Caching


AppFabric also integrates with Inte
rnet Information Services (IIS) providing management and monitoring
tools within the IIS management console.


We can employ
AppFabric

to facilitate the management of WCF services.

For WCF, the AppFabric
Hosting

feature provides two main capabilities:



Host
ing
-

add service management extensions to Internet Information Services (IIS), Windows
Process Activation Service (WAS), and the .NET Framework 4
.




Monitoring

-

Monitoring stores and correlates service events in a backend database. This
facilitates analys
is and troubleshooting of the coordination of multiple WCF services


The tooling for services hosted in AppFabric allows you to monitor your applications and to manage
security, auto
-
start activation, performance, and service endpoints. The AppFabric hosti
ng services
provide hierarchical management using inheritance of configuration files, so you don’t need to access
the files directly.




WHERE

We install AppFabric on web
-
server
,

which host the WCF services and serve the requests from the
clients.




WHEN

It is useful when we need to know
:




Which WCF services are hosted?



What are the endpoints exposed
?



Which operations of WCF
are frequently called
?



W
hich
operation of WCF service is taking how much time
?



How many

Exceptions, Faults occurred?


In IIS, there
is separate section for AppFabric.



AppFabric Dashboard


For WCF services, it gives you details of Completed Calls, errors, exceptions
and throttle hits. You can drill down to the Tracked Events section to view the further details.

Endpoints


Help you

to manage configured endpoints.

Services


View and Configure WCF services.



HOW

The AppFabric runtime component uses
Event Collection service

to capture the ETW events emitted by
WCF
service

and

writes it to a single staging table in the monitoring database. A SQL Agent job
continuously runs and checks for new event records in the staging table, parses the event data, and
moves it to the long
-
term storage WCF.

Data is displayed on dash
board.




WHY

The hosting
features of AppFabric for WCF services have

following advantages/disadvantages.

Advantages:



Only for Win2008 Enterprise licenses



Highly configurable



It’s supported my Microsoft (not open source)

Disadvantages:



Its only run with windows 2008 R2 (does not run on Windows Server 2003)



It requires at least as much work to setup as other solutions (which isn’t much work for very
basic operations)

Value Addition
:

AppFabric adds direct value monitoring
service activit
y and errors, providing 5 different scenario based
levels of logging, including custom
.

Windows Server AppFabric, you can choose five monitoring levels:



Off

has the same effect as disabling monitoring and is best used in scenarios that need minimal
trackin
g overhead.



Error Only

gives visibility to only critical events like errors and warnings. This mode is best for
high
-
performance scenarios that need only minimal error logging.



Health Monitoring

is the default monitoring level and contains all the data cap
tured at the
Errors Only level, plus some additional processing data.



End
-
to
-
End Monitoring

contains all data from level Health Monitoring plus additional
information to reconstruct the entire message flow. This is used in scenarios where a service
calls a
nother service.



Troubleshooting
, as the name suggests, is the most verbose level and is useful in scenarios
where an application is in an unhealthy state and needs to be fixed.



Architecture Diagram

The following architectural diagram shows the parts of A
ppFabric as well as the .NET Framework 4 and
IIS components that are used by AppFabric:







AppFabric Dashboard
-

WCF Call History



The
WCF Call History

section displays historical statistics derived from WCF call events stored in one or more
Monitoring databases. The displayed values are summaries of historical data from all the databases included in the
current scope. If the current scope includes servi
ces that are configured to use different monitoring databases,
then the values shown in the
WCF Call History

section include data contributed by all the databases in scope.


This section displays a summary of WCF call history for .NET Framework WCF servic
es that have monitoring
enabled. It provides a summary of all WCF
Completed Calls
,
Errors
, and
Throttle Hits

within the time frame
selected in the
Time Period

drop
-
down list. Clicking any of these summary links takes you to the corresponding
Tracked Events

Page

with query result data specific to the originating category. Expanding the
WCF Call History

section displays the top five services with the most WCF Completed Calls and WCF Service Exceptions. It also
provides a breakdown of Errors by Service Excepti
ons (mostly caused by Failed or Faulted Calls) and User Defined
Errors.

Summary Metrics

The following table describes the summary metrics for WCF Call History.


Summary
Metric

Description

Completed


Total number of calls completed in the selected time
period.

Throttle Hits


Total number of throttle hits that occurred in the selected time period.

When one of the main service throttle counters (MaxConcurrentCalls, MaxConcurrentInstances,
or MaxConcurrentSessions) have been initially exceeded, the
201: M
essageThrottleExceeded

event is emitted. When the spike of activity slows so that the current value of the throttle is at 70
percent of the current limit then a
224: MessageThrottleAtSeventyPercent

event is emitted. This
event is only emitted one time as t
he throttling activity is slowing down. If the current value
averages around the 70 percent mark (e.g. 70, 69, 70, 71, 70, 69) only the first dip to 70 percent
results in an event. After this event is emitted, any future occurrences of exceeding the thrott
le's
limit will result in another emission of a
201: MessageThrottleExceeded

event.

Errors


Total number of errors that occurred in the selected time period.


Expanded Area Metrics

-

The following table describes the expanded area metrics displayed in the columns in the expanded area. For the
Completed Calls

and the
Service Exceptions

EAM columns, the top five service instances for those categories are
displayed in descending order. Th
ese two columns show the top five services with the highest number of calls or
exceptions over the selected time period. For the
Errors


Grouped by common types

EAM column the data is
shown associated with a service exception.


Metric

Display Value

Completed Calls
,
Grouped by Service
Service virtual path and Web site, count of WCF calls. Displays the top five services in
descending order with instances with the most completed WCF calls.

You can click on a count to open the
Tracked Events Page

to obtain more detailed information. A filter is
automatically applied to show calls rel
ated to the service you clicked.





(top 5)

Errors

-

Grouped
by common types

Displays a breakdown o
f the number of errors by
Service Exceptions

and
User Defined
Errors
. Service Exceptions are broken down by the common causes of
Calls Failed

and
Calls
Faulted
. Additional issues, such as activation issues, can also contribute to the number of
Service Exce
ptions which are not displayed in the breakdown of Service Exceptions.

Service Exceptions
,
Grouped by Service
(top 5)

Service virtual path and Web site, count of WCF calls. Displays the top five services in
descending order with instances with the most
WCF service exceptions.

Configuration


1.

Install Window
s
Server Application Fabric on the web
-
se
r
ver.

2.

Open
ConfigureFabric

from the program menu.

a.

In the Hosting service section, check the
Set monitoring configuration

checkbox. & add
Event
Collector

service account. Set the
Monitoring provider
.

b.

Skip the caching section.

c.

In application section check the
Start IIS manager

checkbox.

3.

In IIS, right click on Service virtual directory and Manage WCF and WF service


Configure.

a.

In Monitoring section

check
write events to database

and select connection string.

b.

Select the level, default is
Health Monitoring



4.

Add
monitoring section in the service’s config file
.

<
microsoft.applicationServer
>


<
monitoring
>


<
default

enabled
=
"
true
"

connectionStringName
=
"
ApplicationServerMonitoringConnectionString
"

monitoringLevel
=
"
EndToEndMonitoring
"

/>


</
monitoring
>


</
microsoft.applicationServer
>

For Testing WCF service
: use WCFTestClient.exe


For Dashboard reset
:

Delete [<AppFabricDBName>
].[ASWcfEventsTable]

Example:
delete [AppFabricMonitoringStoreDB].[dbo].[ASWcfEventsTable]



Ref
erence links


Download
:




http://www.microsoft.com/en
-
us/download/details.aspx?id=15848

(
Windows Server 2008 R2
x64
-

WindowsServerAppFabricSetup_x64_6.1.exe
)


Trouble shooting
:




http://stackoverflow.com/questions/4508576/i
-
think
-
i
-
configured
-
appfabric
-
correctly
-
but
-
nothing
-
is
-
happening
-
on
-
appfabric
-
d



http://blogs.msdn.com/b/appfabriccat/archive/2010/08/13/windows
-
server
-
appfabric
-
monitoring
-
purging
-
of
-
appfabric
-
monitoring
-
data
-
don
-
t
-
get
-
caught.aspx

Monitoring Details:



http://msdn.microsoft.com/en
-
us/library/ee677276%28v=azure.10%29.aspx

WCF
Call History

section details:



http://msdn.microsoft.com/en
-
us/library/ee677282%28v=azure.10%29.aspx