You are on page 1of 2

S36497 - Deployment - Make it easier to scale XAF ASP.

NET applications over multiple Web servers | DevExpress Support Center

25-May-15
Log In

Products

Free Trials & Demos

SUPPORT CENTER

Buy

Support
Tickets

My Account
Examples

About Us
Localization

FAQ

Submit a Support Ticket

Type search string and press Enter

solutions

Training Events

Deployment - Make it easier to scale XAF ASP.NET applications over multiple Web servers
Tags: .NET, Frameworks (XAF & XPO), eXpressApp Framework

ID:
S36497
Created O n :
1/6/2011 1:16:54 PM

Mo dified O n :
3/24/2015 5:11:06 PM

Dennis (DevExpress Support) 5 years ago

Problem description
XAF ASP.NET WebForms UI was designed to build business applications that will be used on local Intranet, for instance within a company. It is not fully
optimized for public internet usage with many simultaneous users.
Technically, an XAF Web application uses the ASP.NET session to store non-serializable service information (XafApplication, WebWindow and many other
entities by means of the IValueManager interface, etc. - see the B221002 ticket for an approximate list of dependencies on the ASP.NET session object)
about the current application state. Maintaining the session state allowed us to deliver a greater functionality and an easier development model to XAF
developers. For instance, you can implement a Controller and access and store a reference to the current View and its controls, ObjectSpace, other
Controllers, etc. without caring a lot about ASP.NET page life cycle specifics. However, the chosen approach has its own drawbacks that may require a bit
more effort from you while addressing certain business requirements such as good scalability, because you cannot use a session state mode other than
InProc.

Current solution
Since the application state cannot be serialized and thus only the InProc session mode can be used, you can load balance web servers and route requests
from clients to the same content server (aka "sticky" sessions). Here is a good blog post on how to do this: http://blog.zerosharp.com/deploy-xaf-asp-dotnet-applications-to-amazon-web-services-part-5-load-balancing/ . We do not provide special guidelines or documentation for this particular scenario as
an XAF Web app is a regular ASP.NET WebForms app that maintains its state within the ASP.NET session. That said, you can look for public community
resources devoted to ASP.NET apps with a similar configuration. For instance, you may find other links under the eXpressApp Framework > Deployment >
Deployment Tutorial > Deployment Troubleshooting Guide article helpful as well.
Proposed solutions/Future considerations:
1. Avoid session state at all. For instance, there may be a lightweight HTML5 web client added with a RESTful service for the backend or a reworked version
of the existing ASP.NET WebForms UI;
2. Decrease memory consumption per user session (see http://documentation.devexpress.com/#Xaf/CustomDocument3172 for more details on the
current memory requiremens);
3. Make it possible to serialize/deserialize session data of XAF ASP.NET applications (support the StateServer and SQLServer session state modes, AppFabric
caching, etc.).
See also:
http://msdn.microsoft.com/en-us/library/ee790954.aspx
http://msdn.microsoft.com/en-us/library/ms178586.aspx

Robert Thomas 2 years ago


W e h ave o ver 1500 u ser acro ss 60 cu sto mers n o w an d w e really n eed to ab ility to take servers in an d o u t o f th e lo ad b alan cer. Righ t n o w if a
server dies, th e u ser is fo rced to lo g o n again . Th is h as b een h ere fo r 4 years. Are th ere an y p lan s to make XAF W eb scalab le in th is scen ario ?
Th an ks.

Dennis (DevExpress Support) 2 years ago


@ Ro b ert: I am afraid I can n o t give an y p ro mises regardin g makin g XAF W eb ap p s stateless an d su ggest yo u co n sider altern atives fo r th is
p articu lar scen ario . W h ile th is scen ario lo o ks h elp fu l o verall, XAF W eb U I w as n o t o rigin ally design ed to b e u sed b y man y co n cu rren t u sers at
a time. Tech n ically, su p p o rtin g th is mean s rew ritin g a lo t o f th in gs n o t to sto re an yth in g w ith in th e ASP.NET sessio n + h u ge b reakin g
ch an ges fo r existin g ap p s as th ere w ill b e a differen t ap p licatio n life cycle an d flo w . In an y even t, w e w ill take yo u r feedb ack in to acco u n t fo r
th e fu tu re.

Robert Anderson 2 years ago


