February Meetup – Ian Robinson talk on Umbraco

0bc8ad1Umbraco is one of the most popular open source ASP.Net CMS products on the market. Used by the likes of Microsoft, Peugeot, Costa, and Heinz, it has been around for over 10 years and has a vibrant and active community of tens of thousands of developers. The software itself can be installed on dedicated servers, VMs or in the cloud, with the latest offering being “Umbraco as a Service”.

In this talk we will look at what you can use Umbraco for, the community that surrounds it, how you install and configure it, customising the look and feel of your website, how to add features using plugins from the community, and how to extend the back office yourself using C#, JavaScript and HTML.

Ian is the director of Chilli Information Solutions Ltd (www.chilli-is.co.uk) and has been developing software for over 15 years, going freelance 7 years ago. He specialises in the healthcare sector, developing e-learning, web applications, and HL7 integration solutions for clients such as Health Education England, the University Hospital of North Midlands NHS Trust, Staffordshire and Stoke-on-Trent Partnership NHS Trust, the Royal College of Anaesthetists and the Royal College of Obstetricians and Gynaecologists.

How to Speed up .Net and SQL Server Web Apps – An Overview

Webartread‘ve been running Derbyshire Dot Net for a number of years now and I thought it was about time that we started giving an overview of the evening’s talks, and this is something I’ll be looking to do every month from now on.

On 27th October 2016 we were hosting Bart Read who was giving a presentation on “How to Speed up .Net and SQL Server Web Apps”. The talk was scenario based and was focussed on how Bart had diagnosed performance problems for a number of his consulting clients. The group was very impressed with Bart’s presentation as he seemed to make what could be quiet a dry subject into an entertaining speech.

SQL Query Performing Slowly

The first scenario Bart introduced was that of a Customer Support Centre application. It was a traditional 3-tiered architecture (Asp.Net, nHibernate, and SQL Server) in which the SQL Server database had a linked server which was accessed via a SQL Synonym.

First, he took the application server out of the load balancer so that he could isolate performance profiling without affecting production systems. Then, using ANTS Performance Profiler, he was able to establish that there was a particular SQL query that was taking upwards of 40 seconds to complete.

Now that he had the badly performing SQL query he needed the actual parameters that were used. The individual parameters could influence the performance of the system due to indexing strategies, how SQL Server builds its statistics and many other variables. He ran Microsoft’s SQL Server Profiler tools which allows you to collect all commands sent to SQL server and recommended that you filter by Application Name (as defined in web.config), DatabaseName and potentially where time taken is greater than a defined threshold. The suggestion was made that you capture the following events in SQL Profiler:

  • SQL Batch Started
  • SQL Batch Complete
  • RPC Statement Complete

A really useful tip from this section of the talk was that there is the option to save the profile to a ‘Trace Table’. The trace table is just a standard database table that the profiler writes to which allows you finer grained control over filtering the result set because you can run SQL queries against it.

At this point Bart explained that in some cases your application may run really slow, but when you run the SQL statement in SQL Server Management Studio it runs extremely quickly. This is due to how SQL server creates execution plans and caches them. SQL server takes a query and using statistics it has collected over time and determines the most efficient query execution plan. This plan is then stored in a cache which is implemented as a hash table. The hash key is made up of a number of factors including the query to be executed. If the query is formatted differently (e.g. has a line break) then it will produce a different hash value and will not find the plan in the cache.

After this he explained that he then went on to analyse the actual execution plan and found that there was a query filtering a table on the linked server. However, as it was a table on the linked server and not on the current database it was retrieving all 600,000 record for each request before filtering. The accepted solution in this case was to create a table valued function in the linked server and do the filtering on the correct database.

Diagnosing a .Net Memory Leak

The second scenario was for the same client but they had an issue with a .Net memory leak that they were unable to locate. This time Bart used the ANTS Memory profiler tool which allowed him to take a snapshot of memory before the offending operation and after. In this particular scenario it was identified that the issue was that the client was using Castle Windsor dependence injection with a transient lifestyle when they should have been using PerRequest. However, this part of the talk was probably the highlight due to a detailed but clearly understandable explanation of .Net Garbage Collection using the mark and sweep algorithm.

One of the key takeaways from this section was how misused the method GC.Collect() was, as it just moves Gen0 objects into Gen1 stores so will likely slow down the application more.

…and the rest

The following few scenarios weren’t quite as in depth but covered issues with deadlocking, network latency and issues with the code due to unnecessary caching. The talk finished with a roundup of browser based performance focussing on how JSFrameworks (Angular, React et al) files needing to be downloaded could affect performance. It was also discussed that javascript is subject to the same rules regarding garbage collection as mentioned earlier and google chrome browser has built in developer tools for taking memory profile snapshots.

All in all this was a very informative talk and I’d have no qualms recommending this talk for another user group. The slides are available for download at http://www.slideshare.net/bartread/longer-version-2-x-45-mins-with-break-how-to-speed-up-net-and-sql-server-web-apps. If you have any questions please feel free to get in touch with Bart ([email protected]). Bart is available for performance consultancy gigs, should you find yourself in need.

Next Meetup – Bart Read – Speed up .NET and SQL Server Web Apps

October 27th 2016 – 6.30PM

Reserve your Place at Meetup

Bart talks about the techniques used to identify, troubleshoot, and fix performance problems in web apps across the whole stack, and illustrate these with a number of real world examples.

Bart works from his home near Cambridge in the UK as an independent consultant, entrepreneur and tech writer. He also contributes to the open source Node Tools for Visual Studio project hosted on CodePlex.

