23
February 11, 2016 – PowerUp Echo Webinar Series 1

February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

February 11, 2016 – PowerUp Echo Webinar Series

1

Page 2: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

WELCOME

Best Practices for System Performance

Page 3: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Senior Technical Consultant

PowerObjects/Minneapolis

Image

Shahar Journo

Meet your Presenters 1

Senior Technical Consultant

PowerObjects/Minneapolis

Image

Dan El Halawani

[email protected] [email protected]

612.339.3355 x149 612.339.3355 x157

Page 4: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Agenda 2

Server SideDatabase Performance

Front End Performance

Back End Performance

Client SideWorkstation Performance

CRM Form Loading Time

CRM 2015 Update 1 – New Form Rendering Engine

Page 5: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Server Side Performance

Page 6: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Database – Index all the things!…but seriously, don’t…

4

• CRM GUIDs are indexed automatically

• Other indexes can be setup

• For record sets queried often repetitively

• For specific attributes returned often

• Don’t over-index!

• Can hurt insert/update performance

• Use DMVs (Dynamic Management Views)

• They store SQL transactional information

for duration of SQL server uptime

• Store missing indexes from queries

optimized by SQL query optimizer

• Can reveal what indexes should be added

to database

• Re-indexing can be important

• Data migrations

• Large integration jobs

• Over-time index fragmentation

select OBJECT_NAME(a.object_id),b.name,a.user_seeks,a.user_scans,a.*from sys.dm_db_index_usage_stats a join ORG_MSCRM.sys.indexes b ona.object_id = b.object_idand a.index_id = b.index_idwherea.database_id = DB_ID('ORG_MSCRM')and b.name like 'myIndex%'order byb.name asc

http://quantusdynamics.blogspot.co.uk/2012/11/dyn

amics-crm-database-optimization-with.html

Page 7: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Database – Your SQL server sucks! Fix it! 5

• MAXDOP

• Maximum Degree of Parallelism

• Default is 0…Set to 1 (1 CPU per statement)

• Affects whole SQL instance…be judicious

• Long Running Queries

• Optimize query logic in your code…

• Create indexes…carefully

• RCSI

• Read Committed Snapshot Isolation

• Set to Enable. Requires taking DB offline

• Reduces SQL locking via use of “snapshots” of

data written to TempDB

• Increases TempDB usage and slight CPU

increase

• Hardware

• SSDs!

• Separate CRM database, TempDB, and logs to

different disks

• 1:1 TempDB file to CPU core ratio• https://technet.microsoft.com/en-us/library/ms175527(v=SQL.105).aspx

• Reschedule Maintenance Jobs

• Run outside business hours/peak hours

• Tool: http://crmjobeditor.codeplex.com/

Page 8: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Front End – WCF and SSL and ISS…Oh my! 6

• Are you splitting your server roles across multiple servers? Maybe you should be…

• Stay up to date! Kinda...

• WCF Compression and SSL

• Enable WCF Compression in IIS (~25-30% reduction in payload size)

• Setup CRM with SSL (~30-50% reduction in payload size)

• ADFS or non-ADFS

• SSL allows WCF to not have to handle encryption

• Increases front end CPU usage somewhat

• Update via command line or editing IIS applicationHost.config file

http://blogs.msdn.com/b/crminthefield/archive/2014/09/02/enable-wcf-compression-to-improve-crm-2013-network-performance.aspx

Page 9: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Front End – Scary Registry Settings! Not so scary… :)

7

TcpTimedWaitDelay

This value determines the length of time that a connection stays in the TIME_WAIT state when it is closed. During TIME_WAIT state, the socket pair cannot be re-used. Typically, this value is two times the maximum segment life time on the network (known as “2MSL” state). Valid range is 30 to 300. Set to 30.

MaxUserPort

This value controls the available number of dynamic ports. The valid range for this value is from 5000 to 65534. By default, the number of available ports is 3977, because the first available port is port number 1024. Set to 65534.

OLEDBTimeout

By default, the OLEDBTIMEOUT value is 30 seconds. The OLEDBTIMEOUT value controls the SQL time-out value that is used for a single SQL query. The increased OLEDBTIMEOUT value is useful when the SQL server is overloaded. Additionally, the query takes a longer time to process.

Use a value of 300 seconds. Values higher than 300 may long running queries cause excessive SQL blocking.

The EXTENDEDTIMEOUT value

