Top Banner
Sizing your Alfresco platform Luis Cabaceira Technical Consultant
67

Sizing your alfresco platform

Jun 23, 2015

Download

Technology

Luis Cabaceira

Sizing an alfresco infrastructure has always been an interesting topic with lots of unrevealed questions. There is no perfect formula that can accurately define what is the perfect sizing for your architecture considering your use case. However, we can provide you with valuable guidance on how to size your Alfresco solution, by asking the right questions, collecting the right numbers, and taking the right assumptions on a very interesting sizing exercise.

How many alfresco servers will you need on your alfresco cluster? How many CPUs/cores do you need on those servers to handle your estimated user concurrency? How do you estimate the sizing and growth of your storage? How much memory do you need on your Solr servers? How many Solr servers do you need to get the response times you require? What are the golden rules that can drive and maintain the success of an Alfresco project?
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sizing your alfresco platform

Sizing your Alfresco platform

Luis CabaceiraTechnical Consultant

Page 2: Sizing your alfresco platform

Agenda

• Who am I• Presentation Objectives• Sizing Key questions• Sample Architecture• Sizing the different application layers

Page 3: Sizing your alfresco platform

About me• Luis Cabaceira, Technical Consultant

at Alfresco• 13 years of field experience• Helped clients in various fields on

architecture and sizing decisions

Government & Intelligence

Banking & Insurance Manufacturing

Media & PublishingGovernment &

IntelligenceBanking & Insurance

Manufacturing Media & Publishing

High Tech

Page 4: Sizing your alfresco platform

Objectives of the presentation• Explain sizing key questions that will

drive sizing decisions• Some Architecture best practices• Explain the impact of system usage

on the different application layers

Page 5: Sizing your alfresco platform

Considerations

• The information provided on this presentation is based on Alfresco internal benchmarks as well as our field experience in various customer implementations.

• Sizing predictions should be validated by executing dedicated benchmarks.

• Monitoring your solution will also help on validating your sizing predictions allowing for incremental and continuous improvement

Page 6: Sizing your alfresco platform

Sizing Key Information

Page 7: Sizing your alfresco platform

3 required sizing topics

• The most important topics are • Use Case• Concurrent Users• Repository documents

• In many cases organizations are not able to provide the answers to the other questions and you have to build assumptions.

Page 8: Sizing your alfresco platform

Identify the Use case

Page 9: Sizing your alfresco platform

Concurrent Users

Page 10: Sizing your alfresco platform

Repository documents

Page 11: Sizing your alfresco platform

Extra sizing topics

The more information you have about your scenario the more accurate will be your sizing predictions.

When available you should get information on the topics explained on the next slides to complete the information gathering stage.

Page 12: Sizing your alfresco platform

Architecture

Page 13: Sizing your alfresco platform

Authority structure

Page 14: Sizing your alfresco platform

Operations

Page 15: Sizing your alfresco platform

Components,Protocols and Apis

Page 16: Sizing your alfresco platform

Batch processes

• Approximate numbers and and types of batch jobs• workflows• scheduled processes• transformations and renditions

Page 17: Sizing your alfresco platform

Customizations and Integrations

Page 18: Sizing your alfresco platform

Response Times Requirements

Page 19: Sizing your alfresco platform

There is no perfect formula

Page 20: Sizing your alfresco platform

Reference Architecture Study

Page 21: Sizing your alfresco platform

Database Sizing

All operations in Alfresco require a database connection, the database performance plays a crucial role on your Alfresco environment. It’s vital to have the database properly sized and tuned for your specific use case.

Content is not stored in the databaseDatabase size is un-affected by size or the document's contentDatabase size is affected by the number/type of metadata fields

Page 22: Sizing your alfresco platform

Database Size calculation

D = Number of Documents + Avg. number of versionsDA = Average number of Metadata fields per documentF = Number of FoldersFA = Average number of Metadata fields per Folder

Dbsize = ((D * DA) + (F*FA)) * 5.5k

Add 2k for each user and 5k for each group

Page 23: Sizing your alfresco platform

Database Performance is Vital

Page 24: Sizing your alfresco platform

User facing nodes sizing

Page 25: Sizing your alfresco platform

User facing nodes sizing

The repository user-facing cluster is dedicated on serving the usual user requests (reads, manual writes and updates).

