Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

36
Finding Cars and Hunting Down Logs: Elasticsearch @ AutoScout24 AutoScout24 24 Nov 2016 Philipp Garbe Lead developer ([email protected]) Juri Smarschevski Team lead ([email protected])

Transcript of Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Page 1: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Finding Cars and Hunting Down Logs: Elasticsearch @ AutoScout24

AutoScout24

24 Nov 2016

Philipp Garbe Lead developer ([email protected])

Juri Smarschevski Team lead ([email protected])

Page 2: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

SearchAutoScout24 search journey in nutshell

2

Page 3: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Who we are ?Unique Monthly Visitors in Europa

3

… 10 more

Page 4: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Some numbers

Search index contains ~2.6M classifieds

4

Unique visitors (monthly): ~10M

Search requests per day: ~36M

Index update rate per day ~400.000 classifieds

Page 5: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Status quo. March 2013.

Endeca used as a search engine

5

Use case: providing search results and facets for the entire AS24 platform

Problems: • New product requirements, performance of Endeca becomes slower• Time to market of our required features is not sufficient• Maintenance is complex / expensive

Page 6: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Possible candidates

Solr ?

• <feeling> too complex installation / configuration </feeling>

6

Sphinx ?• Support situation is unclear

Elasticsearch ?• Fresh buzzword• From beginning on built for distributed systems (rumors)• Easy installation / configuration (fact)

Page 7: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

POC

Goals

• Performance should be comparable with Endeca• The solution should be scalable

7

Page 8: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

8

Rollout plan. 03.2013 - 11.2013

07.2013 11.201302.2013 03.2013 05.2013

POC

Implementation & migration

Training

Go live phase

#real_project_picture_squeezed

Page 9: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

9

Endeca Elasticsearch(0.9.x)

Amount of machines 60 20

[Re]index time ~180 min ~45 min

Deploy to Live up to 2 days < 3 hours

Effort for testing an issue on local machine 4 h 1 h

Performance = =

Product / dev guys satisfaction :( :)

300%

400%

1000%

400%

% ?

Results after 8 months of working.

Page 10: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

No problems after migration ?

Cluster split brain

Has in fact nothing to do with Elasticsearch, is more related to learn phase at AS24

10

Deep pagination

Elasticsearch 5.x release notes: “Deep pagination of search results is now possible with the search_after feature, which efficiently skips over previously returned results to return just the next page.“

Page 11: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

11

Status quo. November 2014.

Project “Tatsu” has started.NET => JVM

C# => Scala

IIS / Windows => Play / Linux

Local data center => AWS

Monolith => Micro services

Windows workstations => Mac notebooks

... => ...

Page 12: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

12

Status quo. November 2014.

Project “Tatsu” has started.NET => JVM

C# => Scala

IIS / Windows => Play / Linux

Local data center => AWS

Monolith => Micro services

Windows workstations => Mac notebooks

? => ?

=> 2015

Page 13: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

13

Elasticsearch clusters “lift & shift” to AWS ?

AWS Elasticsearch Service ?

Elasticsearch as a service (SaaS) ?

Own hosting in AWS ?

Page 14: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

16

Rolling update in details (possible scenario).

Time1

Initial state

Page 15: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

17

Rolling update in details (possible scenario).

Node has been replaced

Time1 2

Initial state

~ 60 sec

Page 16: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

18

Rolling update in details (possible scenario).

Master has been killed

Node has been replaced

Time1 2 3

Initial state

Page 17: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

19

Rolling update in details (possible scenario).

Master has been killed

Node has been replaced

Master election

Time1 2 3 4

Initial state

Page 18: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

20

Rolling update in details (possible scenario).

Master has been killed

Node has been replaced

Master election

Time1 2 3 4 5

Initial state Last node has been replaced

Page 19: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

21

Rolling update findingsMaster has been killed

?Outage=

Page 20: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

22

Rolling update findings

Page 21: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

LoggingContinuously deployed, immutable and stateful

23

Page 22: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

7.4 billion documents

Some numbers

36 TB EBS

18 nodes á m4.4xlarge

(64GB / 53.5 cpu units)

Page 23: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Unified Logs

25

Page 24: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Challenge: Deployment time

Page 25: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Rolling updates

27

Page 26: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24
Page 27: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24
Page 28: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24
Page 29: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24
Page 30: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24
Page 31: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Challenge: Costs

Page 32: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

First setup

● 18x m4.4xlarge● 18x 2TB gp2

● 3TB/day cross-zone traffic

Page 33: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Cost/Usage Optimized Setup

● 15x m4.x2large● 15x 384GB gp2

● 6x SpotFleet● 6x 4TB st1

● 9TB/day cross-zone traffic

Savings: ~40%

Page 34: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Future. What next ?

Percolator (saved search)

36

Elastic Graph (recommendations)

Freetext search

Page 35: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

37

Conclusion

Here is a simple question - if we had the possibility to go back in the time and start the same journey with Elasticsearch,

would we do it the same way ?

Page 36: Finding Cars and Hunting Down Logs - ElasticSearch @AutoScout24

Q & A

38