Currently based on upload_webp_hits_threshold hiera rule, we apply webp thumbnail instead if the file is popular. The popularity threshold is set to 100 requests per day. I would like to see if we can pick a threshold based on access of thumbnails. I've looked at all requests to cp3077 for a full day (the ttl of images which basically translates to the hits).
In total 13.8M distinct thumbnails were requested in 101M distinct requests but it is very long-tailed: the access distribution looks like this:
i.e. picking 100 as threshold only impacts 0.43% of files (roughly 60K files) while still covering around 50% of requests. In fact, it is so long-tailed that looking at any data above 10% of files is waste of time. So I made it per mille maxed at 100‰ = 10%:
Based on derivatives (looking for the "knee"), it looks like it'd be better to target 1% of files translating to 56% of requests. That means putting the threshold at 50 would achieve that.
| Distinct URLs | Requests | Threshold (requests per day per server) |
|---|---|---|
| 0.1% | 42.6% | 361 |
| 0.2% | 46.0% | 189 |
| 0.3% | 48.2% | 133 |
| 0.4% | 49.8% | 105 |
| 0.5% | 51.1% | 89 |
| 0.6% | 52.2% | 78 |
| 0.7% | 53.2% | 69 |
| 0.8% | 54.1% | 62 |
| 0.9% | 54.9% | 57 |
| 1.0% | 55.7% | 52 |
| 1.1% | 56.4% | 49 |
| 1.2% | 57.0% | 45 |
| 1.3% | 57.6% | 43 |
| 1.4% | 58.2% | 40 |
| 1.5% | 58.7% | 38 |
| 1.6% | 59.2% | 36 |
| 1.7% | 59.7% | 35 |
| 1.8% | 60.2% | 33 |
| 1.9% | 60.6% | 32 |
| 2.0% | 61.0% | 31 |



