CodeSatori
In the above and the surrounding code inside the same "updateInvite" action, if you follow the trails, here's what happens when it runs:

- Database query for new messages
- Database select query inside function getBlockedUsers()
- Database select query and data processed inside function getUserInfo()
- Data parsed into XML via function parseXml()
- Database delete query

If you do all of the above at 5 second intervals, and dozens of users are online, it will definitely take its see more toll. Remedies off the top of my head:

- blockedUsers and userInfo data should be cached, not requested again and again
- delete query can be removed if message select query narrows by > datetime since last query, cleanup left to a cron job

This would drop SQL queries from 4 to 1, which is a dramatic difference in terms of performance. Moreover, actions recurring on rapid intervals should be isolated into smaller interdependent file subsets, and called as such only, to escape the otherwise large overhead.
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.
PET:0.039383888244629