internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
4.97k stars 1.24k forks source link

How did changes to service worker caching impact requests per second to the server? #9239

Open RayBB opened 1 month ago

RayBB commented 1 month ago

Once #8930 is deployed we want to answer these questions.

Question

How did requests per second change to the following places:

Additional context

Issue resolution criteria

Stakeholders

@cdrini

RayBB commented 4 weeks ago

@cdrini when you get a chance can you look into these numbers? Anecdotally it feels much faster (especially on chrome)

cdrini commented 4 weeks ago

Running a script to check now :+1: will take a bit of time to finish

for f in $(ls -r access.log-*.gz);
    do echo $f $(zcat $f | grep -E '/static/build/.*\.js' | wc -l) $(zcat $f | grep -E '/static/build/.*\.css' | wc -l) $(zcat $f | wc -l);
done

Once it starts outputting some data, I might tweak this to exclude bot traffic.

cdrini commented 4 weeks ago

No big difference for css/js ; let me try running it again excluding bots https://docs.google.com/spreadsheets/d/1522-NDs12KkFIErPMstiAEIUT7AcslmZl0QxzrRLrdE/edit#gid=0

cdrini commented 4 weeks ago
grep_not_bot() {
    awk -F'"' '{print $6}' | grep -viE '(bot|spider|crawler)\b'
}

for f in $(ls -r access.log-*.gz);
    do echo $f $(zcat $f | grep -E '/static/build/.*\.js' | grep_not_bot | wc -l) $(zcat $f | grep -E '/static/build/.*\.css' | grep_not_bot | wc -l) $(zcat $f | grep_not_bot | wc -l);
done