'Scalin g o u t' is easy. It is o n ly 'scalin g in ' w h ich resu lts in dro p p ed sessio n s. Ideally DevExp ress w ill co me u p w ith so me w izardry to p ermit XAF
statelessn ess, b u t mean w h ile h ere are so me su ggestio n s.
Sh o rt term, th e b est so lu tio n is to get th e lo ad b alan cer to h an dle th e gracefu l sh u tdo w n o f a su rp lu s server. W h en a server n eeds to b e
remo ved, th e lo ad b alan cer sh o u ld b e co n figu red to sto p sen din g NEW sessio n s to th e server, b u t co n tin u e to redirect EXISTING sessio n s to
it. Th en w h en th e su rp lu s server even tu ally h as zero sessio n s (b ecau se o f lo go ffs an d sessio n timeo u ts) th en yo u can remo ve it w ith o u t
co n sequ en ces. (Yo u co u ld eith er mo n ito r th e n u mb er o f existin g sessio n s, o r ju st w ait fo r a su itab le lo n g time, e.g., an h o u r b efo re assu min g
all sessio n s are o ver).
U n fo rtu n ately I've n ever go t aro u n d to tryin g to set th is u p , b u t I b elieve it's p o ssib le w ith man y h ardw are lo ad b alan cers o r a reverse p ro xy
su ch as n gin x. Also , it migh t n o t b e to o h ard to w rite yo u r o w n C# lo ad b alan cer (see fo r in stan ce
h ttp ://w w w .co dep ro ject.co m/Articles/318290/Ho w -to -Imp lemen t-Lo ad-B alan cin g-to -Distrib u te-W o rk) w h ich yo u co u ld exten d to h an dle th e
gracefu l sh u tdo w n redirectio n an d mo n ito rin g.
O n a related n o te, th e Elastic Lo ad B alan cer u sed b y th e Amazo n Clo u d do es n o t h ave an y su ch cap ab ilities o u t o f th e b o x, b u t th ere is th is
fo ru m p o st h ttp s://fo ru ms.aw s.amazo n .co m/th read.jsp a?th readID= 61278 w h ich yo u can fo llo w in case th ey su p p o rt it o n e day. (I b elieve th e
same p ro b lems exist w ith Azu re). Yo u migh t also like to read my b lo g p o st o n th e issu e h ttp ://b lo g.zero sh arp .co m/dep lo y-xaf-asp -do t-n etap p licatio n s-to -amazo n -w eb -services-p art-5-lo ad-b alan cin g/

Dennis (DevExpress Support) 2 years ago


Th an ks fo r yo u r additio n al feedb ack an d lin ks, Ro b ert. I th in k it w ill b e h elp fu l fo r o th er u sers w ith th e same requ iremen t u n til an u ltimate
so lu tio n fo r su ch scen ario s is p ro vided.

CM Tee 3 months ago


Pro p o sed so lu tio n s/Fu tu re co n sideratio n s:
3. Make it p o ssib le to serialize/deserialize sessio n data o f XAF ASP.NET ap p licatio n s (su p p o rt th e StateServer an d SQLServer sessio n state
mo des, Ap p Fab ric cach in g, etc.).
1 vo te.

Leave a Comment

https://www.devexpress.com/Support/Center/Question/Details/S36497

1/2

S36497 - Deployment - Make it easier to scale XAF ASP.NET applications over multiple Web servers | DevExpress Support Center

DEVEXPRESS
About Us
News
Our Awards
Upcoming Events
User Comments
Case Studies
Reviews and Publications
Licensing
Purchasing
MVP Program
Contact Us
Logos

.NET CONTROLS
WinForms
ASP.NET
MVC
WPF
Silverlight
Windows 8 XAML
CROSS PLATFORM
Reporting
Document Automation

MOBILE
DevExtreme Mobile

HTML5 JS WIDGETS
DevExtreme Web

ENTERPRISE TOOLS
Report Server
Analytics Dashboard

iOS 7
DataExplorer

FRAMEWORKS
eXpressApp Framework
CODE-DEBUG-REFACTOR
CodeRush for Visual Studio

FUNCTIONAL WEB TESTING


TestCafe
DELPHI C++BUILDER
VCL

25-May-15

SUPPORT
Search the Knowledge Base
My Questions
Code Examples
Getting Started
Demos
Documentation
Blogs
Training
Webinars
Current Version/Build
Version History

FOLLOW US
If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business


Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance
HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether
using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you
build and deliver your best in the shortest time possible.

Your Privacy - Legal Statements

https://www.devexpress.com/Support/Center/Question/Details/S36497

Copyright 1998-2014 Developer Express Inc.


All trademarks or registered trademarks are property of their respective owners

2/2

You might also like