Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Graham Carr 277 posts 389 karma points
    Feb 23, 2016 @ 16:54
    Graham Carr
    0

    Umbraco speed and unpublished content

    I am experiencing large performance issues with a site I have developed which is essentially a vacancy portal. The site is running on V7.1.4 and makes heavy use of showing unpublished content both in backend custom user controls and on the front-end to allow schools to view applications, etc. for closed vacancies (these are unpublished when closed) and for candidates to view applications on closed vacancies.

    The only way I could find to search for and parse through both published and unpublished nodes was to use the ContentService, however I know that this is heavy on the database with the UmbracoHelper being much lighter as it uses the XML cache.

    Can anyone provide me with some insight/help into how I may go about increasing the speed of the site which I believe is due to the heavy use of the ContentService for previous reasons highlighted.

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Feb 23, 2016 @ 17:10
    Simon Dingley
    0

    If you are only querying content using the ContentService have you considered using the InternalSearcher Examine Search Provider referenced in ExamineSettings.config instead? This should allow you to query the examine index which supports unpublished and protected content?

    Unless of course someone can advise whether or not querying via the ContentService already does this?

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Feb 23, 2016 @ 17:12
    Dave Woestenborghs
    1

    Examine is a option.

    But maybe you can add a closed checkbox to the vacancy doctype. Instead of unpublishing you can use this to "close" the vacancy. This way the content stays published.

    Of course you need to handle that the content isn't visible anymore on the website.

    Dave

  • Graham Carr 277 posts 389 karma points
    Feb 24, 2016 @ 15:42
    Graham Carr
    0

    Thanks for the replies, they are useful things for me to consider, it is just a real shame that there is no quick way of returning both published/unpublished content via the UmbracoHelper.

    As an aside, the performance issues I am only seeing in the client's environment, if I run the site locally on my work's machine, my own laptop or the development server the speed is much improved.

    The clients environment is as follows:

    Web Server:
    -Windows Server 2008 R2
    -IIS 7.5
    -2x vCPU
    -4GB RAM
    
    SQL Server:
    -Windows Server 2008 R2
    -SQL Server 2012 SP3
    -2x vCPU
    -16GB RAM
    

    The servers are shared with other systems so these won’t get all the resources.

    Can anyone see any issues with this setup that could cause performance issues?

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Feb 24, 2016 @ 15:44
    Dave Woestenborghs
    0

    Hi Graham,

    Using the content service in the front end is actually a no go IMHO.

    With a active site you will see performance issues garantueed.

    I think you should rethink your solution...maybe something I suggested in my previous answer.

    Dave

  • Graham Carr 277 posts 389 karma points
    Feb 24, 2016 @ 15:52
    Graham Carr
    0

    Hi Dave,

    I agree when it comes to read only data, however surely you need to utilise the content server, member service and media service in the front-end if you have functions for moving, creating and publishing content. An example being the facility to add a vacancy via the employers account area?

    I will look to change the way the website works for the read-only functions that seem to be running slow, however it is also functions as described above (adding a new vacancy) that are running slowly but I can't change the way this works, well not that I know of anyway. An example being, which adds a new vacancy application record to the website, and also adds the uploaded application to the candidates folder in the media section:

                // Create new application, associate to candidate and associate with media item created above
                var username = UmbracoContext.HttpContext.User.Identity.Name;
                var fullname = Members.GetByUsername(username).Name;
    
                // Create media item and upload to it
                var mediaService = ApplicationContext.Current.Services.MediaService;
                var fileName = Path.GetFileName(applicationform.FileName);
    
                // find the corrrect candidate media item folder
    
                var candidateapplicationfolders = mediaService.GetChildren(Convert.ToInt32(ConfigurationManager.AppSettings["CandidateMediaFolderRootNodeId"])).Where(x => x.Name == username);
                var mediaid = 0;
                foreach (var item in candidateapplicationfolders.Where(item => item.Name == username))
                {
                    mediaid = item.Id;
                }
    
                if (mediaid == 0)
                {
                    var folder = mediaService.CreateMedia(username, Convert.ToInt32(ConfigurationManager.AppSettings["CandidateMediaFolderRootNodeId"]), "CandidateApplicationFolder");
                    mediaService.Save(folder);
                    mediaid = folder.Id;
                }
    
                var media = mediaService.CreateMedia(fileName, mediaid, "CandidateApplication");
                media.SetValue("umbracoFile", applicationform);
                mediaService.Save(media);
    
                var contentService = ApplicationContext.Current.Services.ContentService;
                var application = contentService.CreateContent(fullname + " (" + username + ")", Convert.ToInt32(Request["vacancyid"]), "VacancyApplication");
                application.SetValue("pageHeading", fullname + " (" + username + ")");
                application.SetValue("candidate", Members.GetCurrentMemberId());
                application.SetValue("applicationForm", media.Id);                                
                contentService.SaveAndPublishWithStatus(application);
    

    Thanks,

    Graham

Please Sign in or register to post replies

Write your reply to:

Draft