Page 1 of 1

Maximum Members - Practical Limitations

PostPosted: January 23rd, 2012, 7:41 pm
by boldplans
I know that in theory there is no practical limit of members. Your plugin is very well designed and works much more quickly than others. However Wordpress has its own limitations and issues with scalability. This specifically concerns how members are managed by wordpress, joins and table locking. Is there something that you can recommend or give us an idea about practical limitations using the plugin for a large number of members? For many here, having 5,000 members is a lot of members. Some of my sites we have many passers by who create accounts, are active for a few days and gone. That number could be 50,000.

What kind of guidance can you provide with regard to S2Members' best application and what Wordpress limitations we might see? What about best practices for member management and speed/scalability?

I'm just about all out of questions. I wanted to say just how OUTSTANDING support is here and how I'd be ready to recommend to anyone how purchasing the pro version here is absolutely worth it and is the best priced plugin for features and support. Thanks again in advance.

Re: Maximum Members - Practical Limitations

PostPosted: January 26th, 2012, 4:16 am
by boldplans
Not sure of the right forum. I've discovered some user limitations and was hoping to get some insight how to solve them. Started pretty early on and was surprising. Not sure what is causing the significant slowdown.

Re: Maximum Members - Practical Limitations

PostPosted: January 26th, 2012, 4:34 am
by Cristián Lávaque
Thank you for the kudos! Very glad you're happy with s2Member. :)

About your question, here are some recommendations Jason gave for the server: viewtopic.php?f=36&t=14303#p29853

Here's another one, on speed improvements for WordPress: viewtopic.php?f=4&t=14359&p=33441#p33441

Of course, a good caching solution is very important. http://wordpress.org/extend/plugins/quick-cache/

I hope that helps a bit!

Re: Maximum Members - Practical Limitations

PostPosted: January 26th, 2012, 4:36 am
by Cristián Lávaque
boldplans wrote:Not sure of the right forum. I've discovered some user limitations and was hoping to get some insight how to solve them.


What do you mean by user limitations?

Re: Maximum Members - Practical Limitations

PostPosted: January 26th, 2012, 5:51 am
by boldplans
Cristian - thanks for the reply. Caching isn't the issue and this may be a problem related to user management we discussed earlier and WP's failure to properly address and optimize this. My user registrations have grown north of 50,000 users, easy to do on a site with a forum. I've found some strange problems that may be related to the multisite management plugin but it seems to be a possible issue with S2M.

I imported about 20K for test purposes. When I go to the user admin to see "all users" it takes a good 20 seconds for the first page to load. I disabled the S2M plugin and still had some hiccup. I turned the MS Management plugin off and then on and it worked ok.

I'm wondering whether WP is choking on all that metadata stored in the usermeta table. Maybe I'm missing something but it's terribly inefficient instead of just adding fields right onto the users table and done. The usermeta table size is easily the largest of all. I tested an import of 15,000 users in a test database and found that the WP database was 25MB with 17MB in the usermeta table alone. I wonder whether S2M's fields in that table may cause paging issues.

Re: Maximum Members - Practical Limitations

PostPosted: January 28th, 2012, 5:20 pm
by boldplans
I found some interesting results, most of which have nothing to do with S2M although Wordpress isn't exactly stellar when it comes to user table efficiency. We're rolling again although I wondered about this question.

Re: Maximum Members - Practical Limitations

PostPosted: January 29th, 2012, 8:03 am
by boldplans
Looks like I hit a wall. Seems like there is a slow query that is logged and causing me great grief:

SELECT wp_users.* FROM wp_users INNER JOIN wp_usermeta ON (wp_users.ID = wp_usermeta.user_id) WHERE 1=1 AND (wp_usermeta.meta_key = 'wp_capabilities' ) ORDER BY user_login ASC;

I am not sure what is triggering this query and searches seem to related to author pages but that's not what is being accessed. Either way, this creates a user limit. Don't think it has anything to do specifically with s2member but probably with Wordpress itself and it's generally poor member handling.

Code: Select all
[Sun Jan 29 08:05:53 2012] [error] [client 1.1.1.123] PHP Fatal error:  Maximum execution time of 90 seconds exceeded in /home/mysite/public_html/wp-includes/meta.php on line 570, referer: http://www.mysite.com/wp-admin/admin.php?page=ws-plugin--s2member-gen-ops


