Skip to main content

Posts

CloudWatch Alarms

This post is part of a bigger topic Autoscaling Publishers in AWS . Autoscaling works based on some metrics. For Tridion Publishers we are going to define a Publish_Alarm  in CloudWatch that uses the custom metric Waiting for Publish  in order to trigger the alarm or not. The alarm defines a threshold that, if passed, sets its state to ALARM. Otherwise, if the metric is below, it sets the state to OK. Based on these states, one can define the Scaling Policies of an Auto Scale Group (more about this in a later post). We are going to create an alarm that monitors the custom metric Waiting for Publish . In the first screen of creating the alarm, we select this metric. On the second screen, we specify the threshold and the duration it takes to consider this alarm triggered. For example, I used a threshold of 1000 items that has to be surpassed for 3 consecutive readings (each reading happening at 1 minute interval). We leave the Actions section empty for now. We...

Publishing Queue metrics in CloudWatch

This post is part of a bigger topic  Autoscaling Publishers in AWS . In order to define autoscaling of some servers, we need some metrics that we can use to create the autoscaling logic, i.e. when to spin up new instances and when to terminate them. A good measure for this, in Tridion terms, is the size of the Publishing Queue. Namely for Publishers autoscaling, it's useful to look at the number of items in the Publishing Queue that are in the state "Waiting for Publish". The approach is to read this metric somehow from the Tridion Content Manager database and make it available in AWS, so that we can use it later. AWS CloudWatch provides a way to define and/or intercept events that can trigger some code execution. The code executed is supposed to read the Publishing Queue and push the count of items into CloudWatch as a custom metric. 1. Define Lambda Function This function represents the code that is executed by the CloudWatch rule. The function reads the size of...

Autoscaling Publishers in AWS

This series of blog posts presents in detail the setup of Tridion Publishers autoscaling as implemented for Amazon Web Services (AWS) infrastructure. Originally, I was inspired by Julian's post about  Using AWS to Scale SDL Web Publishers . I used this post to have an initial setup and then I completed it with more features like license management and more monitoring. These are the steps that I took: Publishing Queue metrics in CloudWatch CloudWatch alarms Launch Configuration License management Auto Scaling Group Scaling Policies Terminate Lifecycle Hook

Running sp_updatestats on AWS RDS database

Part of the maintenance tasks that I perform on a MSSQL Content Manager database is to run stored procedure sp_updatestats . exec sp_updatestats However, that is not supported on an AWS RDS instance. The error message below indicates that only the sa  account can perform this: Msg 15247 , Level 16 , State 1 , Procedure sp_updatestats, Line 15 [Batch Start Line 0 ] User does not have permission to perform this action. Instead there are several posts that suggest using UPDATE STATISTICS instead: https://dba.stackexchange.com/questions/145982/sp-updatestats-vs-update-statistics I stumbled upon the following post from 2008 (!!!), https://social.msdn.microsoft.com/Forums/sqlserver/en-US/186e3db0-fe37-4c31-b017-8e7c24d19697/spupdatestats-fails-to-run-with-permission-error-under-dbopriveleged-user , which describes a way to wrap the call to sp_updatestats and execute it under a different user: create procedure dbo.sp_updstats with execute as 'dbo' as...

AWS RDS Backup Restore

This post describes a backup/restore procedure for the Content Manager database in an Amazon Web Services (AWS) environment). The database is a MSSQL instance running on as Amazon Relational Database Service (RDS). The existing database is from an SDL Tridion 2013 environment, and as such, after the restore in the new SDL Web 8.5 environment, it will have to be upgraded to SDL Web 8.5. Performing the backup implies taking the database offline and executing the stored procedure: exec msdb.dbo.rds_backup_database 'Tridion_cm_2013' , 'arn:aws:s3:::mybackup/Tridion_cm_2013.bak' The procedure is described in http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.Procedural.Importing.html Performing the restore implies executing the following stored procedure in the new RDS database: exec msdb.dbo.rds_restore_database 'Tridion_cm_2013' , 'arn:aws:s3:::mybackup/Tridion_cm_2013.bak' , '' While the restore is running, you ...

Unattended SDL Web 8.5 Installation

In a recent project, we had the requirement to install the SDL Web 8.5 Content Manager and the Publisher using script only (aka an unattended installation). I knew about the existence of such an unattended installation, but I for one, have never attempted it. The feature is clearly documented in http://docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v5/GUID-CE873235-5FE0-489D-A63C-B979919D8F9E . All the prerequisites must still be fulfilled before the actual unattended installation can take place: In Server Manager: Server Roles: Web Server (IIS) Features: .NET Frameowrk 4.6 ASP.NET 4.6 WCF Services (all of them, including other features needed as dependencies) Web Server Role (IIS) Role Services Common HTTP Features (all of them) Health & Diagnostics (all) Performance (all) Security (all) Install Java Runtime Environment Content Manager DB must be created in advance. MTS user must be created in advance. Once all prerequisites are met, I was...

Toolkit - Tricks with Memory Byte Buffer

This post if part of a series about the  File System Toolkit  - a custom content delivery API for SDL Tridion. In previous post Writing My Own Database Engine , I quickly mentioned the use of Memory Byte Buffer from Jana NIO that provides fast access to a file by mapping its content to memory. This post goes into more detail over some tricks that occurred with that implementation. There is an issue with Memory Byte Buffer. Namely, once it is created by calling FileChannel.map method, it cannot be unmapped, closed or discarded. The byte buffer will exist until it is garbage collected. From the JavaDoc: A mapping, once established, is not dependent upon the file channel that was used to create it. Closing the channel, in particular, has no effect upon the validity of the mapping. A mapped byte buffer and the file mapping that it represents remain valid until the buffer itself is garbage-collected. The issue is affects Windows OS Java implementations, in the sens...