2
Tags: .NET , Frameworks (XAF & XPO) , eXpressApp Framework ID: S36497 Created On: 1/6/2011 1:16:54 PM Modified On: 3/24/2015 5:11:06 PM SUPPORT CENTER FAQ Training Events Localization Examples Tickets Submit a Support Ticket Submit a Support Ticket Type search string and press Enter 0 solutions Deployment - Make it easier to scale XAF ASP.NET applications over multiple Web servers 2 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-dot- net-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 We have over 1500 user across 60 customers now and we really need to ability to take servers in and out of the load balancer. Right now if a server dies, the user is forced to log on again. This has been here for 4 years. Are there any plans to make XAF Web scalable in this scenario? Thanks. Robert Thomas 2 years ago @Robert: I am afraid I cannot give any promises regarding making XAF Web apps stateless and suggest you consider alternatives for this particular scenario. While this scenario looks helpful overall, XAF Web UI was not originally designed to be used by many concurrent users at a time. Technically, supporting this means rewriting a lot of things not to store anything within the ASP.NET session + huge breaking changes for existing apps as there will be a different application life cycle and flow. In any event, we will take your feedback into account for the future. Dennis (DevExpress Support) 2 years ago 'Scaling out' is easy. It is only 'scaling in' which results in dropped sessions. Ideally DevExpress will come up with some wizardry to permit XAF statelessness, but meanwhile here are some suggestions. Short term, the best solution is to get the load balancer to handle the graceful shutdown of a surplus server. When a server needs to be removed, the load balancer should be configured to stop sending NEW sessions to the server, but continue to redirect EXISTING sessions to it. Then when the surplus server eventually has zero sessions (because of logoffs and session timeouts) then you can remove it without consequences. (You could either monitor the number of existing sessions, or just wait for a suitable long time, e.g., an hour before assuming all sessions are over). Unfortunately I've never got around to trying to set this up, but I believe it's possible with many hardware load balancers or a reverse proxy such as nginx. Also, it might not be too hard to write your own C# load balancer (see for instance http://www.codeproject.com/Articles/318290/How-to-Implement-Load-Balancing-to-Distribute-Work ) which you could extend to handle the graceful shutdown redirection and monitoring. On a related note, the Elastic Load Balancer used by the Amazon Cloud does not have any such capabilities out of the box, but there is this forum post https://forums.aws.amazon.com/thread.jspa?threadID=61278 which you can follow in case they support it one day. (I believe the same problems exist with Azure). You might also like to read my blog post on the issue http://blog.zerosharp.com/deploy-xaf-asp-dot-net- applications-to-amazon-web-services-part-5-load-balancing / Robert Anderson 2 years ago Thanks for your additional feedback and links, Robert. I think it will be helpful for other users with the same requirement until an ultimate solution for such scenarios is provided. Dennis (DevExpress Support) 2 years ago Proposed solutions/Future considerations: 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.). 1 vote. CM Tee 3 months ago Leave a Comment Products Free Trials & Demos Buy Support My Account About Us Log In S36497 - Deployment - Make it easier to scale XAF ASP.NET applications over multiple Web servers | DevExpress Support Center 25-May-15 https://www.devexpress.com/Support/Center/Question/Details/S36497 1 / 2

S36497 - Deployment - Make It Easier to Scale XAF ASP.net AP

  • Upload
    tas-pro

  • View
    35

  • Download
    4

Embed Size (px)

DESCRIPTION

a