The ExtendedTimeout value controls the ASP.NET time-out value that is used for import requests. The time-out value must be larger than the time for finishing the whole import process. The increased ExtendedTimeout value is useful when the import process takes a long time. Set toExtendedTimeout value to 1,000,000 milliseconds.

Page 10: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Back End – Locked System Jobs…Locked System Jobs Everywhere 8

• Optimize .NET ThreadPool Settings

• Controls how ASP.NET interacts with multi-

threading on the server

• Web Service calls typically use one thread to

execute code to send request, and one thread

to receive callback from service

• Example: Say 5 threads are executing web

service call and waiting for callback, and

ThreadPool limit is 5…what happens?

• Set Machine.config file to these!

Page 11: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Client Side Performance

Page 12: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Browser Support

Workstation performance 10

• Internet Explorer 11/10, but NOT

IE 8,9

JS in IE8 – 5-10x lower then

newer versions

• Chrome & IE 11 & Edge – have

pre-fetch & pre-render! (This is

good!)

• >= 2 Gb ram

• Windows 7 or 8 or 10

• Decent resolution

Browser Tunings

• All browsers

Set temporary files (cache) >=

250 MB

Allow caching of encrypted files

Antivirus – White list CRM URL

(MacAfee & Symantec specially)

Page 13: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Internet Explorer – use group policy to set

Workstation performance 11

Page 14: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

• How big is ‘big’ ?Any entity with more than

500K records.

• SolutionOn Premises – We can use

indexes or the

configuration of the

server.

CRM Online – Open

Support Ticket.

What is running slow?

Justify any index, and

when to run index.

Data Size Amount of Attributes Items on the Forms Custom Code

Can we reduce the

amount of attributes?

Create more views if

needed, reduce attributes

per view.

Loading Views and Forms 12

What/how many

Items the form

contains?• Tabs

• Grids

• IFRAMES

• Attributes

Does the form trigger

any custom code:• Plugins

• JavaScript

• Business rules

• Workflows

Page 15: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

• Usually CRM plugins run on:

• Create

• Update

• Delete

• Retrieve

• Plugins can call other plugins/workflows, large datasets

can lead to time out exceptions. For example – sending

an invoice to all of the accounts when we create an entity.

• Retrieve can run when we are loading form or view.

• Delete – are we deleting child entities as well; how many ?

For example – we delete account and all of it’s notes.

• Update – can trigger updating other entities.

Custom Code - Plugins

Image

Form Loading Time 13

Page 16: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

• The amount of JavaScript code that are on the form can

increase the loading time, for example on load of a

contact form based on the parent account we need to

populate the address from the account , and also few

other lookups , In addition we have other fields that are

auto populating and checking the user role.

• JavaScript that is populating Iframe based on some

values.

• JavaScript that get data from 3rd party, for example:

• Get Coordinates based on address

• Validate zip code

• Bad JavaScript code , a function that call another function,

it is recommended to review the page code beside we are

adding more code.

• CRM 2015 U1 – bring some caching mechanism to the

page, it can improve the performance of the page

Custom Code - JavaScript

Image

Form Loading Time 14

Page 17: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

• Business Rules – Better performance than JavaScript

• Number of business rules

• Dependencies between business rules

“Custom” Code – Business Rules (PBL)

Image

Form Loading Time 15

Page 18: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

• Great Tool – has some limits (use plugin if we can’t do

something with workflow)

• Workflows – Asynchronous vs synchronous

• Recursive workflows

• Custom workflows can take more time

• Too many workflows can increase the amount it takes to

save, delete, or update

Custom Code – Workflows (processes)

Image

Form Loading Time 16

Page 19: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

CRM 2015 Update 1 – New Form Rendering 17

CRM 2015 Update 1 – form rendering (only on CRM online)

• IFRAMES are now kept throughout the user session

• Custom scripts are loaded in separate IFRAMES

• No changes in supported scripts or form

capabilities

Page 20: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

CRM 2015 Update 1 – New Form Rendering 18

Page 21: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

19CRM 2015 Update 1 – New Form Rendering

Oh no, I have too many customization can I go back???

Page 22: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Questions?

1

Page 23: February 11, 2016 PowerUp Echo Webinar Series · 8 • Optimize .NET ThreadPool Settings • Controls how ASP.NET interacts with multi- ... •Internet Explorer 11/10, but NOT IE

Thank You!

1