The following query needs to be looked at.
It was arriving to commonswiki and it was taking almost 60 seconds to finish (the query killer kicks in at 60) so it is likely to be killed often:
root@db1084.eqiad.wmnet[commonswiki]> explain SELECT /* IndexPager::buildQueryInfo (NewFilesPager) */ img_name, img_timestamp, actor_img_user.actor_user AS `img_user`, actor_img_user.actor_name AS `img_user_text`, img_actor FROM `image` JOIN `actor` `actor_img_user` ON ((actor_img_user.actor_id = img_actor)) LEFT JOIN `user_groups` ON (ug_group = 'bot' AND (ug_user = actor_img_user.actor_user) AND (ug_expiry IS NULL OR ug_expiry >= '20200206194925')) WHERE (ug_group IS NULL) ORDER BY img_timestamp DESC LIMIT 51 /* 2567daabb35c15eb12ef18d460139091 db1084 commonswiki 59s */; +------+-------------+----------------+--------+----------------------------+---------------------+---------+---------------------------------------------+---------+---------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+----------------+--------+----------------------------+---------------------+---------+---------------------------------------------+---------+---------------------------------+ | 1 | SIMPLE | actor_img_user | ALL | PRIMARY | NULL | NULL | NULL | 8690956 | Using temporary; Using filesort | | 1 | SIMPLE | user_groups | eq_ref | PRIMARY,ug_group,ug_expiry | PRIMARY | 261 | commonswiki.actor_img_user.actor_user,const | 1 | Using where; Not exists | | 1 | SIMPLE | image | ref | img_actor_timestamp | img_actor_timestamp | 8 | commonswiki.actor_img_user.actor_id | 2 | Using index | +------+-------------+----------------+--------+----------------------------+---------------------+---------+---------------------------------------------+---------+---------------------------------+ 3 rows in set (0.00 sec)