plan2net/webp

Hundreds of queries to check for failed attempts really neccesary?

bernhardberger opened this issue · 3 comments

if ($this->hasFailedAttempt((int)$originalFile->getUid(), $parameters)) {

Is this check really neccesary? This causes a butload of queries.

My scenario:

  • I have a site (single page) with about 100 images
  • if I include responsive formats multiply that by 4-6
  • this site has heavy traffic (about 2000 concurrent fe_users during business hours and probably 1000 hits per minute as the page autoloads when a users opens the browser or just a new tab

Results in:
500 * 1000 = 0.5 mio queries per minute for that check alone.

Can this be optimized? I'm happy to submit a PR if anyone suggest an approach..

wazum commented

Merged 261f861
Should be a lot faster now, but why would heavy traffic have any impact on this? The images are generated usually once (see

if (!$this->needsReprocessing($processedFileWebp)) {
).
Maybe you can give some insights into your setup, why processing these images would be called all the time?

Maybe you can give some insights into your setup, why processing these images would be called all the time?

Would be interested too

Is this check really neccesary? This causes a butload of queries.

btw, it is buttload