summaryrefslogtreecommitdiff
path: root/day1/first-talk.txt
blob: da8689e814381a2d5cbfa7b64a06acfa9375334e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# micro services - perf

## Overivew

glu mobile - microservices

- Use docker
- HTTP processing
- Amazon ECS
- NOSQL Redis + couch base
- 40M votes a day
- 1M active users
- 14K req/m

## Microservices

- Small
- Simole
- easy to deploy
- upgradable

Use Base images
Name by version and never change (Freeze them)

## background processing
- Execute externally
- Shutdown functions
- Job server
- fastcgi_finish_request

## HTTP Compression

- gzip on
- gzip_types
- gzip_proxied any
- gzip_comp_level 5
- gzip_min_length (default 20)
- Smaller than 1500B means it will always fit in one TCP packet

If content_length is not set then nginx will compress always

Laravel/Lume/Others add middleware to add content_length

## Caching
- HTTP2 Server push
- Repeated server calls HTTP1
- 304s
    - Last-modified
    - cache-control

## No SQL
- Mongo/Redis
- Fight network I/O
- save hdd space
- compress large messages
- serialise better
- message templates
- add ttl expiry
- shorten cache keys

## Fast caching
- PHP Redis
- Predis - high memory, slower
- Persistent connections available

## Deployment EC8
- 0 Downtime
- quick rollout
- ELB health-check
- Auto scaling

## Hardware upgrades
- Doubling the hardware, halving the # of machines

## VPC
- Closer together
- Same location
- utilise internal networks
- other thoughts
    - Async I/O
    - swoole
    - HTTP/2
    - Tars
        - binary (80% reduction)

## Managing images
- Don't use aptitude (apt)
- Build from source
- fpm and Nginx together
    - Separate not helpful
    - No need for TCP/IP overhead
- supervisorD - everywhere

# Useful terms
aerospike
couch base
php_swoole
supervisorD
new relic
bugsnag
amazon cloud watch
sonarqube
sensolabs security checker
fastcgi_finish_request
crowdstar https://github.com/Crowdstar/background-processing