Performance Flashcards
What is PAAS? What does it offer?
Platform as a service.
Easy horizontal scaling
Component level performance tuning
Infrastructure security.
Is Response Time Important?
Yes, Constitutes to a drop in sales, traffic, searches. If it takes more than 100ms it is instantaneous and then greater than 7 seconds is abandonment time. Speed is a feature.
Where does time go during Web Request?
Request Sent -> Web Server -> App Server (controller & model) -> Database access -> View rendering -> OS/Network Stack -> Back to user, render on user. All assets loaded, run scripts, rendering done.
What Client side of request takes the most time?
CSS Selectors & JavaScript = 41% of client rendering time.
What hinders client side of request speed
JavaScript interpreter, javascript is single threaded,
Html Parse - 21%
Selector Engine 29%
Why is it bad to draw a bell curve distribution of users response time?
The response time distribution is not a bell curve and is actually extremely Right skewed ^___ So you should not draw a bell curve, but a skewed curve. Most users experience good connection and availability.
Scalability
Means different things in different context.
For Saas: as number of users increases how to does app availability change
Service Level Objective
Time to Satisfy user request.
SLO: Instead of worse case or average, what % of users get acceptable performance?
Specify percentile, target response time, time window.
ApDex Score
Given a latency T for user satisfaction:
Satisfaction <= T
Tolerable T <= user <= 4T
Apdex = #Satisfactory + (.5)(tolerable) / requests
0.85 to .93 generally good
But it can hide systematic outliers. Eg critical action occurs once every 15 clicks but takes 10x as long. SO your Apdex is being scored well, but you have a systematic problem with your app taking too long
What is a good Threshold?
1000 - 2000ms is best
What do you do if site is slow?
Overprovision: Just add more servers since they are cheaper, but only good for smaller sites
Large Site: Dangerous since you have so many idol servers now
App wants 99.9% uptime and it was down for an hour. Can it make its goal?
We don’t have enough information because we don’t know what the time frame is for the uptime goal, like over a year or over a day. Then you also don’t know if they had outages in the past.
What does a 99.999% up time per year entitle?
<= 5 minutes down per year
What are the kinds of monitoring?
At development time (profiling)
Probing while the site is down using an external monitor.
Both are normally used.
What is internal monitoring?
Info collected in your app but stored locally.
Server on Heroku injected measurement points in the stack and then in background gets this data shipped to another site and then gives you historical data. You can just use Relic as a gem and that’s all you need to do to test it. It has a free tier.