3 ms·
tldr: The php process hit the max connections inside the database pool, which caused blocking within the php threads, which caused a thundering herd problem, an
by mark242 6y ago
tldr: The php process hit the max connections inside the database pool, which caused blocking within the php threads, which caused a thundering herd problem, and without correct tracing inside the wordpress php files the authors didn't know this and assumed that there wasn't enough caching on the front-end.
"at least 2 database-touching requests for every person reading the post" should never be a blocker for 2 requests per second unless you truly do not understand your application infrastructure at all.
on edit: The better solution here would be to figure out where the MySQL server was being put under load -- hint, it probably was 99% idle, because unless that sidebar file was making an unindexed query there's no way things would take 500ms -- and then realize that you need to bump up the number of database connections in your php pool to be MYSQL_MAX_CONNECTIONS so that php isn't blocked on obtaining a new connection. Problem solved.