Citation preview

  • Tags: .NET, Frameworks (XAF & XPO), eXpressApp FrameworkID :S36497

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

    Mod if ied O n :3/24/2015 5:11:06 PM

    SUPPORT CENTER FAQTraining EventsLocalizationExamplesTickets

    Submit a Support TicketSubmit a Support TicketType search string and press Enter

    0solutions

    Deployment - Make it easier to scale XAF ASP.NET applications over multiple Web servers

    2 Dennis (DevExpress Support) 5 years ago

    Problem descriptionXAF 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 fullyoptimized 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 otherentities 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 XAFdevelopers. For instance, you can implement a Controller and access and store a reference to the current View and its controls, ObjectSpace, otherControllers, etc. without caring a lot about ASP.NET page life cycle specifics. However, the chosen approach has its own drawbacks that may require a bitmore effort from you while addressing certain business requirements such as good scalability, because you cannot use a session state mode other thanInProc.

    Current solutionSince the application state cannot be serialized and thus only the InProc session mode can be used, you can load balance web servers and route requestsfrom 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-dot-net-applications-to-amazon-web-services-part-5-load-balancing/ . We do not provide special guidelines or documentation for this particular scenario asan 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 communityresources 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 versionof the existing ASP.NET WebForms UI;2. Decrease memory consumption per user session (see http://documentation.devexpress.com/#Xaf/CustomDocument3172 for more details on thecurrent memory requiremens);3. Make it possible to serialize/deserialize session data of XAF ASP.NET applications (support the StateServer and SQLServer session state modes, AppFabriccaching, etc.).

    See also:

    http://msdn.microsoft.com/en-us/library/ee790954.aspx

    http://msdn.microsoft.com/en-us/library/ms178586.aspx

    W e h ave over 1500 u ser across 60 cu stomers n ow an d w e rea lly n eed to ab ility to take servers in an d ou t o f th e load balan cer. R igh t n ow if aserver d ies, th e u ser is fo rced to log on again . Th is h as been h ere fo r 4 years. Are th ere an y p lan s to make XAF W eb sca lab le in th is scen ario?

    Th an ks.

    Robert Thomas 2 years ago

    @ Robert: I am afra id I can n o t g ive an y p romises regard in g mak in g XAF W eb apps stateless an d su ggest you con sider a ltern atives fo r th isparticu lar scen ario . W h ile th is scen ario looks h elp fu l overa ll, XAF W eb U I w as n o t o rig in a lly design ed to be u sed by man y con cu rren t u sers ata time. Tech n ica lly, su pportin 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 session + h u ge b reak in gch an ges fo r existin g apps as th ere w ill be a d if feren t app lication life cycle an d f low . In an y even t, w e w ill take you r feedback in to accou n t fo rth e fu tu re.

    Dennis (DevExpress Support) 2 years ago

    'Sca lin g ou t' is easy. It is on ly 'sca lin g in ' w h ich resu lts in d ropped session s. Ideally DevExp ress w ill come u p w ith some w izard ry to permit XAFstatelessn ess, bu t mean w h ile h ere are some su ggestion s.

    Sh o rt term, th e best so lu tion is to get th e load balan cer to h an d le th e g racefu l sh u tdow n o f a su rp lu s server. W h en a server n eeds to beremoved , th e load balan cer sh ou ld be con f igu red to stop sen d in g NEW session s to th e server, bu t con tin u e to red irect EXISTING session s toit. Th en w h en th e su rp lu s server even tu ally h as zero session s (becau se o f logo ffs an d session timeou ts) th en you can remove it w ith ou tcon sequ en ces. (You cou ld eith er mon ito r th e n u mber o f existin g session s, o r ju st w ait fo r a su itab le lon g time, e.g . , an h ou r befo re assu min gall session s are over).

    U n fo rtu n ately I've n ever go t arou n d to tryin g to set th is u p , bu t I believe it's possib le w ith man y h ardw are load balan cers o r a reverse p roxysu ch as n g in x. Also , it migh t n o t be too h ard to w rite you r ow n C# load balan cer (see fo r in stan ceh ttp ://w w w .codepro ject.com/Articles/318290/How -to-Imp lemen t-Load-B alan cin g-to -D istribu te-W ork ) w h ich you cou ld exten d to h an d le th eg racefu l sh u tdow n red irection an d mon ito rin g .

    O n a related n o te, th e E lastic Load B alan cer u sed by th e Amazon Clou d does n o t h ave an y su ch capab ilities ou t o f th e box, bu t th ere is th isfo ru m post h ttps://fo ru ms.aw s.amazon .com/th read .jspa?th read ID= 61278 w h ich you can fo llow in case th ey su pport it on e day. (I believe th esame p rob lems exist w ith Azu re). You migh t a lso like to read my b log post on th e issu e h ttp ://b log .zerosh arp .com/dep loy-xaf-asp-do t-n et-app lication s-to -amazon -w eb-services-part-5-load-balan cin g/

    Robert Anderson 2 years ago

    Th an ks fo r you r add ition al feedback an d lin ks, Robert. I th in k it w ill be h elp fu l fo r o th er u sers w ith th e same requ iremen t u n til an u ltimateso lu tion fo r su ch scen ario s is p rovided .

    Dennis (DevExpress Support) 2 years ago

    Proposed so lu tion s/Fu tu re con sideration s:

    3. Make it possib le to seria lize/deseria lize session data o f XAF ASP.NET app lication s (su pport th e StateServer an d SQLServer session statemodes, AppFabric cach in g , etc.).

    1 vo te.

    CM Tee 3 months ago

    Leave a Comment

    Products Free Trials & Demos Buy Support My Account About Us

    Log In

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

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

  • DEVEXPRESSAbout UsNewsOur AwardsUpcoming EventsUser CommentsCase StudiesReviews and PublicationsLicensingPurchasingMVP ProgramContact UsLogos

    .NET CONTROLSWinFormsASP.NETMVCWPFSilverlightWindows 8 XAML

    CROSS PLATFORMReportingDocument Automation

    MOBILEDevExtreme Mobile

    ENTERPRISE TOOLSReport ServerAnalytics Dashboard

    FRAMEWORKSeXpressApp Framework

    CODE-DEBUG-REFACTORCodeRush for Visual Studio

    HTML5 JS WIDGETSDevExtreme Web

    iOS 7DataExplorer

    FUNCTIONAL WEB TESTINGTestCafe

    DELPHI C++BUILDERVCL

    SUPPORTSearch the Knowledge BaseMy QuestionsCode ExamplesGetting StartedDemosDocumentationBlogsTrainingWebinars

    Current Version/BuildVersion History

    FOLLOW US

    Your Privacy - Legal Statements Copyright 1998-2014 Developer Express Inc.All trademarks or registered trademarks are property of their respective owners

    DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, BusinessApplication Frameworks, and Reporting Systems for Visual Studio, along with high-performanceHTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whetherusing WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help youbuild and deliver your best in the shortest time possible.

    If you need additional product information, write to us at [email protected] or call us at +1 (818) 844-3383

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

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

    Deployment - Make it easier to scale XAF ASP.NET applications over multiple Web servers