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

Using multiple worker processes

11 Answers 342 Views
BinaryImage
This is a migrated thread and some comments may be shown as answers.
Håkan
Top achievements
Rank 1
Håkan asked on 16 Sep 2009, 12:29 PM
Hi!
When using BinaryImage deployed on IIS with multiple worker processes (Web Garden) image is not always shown.
I assume it depends on that BinaryImage is using cache object and cache objects only lives in one worker process.
Any solution?

11 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 18 Sep 2009, 05:16 PM
Hi HÃ¥kan,

Unfortunately I was unable to recreate the described behavior locally. Thus it will be appreciated if  you can provide little more information about your scenario and webfarm setup? 

Sincerely yours,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
T.J.
Top achievements
Rank 1
answered on 16 Nov 2009, 11:07 PM
Hello,

I am experiencing the same problem when I tried increasing the number of worker processes I have associated with this particular application pool.

I currently have a SQL Server database acting as my sessionState store and simply increasing my worker processes from 1 to 2, I randomly recieve a red X indicating that the image is missing.  This doesn't happen when I only have 1 worker process.  Unfortunately, I need to increase my worker processes due to memory limitations and the amount of sites I have associated with this pool.  Adding more applications pools is not currently an option due to other contraints.

Is there a setting for the BinaryImage control that can be changed to solve this issue?

Thanks,
T.J.
0
Håkan
Top achievements
Rank 1
answered on 17 Nov 2009, 10:47 AM
We are still experiencing this problem but I have not had time to look into it further.

Our setup is Windows Server 2003, IIS 6 with 2 worker processes in application pool.
Session is stored in ASP.NET State Service.

As T.J. we occasionally recieve a red X indicating that the image is missing. Probably when IIS switches working process for the request. This doesn't happen when we have 1 worker process.
0
BaiH
Top achievements
Rank 1
answered on 18 Nov 2009, 05:09 PM
I thinks this behavior is because RadBinaryImage does use Cache object to temporary store  the binary data. Although I didn't try this myself,  I think you can extend the base behavior by replacing the persister class with your own and not use the caching but some other persistence storage.

-- BH
0
Tad Rhodes
Top achievements
Rank 1
answered on 21 Jul 2010, 07:47 PM
Anyone with an example of extending RadBinaryImage control with a different persistance?   I am experiencing the same issue.  How bout with session?
0
BaiH
Top achievements
Rank 1
answered on 26 Jul 2010, 02:52 PM
I think Session will be workable solution only if it is not InProc. Looking through the reflector, here are few snippets to get you started:

The custom persister and BinaryImageControl:
namespace Samples
{
    public class MyBinaryImagePersister : RadImageHttpCachePersister
    {
        public override BinarImageDataContainer LoadImage()
        {
            //return base.LoadImage();           
 
            if (CurrentContext != null &&
                !string.IsNullOrEmpty(CurrentContext.Request[UrlKey]))
            {
                return (BinarImageDataContainer)CurrentContext.Session[CurrentContext.Request[UrlKey]];
            }
            return null;
        }
 
        public override void SaveImage(byte[] image)
        {
            if (image != null)
            {
                var dataContainer = new BinarImageDataContainer
                {
                    Data = image,
                    ImageName = ImageFileName
                };
                CurrentContext.Session.Add(HttpContext.Current.Server.UrlEncode(ImageKey), dataContainer);
            }
             
        }
    }
 
    public class MyCustomBinaryImage : RadBinaryImage
    {
        IRadImagePersister _persister;
 
        protected override IRadImagePersister ImagePersister
        {
            get
            {
                if (_persister == null)
                {
                    _persister = new MyBinaryImagePersister();
                }
                return _persister;
            }
        }
    }
}

the custom httphandler to consume the persister:
public class MyBinaryImageHandler : Telerik.Web.UI.RadBinaryImageHandler {   
     
    Telerik.Web.UI.IRadImagePersister _persister;
    protected override Telerik.Web.UI.IRadImagePersister ImagePersister
    {
        get
        {
            if (_persister == null)
            {
                _persister = new Samples.MyBinaryImagePersister();
            }
            return _persister;
        }
    }
}

and a simple usage:
<telerik:MyCustomBinaryImage runat="server" ID="MyCustomBinaryImage1" DataValue='<%#Eval("SomeImageData") %>'HttpHandlerUrl="~/MyBinaryImageHandler.ashx" />
0
Dr. Steve
Top achievements
Rank 1
answered on 16 Aug 2013, 02:15 PM
The following solution works for WebGardens with StateServer session mode : http://blogs.telerik.com/aspnet-ajax/posts/13-03-01/integrate-radcontrols-for-asp.net-ajax-in-a-webfarm-or-webgarden

In theory it should also work for WebFarms with SQLServer session mode.
0
Peter
Top achievements
Rank 1
answered on 13 Dec 2013, 01:58 PM
is there a better or full example of how to do this with the binaryimage as the above link doesnt give any help at all.
0
Angel Petrov
Telerik team
answered on 18 Dec 2013, 08:57 AM
Hi Peter,

I am sorry to say but currently there is not ready example which to demonstrate this approach. Note however that we are planing to support WebFarm scenarios and will do our best to include this functionality as soon as possible. In order to speed things up I would like to ask you to vote for this feedback item which concerns the mentioned.

Regards,
Angel Petrov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Shawn Krivjansky
Top achievements
Rank 1
answered on 22 Apr 2014, 11:42 PM
Any movement on this?

Been asking for this for a long long time.

Going to give up on the idea and build my own soon unless there is a delivery date = the next release.
0
Angel Petrov
Telerik team
answered on 25 Apr 2014, 02:32 PM
Hi Shawn,

I am sorry to say but a solution to the problem will not be included in the next official release. The reason for this is that there were other functionalities requested by clients which received more votes thus had a higher priority. If the feedback item gets popular enough we will increase its importance and integrate a solution for the issue as soon as possible.

Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
BinaryImage
Asked by
Håkan
Top achievements
Rank 1
Answers by
Rosen
Telerik team
T.J.
Top achievements
Rank 1
Håkan
Top achievements
Rank 1
BaiH
Top achievements
Rank 1
Tad Rhodes
Top achievements
Rank 1
Dr. Steve
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Angel Petrov
Telerik team
Shawn Krivjansky
Top achievements
Rank 1
Share this question
or