The most important factor that stresses these servers is the number of concurrent users hitting the cluster.

Note that these nodes also do transformations to swf when a user accesses the document preview. User Uploads will also create thumbnail images.

Page 26: Sizing your alfresco platform

User facing nodes sizing factors

Operations: Percentage of browse, download and write operations

Components, Protocols and API: Which components, protocols and APIs of the product are the users using to access these nodes.

Response Times: The detail around response time requirements.

Page 27: Sizing your alfresco platform

User facing nodes calculations

Considering our field experience and our internal benchmark values and assuming we assign a quad-core cpu to the node with a user think-time of 30s

1 alfresco node for each 150 concurrent users. Number of Nodes = N Concurrent Users / 150

If we assign 2 quad-core cpus to each node.

1 alfresco node for each 300 concurrent users. Number of Nodes = N Concurrent Users / 300

Page 28: Sizing your alfresco platform

User facing nodes calculations

By default Alfresco has only 1 thread configured for libreoffice, but the number of threads can be increased using the port numbers on jodConverter.

If have lots of uploads and you need faster (concurrent) transformations, consider raising the number of libreoffice threads. Have this in consideration on your memory calculations for these servers, it takes typically 1GB for each Libreoffice thread. Transformation server can be an option.

Page 29: Sizing your alfresco platform

Dedicated tracking nodes sizing

Page 30: Sizing your alfresco platform

Dedicated tracking nodes sizing

The dedicated tracking nodes exist on each Solr server and they are the only reference to Alfresco that Solr knows about. Note that they normally have their own JVM and application server instance.

The dedicated tracking Alfresco instances perform.

•Text extraction of the document’s content to send to Solr. (Alfresco api call)•Allow for local indexing (document’s do not have to travel over the wire during tracking)

Page 31: Sizing your alfresco platform

Dedicated tracking nodes sizing

Normally these nodes do not have high requirements on memory and CPU but sizing will depend on the number of expecting uploads and transactions on the system.

Indexing (Text extraction) impacts CPU and it’s API call that occurs exclusively on these nodes.

Page 32: Sizing your alfresco platform

Solr nodes sizing

Page 33: Sizing your alfresco platform

Solr nodes sizing factors

Authority Structure

Recent benchmarks comparisons that authority structure has a direct and important impact on performance of SOLR.

When sizing Solr we should analyze the types of searches that will be executed and the authority structure of the corresponding use case

Page 34: Sizing your alfresco platform

Solr nodes sizing factors

Repository Size

Important to notice that repository sizes should mostly only affect average response times for search operations, and more importantly for certain kinds of global searches very sensitive to the overall size of the repository.

This is the layer most affected by the increase on repository size.

Page 35: Sizing your alfresco platform

Solr nodes Calculations

Use the online formula published by alfresco to calculate the necessary memory for your solr nodes.

Note that the formula provided gives results for each core and it considers only one searcher. There can be up to 2 searchers per core, so the values you get from the formula you should multiply by 4.

Total Memory = Result x 2 cores x 2 searchers

Page 36: Sizing your alfresco platform

Solr nodes Calculations

To calculate the number of Solr nodes on your cluster you should consider the search response times, the frequency of the search requests and the size of your repository.

There are several possible architectures for solr and corresponding sizing scenarios depending on your use case, also tuning plays an important role.

http://blogs.alfresco.com/wp/lcabaceira/2014/06/20/solr-tuning-maximizing-your-solr-performance/

Page 37: Sizing your alfresco platform

Solr Indexes

You can expect the size of your indexes (when using FTI) to be between 40-60% the estimated size of your content store.

Page 38: Sizing your alfresco platform

Content Ingestion nodes sizing

Page 39: Sizing your alfresco platform

Bulk ingestion nodes sizing

Sizing the nodes dedicated to content ingestion is very similar to sizing the tracking nodes, these nodes do not take any user requests and don’t receive search requests but they do generate document thumbnails. Start with 1 cpu (quad-core).

They are mainly database and solr proxys. They read xml files and there is few memory consumption.

The load on this server will mostly impact Solr indexing and the dedicated tracking instances (text extraction).

Page 40: Sizing your alfresco platform

Bulk ingestion nodes tuningDisable unneeded services, many standard services are not required when bulk loading content

Verify the existence of rules on target folder that can delay the speed of the ingestion and disable when applicable.

