joshp23 / YOURLS-Expiry

YOURLS plugin to define conditions under which links will expire - time and click limited links
GNU General Public License v3.0
35 stars 13 forks source link

fix mysql high cpu utilization #30

Closed agboon closed 3 years ago

agboon commented 3 years ago

Changing column yourls_expiry.keyword type to BINARY and excluding this from SELECT allows to lower CPU utilization to 0.1m from 3-5m in such requests with 10rps: /yourls-api.php?signature=xxx&action=shorturl&expiry=clock&url=https://url/test?agreement%3D123%26clientId%3Dqqq%26timestamp%3D2020123001%26secret%3Drwq%26grantType%3Dreferal%26city_id%3D1%26ctrk%3D14695631803%26yourls_nodecode%3D1&age=6&title=qqqq1&format=json&keyword=1tAfwFAFW-PYstha7ka1Be-I%3D before: image after: image

vitalyzhakov commented 3 years ago

@joshp23 , hello! Can you merge this?

joshp23 commented 3 years ago

sorry for the delay here.