Using multiple worker processes

12 posts, 0 answers
  1. Håkan
    Håkan avatar
    9 posts
    Member since:
    Dec 2008

    Posted 16 Sep 2009 Link to this post

    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?
  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 18 Sep 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. T.J.
    T.J. avatar
    1 posts
    Member since:
    Aug 2008

    Posted 16 Nov 2009 Link to this post

    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.
  5. Håkan
    Håkan avatar
    9 posts
    Member since:
    Dec 2008

    Posted 17 Nov 2009 Link to this post

    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.
  6. BaiH
    BaiH avatar
    83 posts
    Member since:
    Aug 2008

    Posted 18 Nov 2009 Link to this post

    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
  7. Tad Rhodes
    Tad Rhodes avatar
    10 posts
    Member since:
    Jun 2009

    Posted 21 Jul 2010 Link to this post

    Anyone with an example of extending RadBinaryImage control with a different persistance?   I am experiencing the same issue.  How bout with session?
  8. BaiH
    BaiH avatar
    83 posts
    Member since:
    Aug 2008

    Posted 26 Jul 2010 Link to this post

    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" />
  9. Dr. Steve
    Dr. Steve avatar
    1 posts
    Member since:
    Sep 2011

    Posted 16 Aug 2013 Link to this post

    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.
  10. Peter
    Peter avatar
    39 posts
    Member since:
    Jul 2012

    Posted 13 Dec 2013 Link to this post

    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.
  11. Angel Petrov
    Admin
    Angel Petrov avatar
    1007 posts

    Posted 18 Dec 2013 Link to this post

    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
  12. Shawn Krivjansky
    Shawn Krivjansky avatar
    86 posts
    Member since:
    Jan 2010

    Posted 22 Apr 2014 in reply to Angel Petrov Link to this post

    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.
  13. Angel Petrov
    Admin
    Angel Petrov avatar
    1007 posts

    Posted 25 Apr 2014 Link to this post

    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.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017