My expertise is in .NET, web, and mobile, and I’m always looking for new technologies to learn, use, and write about. As a result you’ll often find me at local developer community events.

Previously he worked at Red Gate Software for nearly 10 years – a company making tools for developers and DBAs. Over that time he was a developer, project manager, and product manager, but he also helped out with technical recruitment, and even ran the IT department for a while. He’s worked on some great products for .NET developers over the years:Nomad for Visual Studio.NET ReflectorANTS Performance ProfilerANTS Memory Profiler, along with many of Red Gate’s SQL tools.

Thanks to Red Gate Software we have a number of prizes to give away on Thursday including:

Hope to see you there!

Next Meetup -Andrew Bullock – Writing Robust Systems

July 28th 2016 – 6.30PM

Reserve your Place at Meetup

Building stable systems can be hard, but much of the difficulty can stem from poor design rather than implicit complication.

In this talk Andrew will be covering design patterns, processes and considerations for building stable, fail-well software.

Hopefully you’ll take away useful ways of thinking about software design and implementation, along with some helpful code snippets and patterns to enable you to get some quick wins as well as long term improvements.

Twitter @trullock

Next Meetup – Richard Wilde – Web UI Testing with CasperJS

The next meetup of Derbyshire DotNet is tomorrow (30th June 2016) 18:30 at the Greyhound Pub on Friargate. We will be welcoming Richard Wilder of wildesoft.net who will be delivering the talk below:

Unit testing helps us when writing any sort of application, however we often we end up writing unit tests for small pieces of logic that don’t really matter and sometimes miss out on the bigger picture. We tend to shy away from Web UI testing as the feedback loop is just too slow. In this presentation we will look at a toolset that gives us both end-to-end testing that aims to give us far faster feedback.

Welcome to the CasperJS a navigation and testing utility written in JavaScript, which plays nicely alongside PhantomJs, a headless WebKit Browser

The promise is simple wouldn’t it be nice to be able to perform some UI testing before you commit your code to source control?

About Richard Wilde

Richard started programming during the home computing era with a ZX81. He has been running his own software company called wildesoft.net since 2004 and has a lot of experience delivering Microsoft based solutions for all aspects of businesses. He is also the co-founder of Smart Devs a user group based in Hereford. He also hangs out on twitter @rippo

Crpytography in .NET Talk at NDC London

Back in January I had the opportunity to speak at the NDC London conference at the Excel centre. The Video recording of my talk at NDC London is now available to watch on-line. This was my first major conference so it was a little scary, but I really enjoyed the experience. The room was about 2 thirds full and I got an excellent speaker rating at the end so I must have done something right.

Next Meetup – SQL Azure by Tobiasz Koprowski (Data Platform MVP)

tobiaszThe next meetup of Derbyshire DotNet is tonight at 18:30 at the Institute for Innovation in Sustainable Engineering and the talk will be separated into two parts, but will focus on SQL Azure, SQL Server and Cloud Services.

In the first session Tobiasz will introduce everyone to the technology formerly known as SQL Azure (now Windows Azure SQL Database). Then under a Tips and Trick session he will show which points, features, compatibility and non-compatibility for SQL Azure which are important for DBA’s.

He will also cover the functionalities, performance, cost, and SLA and security aspects. Then after a short break he will demonstrate how we can work with our data in the Cloud using SQL Azure, Blob Storage, and the functionalities of backup, restore, encryption and availability. We will learn how we can implement a hybrid environment and when and why it is (or not) good practice. And, finally we will find a few minutes for discussion about future of the DBA.

Tobiasz is an Independent Consultant and CEO of Shadowland Consulting. Community leader focused on SQL Server, SharePoint, security, Cloud & collaboration solutions, and ITIL, DR, BCM and SLA. Love licensing agreements. Working with audit projects, consulting and implementation in Poland, Scandinavia, Europe and China. Former Vice-Chair in GITCA EMEA Board. Member of the Boards at Polish Information Processing Society & ISSA Polska. Member several associations: Microsoft Terminology Community, Friends of RedGate PLUS, PASS, ISSA, ACM and several communities in the world.

MCT and MVP from July 2010. Subject Matter Expert at CQURE and Microsoft Connect. Former president of the Polish SQL Server User Group. Creator and CEO (2009-2011) of SQLDay Conference. Active blogger (owner of five) and international speaker with many different conference experience. Co-author of SQL Server MVP Deep Dives Volume Two. Actually settled not far away from Sherwood Forest. Cross-mountain cyclist, amateur in swimming and running. Traveller. Fan of snooker and good music.

Code Quality and Static Code Analysis

Our next talk will be on February 25th at 6.30PM at the Institute for Innovation In Sustainable Engineering by Me, Stephen Haunts.

The talk description is below, but I want this to be a fairly interactive session. I will present a load of ideas and techniques, but the real value will be in hearing about how people in the audience tackle these problems in their organisations.

Also note we will be having an extra prize give away with a couple of licenses of the amazing tools NDepend.

Reserve your Place at Meetup

Visual Studio offers many great tools to help you with improving the quality of your code. These range from unit test tools, code metrics tools and static code analysis. In this talk we will explore some of these tools and also take a look at tools like NDepend which offers a very rich palette of tools to help assess the quality of your code, or investigate dependencies of legacy brownfield code.

This will be part talk and part group discussion. We are also going to be raffling 2 FREE licenses of NDepend at this talk, so 2 lucky winners will walk away with a license worth $337.

Stephen Haunts is a Development Manager for Boots, a Pluralsight Author, Book Author and Co-Organizer of the Derbyshire .NET Usergroup