A client site that is growing fast recently complained that the site is slow when creating nodes or when commenting.
The slowness was very noticable, taking up to 30 seconds from the time "Submit" button is clicked, until the site comes back with a new page.
The site has approximately 14,000 nodes, 109,000 comments and 22,000 users.
After a lengthy investigation it turned out that it was the subscription module that was the cause for the slow down. Every time a comment or node is posted, subscriptions executes a set of queries and sends the emails to those subscribed to the nodes or taxonomies.
This takes a lot of time.
However, there is a workaround for this, right in subscriptions' settings.
The following options allow the emails to be sent when cron runs, not when nodes or comments are posted:
Use cron for notificationsSends subscription notification when cron module runs. Default is to send upon node update.
Note: Currently only tested with MySQL.
There is a bit of a performance hit when cron runs, but it is not noticable. It is certainly better than thousands of users having delays when posting nodes or comments.