thegreenwebfoundation / greencheck-api

The green web foundation API
https://www.thegreenwebfoundation.org/
Apache License 2.0
9 stars 3 forks source link

Increase records flushed to the database by the 'logger' worker #35

Closed mrchrisadams closed 5 years ago

mrchrisadams commented 5 years ago

Over the last few months, we'd had a single logger worker, that makes a note of every request we get, and log it to a single massive, greenchecks table.

As we've seen a more than tenfold uptick in traffic, this logger worker has struggled to keep up, meaning the backlog grew faster than the logger could work through it.

How it works at present

Because of memory leak in php, we had some code like this to:

What this PR changes

This changes two things:

This should increase the maximum throughput, in terms of records written by logger.