Minimize network and file I/O operationsGet source content as close to server storage as possible

Tune JVM, Network, Threads, DB Connections.

Page 41: Sizing your alfresco platform

Content Store Sizing

Page 42: Sizing your alfresco platform

Content Store SizingTo size your content store consider

• Number of documents (ND) • Number of Versions (NV)• Average document size (DS)• Annual Growth rate (AGR)

Content Store Size (Y1) = (ND * NV * DS)

If you have thumbnails and previews enabled also consider the pdf and swf versions of each document and the documents thumbnails

Page 43: Sizing your alfresco platform

Sample Real Life numbersSIZING AREA INFORMATION

USE CASE Collaboration

CONCURRENT USERS 600

REPOSITORY 4M docs/ Avg doc size is 3mb/ Ingestion Rate is 75000 docs /Year

ARCHITECTURE High availability required on Solr and Alfresco user facing nodes

AUTHORITY STRUCTURE 8000 named users, 100 groups, user belongs to 4 or 5 groups, Group hierarchy max depth 4.

OPERATIONS Search/Write/Browse split is 10/10/80

COMPONENTS PROTOCOLS AND APIs

Alfresco Share + DM + Sites. SPP, Integration with AD.

CUSTOMIZATIONS IMPACT None

BATCH OPERATIONS Ad Synchronization, External loaded dictionary data

RESPONSE TIMES Not Defined

Page 44: Sizing your alfresco platform

Sample Real Life numbersALFRESCO NODES CPU JVM MEMORY

2 2 Quad-Core 8 GB

SOLR NODES CPU JVM MEMORY

2 1 Quad-Core 20GB

Page 45: Sizing your alfresco platform

2 Common use cases

Collaboration Backend Repository

Page 46: Sizing your alfresco platform

Collaboration vs Backend RepoCollaboration Scenario

• Search is usually just a small portion of the operations percentage (around 10%)

• User authority structure will be complex

• Most uploads are manually driven

Backend Scenario

• In most of the cases especially for very large repositories there wont be full text indexing/search

• Authority structures will be in general fairly simple.

• Dedicated nodes for ingestion are normally used.

Page 47: Sizing your alfresco platform

Collaboration vs Backend RepoCollaboration Scenario

• Repository Sizes are usually of small or intermediate size.

• Customizations in most cases will concentrate at the front end (Share).

• Architecture options are in general the standard ones provided by Alfresco (cluster, dedicated index/transformation layers, etc).

Backend Scenario

• Repository sizes are usually quite big.

• Custom solution code may live external to Alfresco by using CMIS, public APIs, etc.

• Architecture options are normally more complex using proxies, cluster and unclustered layers, sharding of Alfresco repository, etc

Page 48: Sizing your alfresco platform

Collaboration vs Backend RepoCollaboration Scenario

• Concurrent users are normally quite high

• Share interface is used, very common usage of SPP, CIFS, IMAP, WebDAV and other public interfaces (CMIS) for other interfaces (mobile).

Backend Scenario

• Concurrent users are in general fairly small but think times are much smaller than for collaboration.

• Most of the load should concentrate around public API (CMIS) and custom developed REST API (Webscripts).

Page 49: Sizing your alfresco platform

Collaboration vs Backend RepoCollaboration Scenario

• Batch operations should mostly be around human interaction workflows and the standard Alfresco jobs.

Backend Scenario

• Batch operations will usually have a considerable importance, including content injection processes (bulk or not), custom workflows and scheduled jobs.

Page 50: Sizing your alfresco platform

Database Thread Pool

A default Alfresco instance is configured to use up to a maximum of forty (40) database connections. Because all operations in Alfresco require a database connection, this places a hard upper limit on the amount of concurrent requests a single Alfresco instance can service (i.e. 40), from all protocols.

Alfresco recommends to increase the maximum size of the database connection pool to at least [number of application server worker threads] + 75.

Page 51: Sizing your alfresco platform

Database Scaling

Alfresco relies largely on a fast and highly transactional interaction with the RDBMS, so the health of the underlying system is vital.

If your project will have lots of concurrent users and operations, consider an active-active database cluster with at least 2 machines.

Page 52: Sizing your alfresco platform

Some Golden Rules

Page 53: Sizing your alfresco platform

User facing nodes Golden Rules

