This is a migrated thread and some comments may be shown as answers.

WCF Service Scaling

6 Answers 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Oleg
Top achievements
Rank 1
Oleg asked on 11 May 2017, 12:35 PM

Hello,

We are using Silverlight Report Viewer from Telerik_Reporting_Q3_2014 (the last version we were able to get with license). Our reporting service is implemented as a self-hosted wcf windows service (according to help instructions).

 

We need to scale our implementation across multiple servers and according to documentation we need to implement GetState and SetState inside our own class derived from ReportServiceBase. We have implemented our own service derived from ReportServiceBase and implemented mentioned methods. After some dev testing we found that default implementation and ours implementation both SetState with empty (not populated with data) Telerik.Reporting.Service.ReportServiceHistory record, but as regarding Get state - default implementation return object already populated with data, while ours return exactly the same object as we set (without populated info). As we can see all default implementations of IStateStorage (WebCacheStateStorage, HttpSessionStateStorage, LocalStateStorage) keep not serialized object but reference to it and during report processing this object is updated with new state. In our implementation we are using Redis and in case original object is updated - nothing changes with serialized version in the cache. In order to prove our assumption we implemented another cache as simple Dictionary<string, object> and in this case it works correctly (for single instance). It is obvious that such implementation will not work with multiple instances.

Anyway, we need to share saved state between different instances and it seems to be impossible with our implementation. Have we missed something important? Could someone please help us to understand how service state can be shared (v. Q3 2014)?

Thank you ahead, Oleg.

6 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 11 May 2017, 04:10 PM
Hi Oleg,

Let us start from the hosting of the Reporting WCF service. If you want a single service to operate on multiple machines, host the service in a Web Application. Then host the WebApplication in the web farm.

For web farms, you need to use a proper state mode for the web application - How To: Add Telerik Reporting WCF Service to Web Application. The Reporting WCF service will also use the ASP.NET Session to preserve some resources. Our recommendation is to enable the cache of the Reporting WCF service to ease its work - Configuring Cache or Configuring Custom Cache Provider if you want to use Redis.

Please note that the Reporting WCF service works only with the Silverlight ReportViewer and it has a different mechanism than the Reporting REST Service.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Oleg
Top achievements
Rank 1
answered on 11 May 2017, 05:46 PM

Hi Stef,

Thank a lot you for trying to help me. In our system reporting service is separated from web application for a few of reasons and hosting it as a windows service gives a lot of flexibility. What actually we are trying to achieve is possibility to scale up wcf reporting services behind of load balancer. According to documentation it is possible to share state between different instances of wcf reporting service by implementing SetState and GetState methods. Have we missed something?

Regards, Oleg

0
Stef
Telerik team
answered on 12 May 2017, 04:41 PM
Hi Oleg,

The question is forwarded to the development team.
In case there is an issue with the way reports are stored and updated in the service's cache, please consider switching to a web application, or directing viewer's to different instances (by address) of the service in order to scale.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Stef
Telerik team
answered on 15 May 2017, 08:33 AM
Hi Oleg,

The development team found an issue in the way we store the state of the report, which is logged for improvement in our system.  Your Telerik points are updated to thank you for bringing the issue to our attention.

Until there is a fix, please consider the suggested approaches for scaling with separate self-hosted services on each machine, or with a web application that can be hosted in a web farm.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Stef
Telerik team
answered on 17 May 2017, 01:03 PM
Hello Oleg,

There will be a fix in the next internal build of Telerik Reporting belonging to R2 2017.
Depending on the version you have, the development team suggests that you can override the whole ReportServiceBase and add this.SetState(instanceId, history); after rendering and caching the report and before returning the sessionInfo.

You can see the full implementation of the ReportServiceBase in the source code provided with other resources with each Telerik Reporting Dev version.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Oleg
Top achievements
Rank 1
answered on 18 May 2017, 10:13 AM

Hi Stef,

Thank you for provided information. Let me check whether we can implement suggested solution. I'll get back to you with the result soon.

Regards, Oleg
Tags
General Discussions
Asked by
Oleg
Top achievements
Rank 1
Answers by
Stef
Telerik team
Oleg
Top achievements
Rank 1
Share this question
or