I can't answer your questions definitively, but I can tentatively.

Originally Posted by
vekou
- Aside from this troubleshooting method, what other methods can we use to know if we are reaching the resource usage limit?
Sadly, I know of no methods that are easy or have a high likelihood of succeeding.
From PHP, you could get current processor stats (including CPU usage) using procfs, but PHP on the free hosts is restricted in what can be accessed via the filesystem. This would also require altering the plugins to add scaffolding at various points in them to log CPU usage. Adding scaffolding to log memory usage is still a possibility, but not an easy one.
A PHP profiler (such as Xdebug) can be used to gather information on how long various functions execute in a script. With that information, you could see how much time is spent in the functions each plugin defines. Since none is installed on the X10 hosts (and never will be; profilers aren't for production servers), you'd need to set up your own server to use one.
Since what you really need is a way of getting information at the moment WP reaches the resource usage limits, I doubt the above will be very helpful. The surest way is to start with no (or very few) plug-ins enabled, then enable one every other week. You could enable (then disable) more than one at each step, going for a binary search approach, but that will cause quite a few suspensions.

Originally Posted by
vekou
- I know that memory is not the only resource that is counted in the limit, i think it also includes the time a script is run, etc. What other resources are included in the limit and what those limits are?
The number of processes running under your account, the total time your processes run in a given period and the total percent of CPU usage are also monitored.
In mid 2009, the limits were:- 25% CPU
- 5% memory (eg 400 MB)
- 240 seconds of CPU time per hour
- 20 concurrent processes executing
If anyone (hi, admins) knows if these are the current values, it would be useful information to add to the HRU wiki page.

Originally Posted by
vekou
- I've noticed that everytime I get suspended, after unsuspending myself, I notice a few spams awaiting for moderation that weren't caught by Akismet. If Akismet is down and spam comments keep flooding in, will this hit the High Resource Limit since the script will probably keep on trying to contact the Akismet server?
It looks as though Akismet retries every 20 minutes. The retry function itself (take a look at akismet_cron_recheck) doesn't do too much. If there are a huge number of comments, it will have an impact, but shouldn't otherwise. You could add a LIMIT clause to akismet_cron_recheck's $comment_errors query to put a cap on the number of outstanding comments to process at any one go. For example:
Code:
SELECT comment_id
FROM {$wpdb->prefix}commentmeta
WHERE meta_key = 'akismet_error'
LIMIT 20
You could make the limit configurable via a plugin option.
PHP Code:
$comment_errors = $wpdb->get_col( $wpdb->prepare("
SELECT comment_id
FROM {$wpdb->prefix}commentmeta
WHERE meta_key = 'akismet_error'
LIMIT %d
", get_option('akismet_retry_comment_limit')) );
You'd also need to update akismet_conf in the plugin's admin.php to both handle changes to the new option and to display a form input for the option. To add the option itself, your best bet is probably a call to register_setting in akismet_admin_init in admin.php. I don't write WP plugins, so there might be a necessary alteration I'm leaving out.

Originally Posted by
vekou
Yes. More than many posters.
Some other thoughts on resolving this:
Resource spikes (especially ones that only happen every few days to a week) might be caused by spider crawls. Add a robots.txt to limit what spiders access.
Caching plugins can help, but only if properly configured for your site.