Browsing the repository using a client (share or explorer) performs Acl checks on each item present on the folder being browsed. Acl checks go against the database and occupy a thread in tomcat, causing cpu consumption. Consider having a max of 1000 documents on each folder to reduce this overhead.

Add a transformations timeout and configure the transformation limits to prevent threads spending to much time doing transformations.

Page 54: Sizing your alfresco platform

User facing nodes Golden Rules

User operations take application server threads. The more concurrency the more threads will be occupied and the more cpu will be used. Size the maximum number of application server threads (and the number of cluster nodes) according to your expected concurrency.

Include the Alfresco scheduled tasks on your cpu calculations, those also require server threads and consume cpu.

Page 55: Sizing your alfresco platform

User facing nodes Golden Rules

Customizations on the repository should be carefully analyzed for memory and cpu consumption. Check for unclosed resultsets, they are a common memory leak.

The local repository caches (L2 caches) occupy server memory, size them wisely. Check my blog post on the alfresco repository caches.http://blogs.alfresco.com/wp/lcabaceira/2014/05/29/repository-caches/

Page 56: Sizing your alfresco platform

Golden Rules – Solr memory

To minimize memory requirements on solr :

• Reduce the cache sizes and check the cache hit rate.

• Disable ACL checks.• Disable archive indexing, if you are not

using it.• Since everything scales to the number of

documents in the index, add the Index control aspect to the documents you do not want in the index

Page 57: Sizing your alfresco platform
Page 58: Sizing your alfresco platform

Capacity of Alfresco Repository

How do can determine the throughput of my Alfresco repository server ?

A ECM repository is very similar to a database in regards to the type of events that they manage and execute, specially when we think about “transactions per second” where  a “transaction” is considered to be a basic repository operation (create, browse, download, update , search and delete) .

Page 59: Sizing your alfresco platform

The C.A.R.

“The maximum number of transactions that can be handled in a single second before degrading the expected performance”

Page 60: Sizing your alfresco platform

Capacity of Alfresco Repository3 more figures

EC = The expected concurrency represented in number of users.

TT = user think time represented in seconds

ERT = Expected/Accepted response times

Page 61: Sizing your alfresco platform

The Expected Response TimesOPERATION VALUE WEIGHT LAYER CPU MEM I/O

Download 3 sec 20 Repo

Write/Upload 5 sec 10 Repo/Solr/DB

Delete 3 sec 5 Repo/DB

Browse/Read 2 sec 50 Repo/Solr/DB

Search Metadata

2 sec 10 DB/Solr

Full Text Search

5 sec 5 Solr

It’s an object representing the response times being considered including the weight of each type and the layer that it affects. It takes known repository actions as arguments.

Page 62: Sizing your alfresco platform

Capacity of Alfresco RepositoryWith the inclusion of new variables we can tune our C.A.R. definition and redefine it as.

“Number of transactions that that the server can handle in one second under the expected concurrency(EC) with the agreed Think Time (TT) ensuring the expected response times(ERT) “.

By configuring the Alfresco audit trail we can define our initial throughput (average transactions per seconds).

Page 63: Sizing your alfresco platform

Predicting the future

Re-evaluate your sizing introducing new factors.

Take a dynamic / use case oriented approach to identify a formula, built on a system of attributes, values, weights and affected areas.

Introduce one or more ERT objects representing use case specific response times and operations acting as influencers on the server throughput.

Page 64: Sizing your alfresco platform

Simple lab tests results We’ve executed some lab tests, one server running Alfresco and another running the database, simple collaboration use case on a repository with 5000 documents.

Alfresco Server Details• Processor: 64-bit Intel Xeon 3.3Ghz (Quad-Core)• Memory: 8GB RAM• JVM: 64-bit Sun Java 7 (JDK 1.7)• Operating System: 64-bit Red Hat Linux

Test Details• ERT = The sample ERT values shown before on the presentation• Think Time = 30 seconds.• EC = 150 users

The C.A.R. of the server was between 10-15 TPS during usage peaks. Through JVM tuning along with network and database optimizations, this number can rise over 25 TPS.

Page 65: Sizing your alfresco platform

Size does matter !

Page 66: Sizing your alfresco platform

Questions

Page 67: Sizing your alfresco platform

Additional InfoAlfresco Blog

http://blogs.alfresco.com/wp/lcabaceira/

Github pagehttps://github.com/lcabaceira

Thank you