Sitecore Best Practices - War Stories From the Trenches Charles - - PowerPoint PPT Presentation

sitecore best practices
SMART_READER_LITE
LIVE PREVIEW

Sitecore Best Practices - War Stories From the Trenches Charles - - PowerPoint PPT Presentation

Sitecore Best Practices - War Stories From the Trenches Charles Turano Hedgehog Development @CharlesTurano Sitecore User Group Conference 2015 1 Hedgehog Sitecore User Group Conference 2015 2 Agenda What are Sitecore best practices


slide-1
SLIDE 1

Sitecore Best Practices -

War Stories From the Trenches

Charles Turano Hedgehog Development @CharlesTurano

Sitecore User Group Conference 2015 1

slide-2
SLIDE 2

Hedgehog

Sitecore User Group Conference 2015 2

slide-3
SLIDE 3

Agenda

  • What are Sitecore best practices & what makes Sitecore

unique in a production environment?

  • “War Stories”.
  • Best practice scan results.
  • Q&A

Sitecore User Group Conference 2015 3

slide-4
SLIDE 4

What are they?

  • IIS & SQL best practices are

Sitecore best practices.

  • 7.5 and above add MongoDB.
  • Review current install docs

before installing Sitecore.

What makes Sitecore unique?

  • Sitecore caching.
  • Sitecore Remote Events.
  • Much more…

Sitecore User Group Conference 2015 4

Sitecore Best Practices

slide-5
SLIDE 5

War Story 1

5

Missingcache clear events after content publish on some servers

slide-6
SLIDE 6

War Story 1 – The Symptoms & Settings

  • Production CDs are in a load balancer.
  • CD1 works but CD2 shows stale content.
  • Deployed the code to all servers last evening.
  • Web root was synced with robosync so DB connections and

code should be the same.

Sitecore User Group Conference 2015 6

slide-7
SLIDE 7

The Logs

  • Publish occurs on CM.
  • CD1 clears cache post

publish.

  • CD2 does not clear cache

post publish.

The Database

  • Property table shows events

are being processed by both servers.

Sitecore User Group Conference 2015 7

War Story 1 – The Evaluation

slide-8
SLIDE 8

War Story 1 – The Results

  • There was an extra w3wp.exe running.
  • We suspect that the w3wp process on CD2 didn’t completely

shutdown during the deployment the night before.

  • The rouge w3wp on CD2 was stealing event from the active

w3wp.

  • IISReset resolved the issue.

Sitecore User Group Conference 2015 8

slide-9
SLIDE 9

War Story 2

9

Frequent website pauses and high SQL server load

slide-10
SLIDE 10

War Story 2 – The Symptoms & Settings

  • Heavy SQL load, that occasionally hits the DB very hard

especially after publishes.

  • Website frequently “pauses”.
  • Slow index updates.
  • 3 Frontend CDs with a lot of ram.

Sitecore User Group Conference 2015 10

slide-11
SLIDE 11

The Logs

  • Multiple ACTIVE log files.
  • Event processing visibly slow

and sporadic.

The Database

  • Event processing sometimes

gets very behind then catches up.

Sitecore User Group Conference 2015 11

War Story 2 – The Evaluation

slide-12
SLIDE 12

War Story 2 – The Results

  • There were multiple IIS websites and AppPools running on the

CD servers ALL POINTING TO THE SAME WEBROOT.

  • Sitecore documentation explicitly says “DON’T DO THIS”.

Sitecore User Group Conference 2015 12

slide-13
SLIDE 13

Understanding Sitecore Remote Event Processing

13

slide-14
SLIDE 14

Remote Events Processing Model

  • Events are written to EventQueue table. Usually in Core, but they can be written

for other databases

  • A property in the Property table tracks the last event seen by a server using a

property called EQStamp_[MachineName]

  • Every 2 seconds (by default) each server scans all databases for new events
  • Property changes raise “PropertyChanged” events so other servers know

properties have changed

  • What are remote events used for?

Sitecore User Group Conference 2015 14

slide-15
SLIDE 15

Remote Events & Search Indexes

  • Lucene Index Updates are kicked off by remote events.
  • Lucene Updates reads the history table & use properties in

Property Table to track index updates.

  • Can get overloaded with servers hitting the DB too frequently

for updates.

  • Use SOLR or Coveo for larger installs.

Sitecore User Group Conference 2015 15

slide-16
SLIDE 16

War Story 3

16

Once or twice a day, each CD server crashes with errors in the Lucene DLL

slide-17
SLIDE 17

War Story 3 – The Symptoms & Settings

  • 3 load balanced CDs.
  • Sync tool to keep webroot folder in sync across servers.
  • Once a day or so, each of the 3 front end CD’s have a failure

in w3wp.exe that brings down the CD with nothing in the Sitecore logs.

  • Windows event log shows the failures in Lucene.net.

Sitecore User Group Conference 2015 17

slide-18
SLIDE 18

The Logs

  • Failure deep in the Lucene.net

DLL.

  • That error only shows up in

the Windows Event Log.

  • Error indicates corrupted

memory.

The Database

  • No issues within the

database.

  • Remote Event processing is

working correctly.

Sitecore User Group Conference 2015 18

War Story 3 – The Evaluation

slide-19
SLIDE 19

War Story 3 – The Results

  • A sync tool was used to sync the webroot (good) and the data

folder (bad).

  • Lucene index files were updated & synced to other servers

which confused the Lucene dll’s.

  • Stopped syncing process and rebuilt the Lucene index on all

servers.

Sitecore User Group Conference 2015 19

slide-20
SLIDE 20

War Story 4

20

Automated Deployments slowing down the CD

slide-21
SLIDE 21

War Story 4 – The Symptoms and Settings

  • Have a CM & CD in test environment.
  • Environment was in a remote facility.
  • While TDS was deploying items to the CM, the CD server

would run very slowly.

Sitecore User Group Conference 2015 21

slide-22
SLIDE 22

The Logs

  • Build logs look normal.
  • CM logs indicate that ~2000

items deployed to the CM.

  • CD logs indicate ALL CACHES

cleared EVERY TIME an item was deployed!

The Database

  • Events were being processed

correctly, but the CD was seeing Item Serialization events.

Sitecore User Group Conference 2015 22

War Story 4 – The Evaluation

slide-23
SLIDE 23

War Story 4 – The Results

  • The CD still had a connection to the Master database and was

clearing its caches every time an item was serialized into the master database.

  • Sitecore best practice dictates that the master database should

not be connected to the CD.

Sitecore User Group Conference 2015 23

slide-24
SLIDE 24

Our “Wellness” Statistics

Sitecore User Group Conference 2015 24

slide-25
SLIDE 25

Take Aways

  • Read Sitecore Documentation for your version before doing a

production installation.

  • Follow IIS & SQL best practices.
  • Schedule frequent checks of your installation.
  • Script automatic scans.

Sitecore User Group Conference 2015 25

slide-26
SLIDE 26

Contact Us

  • Twitter:

@CharlesTurano

  • Blog:

www.hhogdev.com/blog

  • Email:

sales@hhogdev.com

Sitecore User Group Conference 2015 26

slide-27
SLIDE 27

Q & A

Sitecore User Group Conference 2015 27

slide-28
SLIDE 28

SUGCON Sponsors

Sitecore User Group Conference 2015 28