[Sun Jan 29 08:03:20 2012] [error] [client 1.1.1.123] PHP Fatal error:  Maximum execution time of 90 seconds exceeded in /home/mysite/public_html/wp-content/plugins/s2member/includes/classes/user-securities.inc.php(68) : eval()'d code on line 1, referer: http://www.mysite.com/wp-admin/plugins.php?deactivate=true&plugin_status=all&paged=1&s=


Code: Select all
[Sun Jan 29 08:28:36 2012] [error] [client 1.1.1.123] PHP Fatal error:  Maximum execution time of 90 seconds exceeded in /home/mysite/public_html/wp-includes/wp-db.php on line 1383, referer: http://www.mysite.com/wp-admin/network/admin.php?page=ws-plugin--s2member-info
[Sun Jan 29 08:25:49 2012] [error] [client 1.1.1.123] PHP Fatal error:  Maximum execution time of 90 seconds exceeded in /home/mysite/public_html/wp-includes/capabilities.php on line 566, referer: http://www.mysite.com/wp-admin/network/admin.php?page=ws-plugin--s2member-mms-ops
[Sun Jan 29 08:18:10 2012] [error] [client 1.1.1.123] PHP Fatal error:  Maximum execution time of 90 seconds exceeded in /home/mysite/public_html/wp-content/plugins/s2member/includes/classes/user-securities.inc.php(68) : eval()'d code on line 1, referer: http://www.mysite.com/wp-admin/network/admin.php?page=ws-plugin--s2member-mms-ops

Re: Maximum Members - Practical Limitations

PostPosted: January 29th, 2012, 5:41 pm
by boldplans
I tried to turn S2Member back on and got this. Now that is a lot of memory to be exhausted...

[Sun Jan 29 17:39:34 2012] [error] [client 111.111.111.111] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 72 bytes) in /home/mysite/public_html/wp-includes/meta.php on line 567, referer: http://www.mysite.com/wp-admin/network/plugins.php

Re: Maximum Members - Practical Limitations

PostPosted: January 31st, 2012, 1:01 am
by Cristián Lávaque
Yeah, the usermeta table is not something I like very much... I'll show your problem to Jason.

Re: Maximum Members - Practical Limitations

PostPosted: February 1st, 2012, 2:41 am
by boldplans
FYI, I tried to extend the timeout and it is just a no go. Not sure what kind of query is performed but load grew to over 40 from less than 1 until I saw the timeout.

Re: Maximum Members - Practical Limitations

PostPosted: February 6th, 2012, 2:33 pm
by Jason Caldwell
Thanks for the heads up on this thread.

This query you reported looks like it comes from an older version of WordPress? Starting with WordPress v3.1, this was deprecated in favor of WP_User_Query.

Please confirm which version of WordPress that you were running.

If it was prior to WordPress v3.1, I would highly recommend that you upgrade. There were several improvements in v3.1 in this respect, making WordPress a more solid choice for a large userbase.

Each site is unique, but I can tell you that I've seen WordPress/s2Member power sites with as many as 30K users. Beyond that you will likely need a database and object cache, along with lots of RAM. Of course, much of this depends on how active your users are, and on what other plugins you're running.

From older version of WordPress,
now inside: wp-admin/includes/deprecated.php
Code: Select all
    function prepare_query() {
        global $wpdb;
        $this->first_user = ($this->page - 1) * $this->users_per_page;

        $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
        $this->query_orderby = ' ORDER BY user_login';

        $search_sql = '';
        if ( $this->search_term ) {
            $searches = array();
            $search_sql = 'AND (';
            foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
                $searches[] = $wpdb->prepare( $col . ' LIKE %s', '%' . like_escape($this->search_term) . '%' );
            $search_sql .= implode(' OR ', $searches);
            $search_sql .= ')';
        }

        $this->query_from = " FROM $wpdb->users";
        $this->query_where = " WHERE 1=1 $search_sql";

        if ( $this->role ) {
            $this->query_from .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id"; 


WP_User_Query introduced in WordPress v3.1
http://codex.wordpress.org/Class_Refere ... User_Query