impress-2020/pages
Matchu 18bc3df6f4 Use browser pooling for /api/assetImage
I tried running a pressure test against assetImage on prod with the open-source tool `wrk`:

```
wrk -t12 -c20 -d20s --timeout 20s 'https://impress-2020-box.openneo.net/api/assetImage?libraryUrl=https%3A%2F%2Fimages.neopets.com%2Fcp%2Fitems%2Fdata%2F000%2F000%2F522%2F522756_2bde0443ae%2F522756.js&size=600'
```

I found that, unsurprisingly, we run a lot of concurrent requests, which fill up memory with a lot of Chromium instances!

In this change, we declare a small pool of 2 browser contexts, to allow a bit of concurrency but still very strictly limit how many browser instances can actually get created. We might tune this number depending on the actual performance characteristics!
2021-11-12 23:35:30 -08:00
..
api Use browser pooling for /api/assetImage 2021-11-12 23:35:30 -08:00
outfits [WIP] Use Next.js for outfit page SSR 2021-11-01 23:03:19 -07:00
[[...slug]].tsx [WIP] Run cra-to-next codemod to be on Nextjs 2021-11-01 21:49:23 -07:00
_app.tsx [WIP] Run cra-to-next codemod to be on Nextjs 2021-11-01 21:49:23 -07:00
_document.tsx [WIP] Run cra-to-next codemod to be on Nextjs 2021-11-01 21:49:23 -07:00