I am running a website with about 35k users in a table users
. Everytime a user requests a page, the database row for that user is updated with the current timestamp. This query, a simple
UPDATE `users` SET `last_seen`=1619472395 WHERE `id`=12345678
usually took like a microsecond or so.
From one day to the next, this query now takes much longer, sometimes up to two seconds, making the website very slow. Strange thing: Sometimes the query is as fast as you would expect, one second later it takes two seconds.
The user table is tiny, only has 35k rows (MyISAM), ´id´ is the primary key and the total database size is not even 100 MByte.
Any ideas what's going wrong here?