I will echo the others though it has only been the last few hours I have been getting the 504s. I even had a search fail on me earlier* though I do not know if that was if you enacted measures (it was after you noted this topic).
For the past few days (maybe up to about a week though I was on lousy connections for the week prior so it might have been longer) what I imagine to be the database access stuff has been a bit slower -- things like posting, getting alerts, editing posts, doing the moderator bit up to and including simply selecting posts sometimes sees me get more posts selected (if I select 2 I might get 4, it might also still tell me I have two selected even if I merged the posts or something). I have made a few double posts but most of those were because the posts did not automatically add and revert me and it sometimes takes a full page refresh (control and f5) to find out I did actually succeed in posting.
I have had to sort an increasingly large amount of double posts as well.
A couple of weeks back it was not instant but definitely blink and you miss it.
*I do not know if it is because I am staff or what but I have no time limits/cooldown times on my searches and I can search for nothing but restrict by member name.