You have a number of possible factors involved. If you have pruning enabled, try disabling it - whenever a moderator or admin enters a forum, phpbb checks to see if it needs pruning, and pruning can take a LOT of CPU time on a big forum. Endless loop while pruning messages
covers changes that can be done to fix this. Posting while the system is purging cues the SQL request until the purge (with lots of CPU resources running) is completed, and PHP can time out waiting for the successful response. But the time-out does not remove the request.
If your word search tables are too big for the system resources (they can be rather taxing if not configured properly), posting can take a while, especially editing a post. The Knowledge Base article on Decreasing the size of your search tables
helps you "tweak" the "stop words" list to match your forum's usage, which can speed things a LOT. There is also a MOD to rebuild search tables
, which can help you deal with tables that have gotten out of hand.