As there are more and more threads & messages in Instant Messenger plugin, it might get slow - due to extensive queries.
Add following index on your DB to increase performance of queries (in my case they were 10x faster):
CREATE INDEX im_1 ON oc_t_im_threads (i_thread_id,i_from_user_id,i_to_user_id);
CREATE INDEX im_2 ON oc_t_im_messages (fk_i_thread_id,i_read,i_type);
oc_ is database prefix, if you have different, change it