Ola Kunysz
Wrocław JUG 04.06.2018
@OlaQnysz
PeggyBrown
if every screen loads 4 s
... or it just "feels" slow
... but you can still measure most of it
Insights
Insights
Time To First Byte vs Download
Load and performance testing
val productsScenario = scenario("Products")
.exec(
http("products")
.post("/")
.param("name", "Vita skor")
.param("price", "100")
.check(status.is(200)))
.repeat(10) {
.exec(
http("products")
.get("/")
.check(status.is(200)))
}
at least simple stress tests from time to time
$ ./getSomeStress.sh
3.736713
2.478001
2.350695
2.422105
2.327605 ...
for i in `seq 1 10`;
do curl -XGET -s -o /dev/null -w "%{time_total}" "http://localhost:9000/products"; echo; done;
Store as much as possible on CDN (Content Delivery Network)
Let someone serve you images and videos
minified
| nonblocking
| concatenated
| compressed
import modules on-demand (or conditionally)
(where it makes sense)
/products?skip=0&take=20
use paging
/products?skip=0&take=1000
6000 ms
200 ms
Fast 3G
???
700 ms
BUT don't use paging on frontend, please
(only lazy loading)
send only necessary information
~3 KB
~10KB for 20 products
Last-Modified: Mon, 04 Jun 2018 15:29:14 GMT ->
If-Modified-Since: Mon, 04 Jun 2018 15:29:14 GMT (in GET)
If-None-Match: "88d979a0b78942b5bda24ace4214516a" (in GET) ->
304 Not Modified
Content-Length: 0
Performance Advisor for Mongo DB
Indexes for expensive and/or common requests
Duplicated data
@OlaQnysz
PeggyBrown
More info
Images