Recent Topics

1 Dec 16, 2004 18:48    

Hello,

My project is to implement a free blogs service open to anyone with instants subscription features.

What are the parameters which limit the number of subscribers inside b2evoltuion running on one server?

Limitations of hard disk space, MySql, PHP or else?

That is, how many subscribers can use b2evolutioin on one server?

Have any protection features against voluntarily or accidental modifications of other subscribers content and associated comments been integrated in the current release of b2evoliton?

Thank you,

Antony

2 Dec 16, 2004 19:30

It all depends on the actual server restrictions - HD space and CPU power.

Besides that, you could run infinite copies of b2evo as long as you gave them their own prefixes or databases.

If you have multiple installations using one database, don't give your users FTP access as they could upload scripts to access other tables in that database that belong to other users.

You could also do like 1 big installation of b2evo and like give everyone their own blog (only give them permissions to their own blog). That probably sounds like the best plan to me.

3 Dec 17, 2004 07:22

For example: The Starter Plan option at http://www.imhosted.com/hosting_plans.shtml

What would be the limitations on the amount of simultaneous users?

Is it possible to automate subscriptions with instant activation under b2evolution?

Do you have any similar use of b2evolution of what I am looking for?

Antony

4 Dec 17, 2004 07:41

Damn, that's a pretty good hosting deal.

Anyway, when I say serious amounts of users, I'm talking thousands here. Then the only problem you run into is a rather large database and querying it can start putting a load on the server.

As for registations, probably the best thing to do is write your own registration script rather than using b2evo's so that you can have increased registration security (no spammers) and so that when a new user registers, the script can manually create a new blog for them and give them permissions to that blog.

5 Dec 30, 2004 18:05

Hi alodoiska

B2evo is a great blog system but is not fully optimized for many users. You will need to make several modifications in order for it not to load your server. I made some posts regarding this before but I guess they were wiped out in the forums hacking incident :(

These are the main hacks / optimizations I found to help. If there are more I will be happy to hear about them ;)

1) When those search engine bots start to hammer you will need to give your ?statistics gathering? a lower priority by adding the DELAYED operator to the INSERT command (which was locking the mysql table? table locking vs. record locking etc.)

Line 179 in \b2evocore\_functions_hitlogs.php:

$sql = "INSERT DELAYED INTO $tablehitlog( visitTime, visitURL, hit_ignore, referingURL, baseDomain,

2) some mysql optimization I did after reviewing the sql statements

in evo_blogusers add a unique index on bloguser_blog_ID together with bloguser_user_ID
in evo_categories index cat_name
in evo_hitlog fulltext index on referingURL

3) b2evo loads into memory ALL blogs details (if you have 1000 blogs it will load 1000 blogs into memory). I guess it was done to speed the blogs but it backfires when you have a lot of blogs. It took me a lot of time to find out why the server got to high loads (coz of PHP) with relatively low concurrent users. This ?hack? is a bit longer than the previous two but is the real lifesaver. It basically saves in a new table the blogs which were requested so not ALL blogs detail get loaded into memory. I am sure it could have been fixed more elegantly but I didn?t have the time :)

First add this table to your b2evo DB:

CREATE TABLE `active_blogs_no_load` (
  `active_blog_name` varchar(30) NOT NULL default '0',
  `active_blog_id` int(12) NOT NULL default '0',
  `active_blog_date` datetime NOT NULL default '0000-00-00 00:00:00',
  KEY `active_blog_id` (`active_blog_id`),
  KEY `active_blog_name` (`active_blog_name`)
) TYPE=MyISAM COMMENT='help lower the load on blogs';


second add these lines to index.php (replace the *****)


    $dbname = "*****";
    $dbserver= "*****";
    $username="*****";
    $password="*****";
    $cn=mysql_connect("$dbserver","$username","$password");
    mysql_select_db($dbname,$cn);

// deleting blogs that were last looked upon 5min ago
    $sql='DELETE FROM active_blogs_no_load WHERE active_blog_date < "'.date("Y-m-d H:i:s",time()-5*60).'"';
$rsCat_query=mysql_query($sql, $cn);

$what_are_we_looking_for = explode("/",$_SERVER['PATH_INFO']); // the blog name of course

// delete this blog so we can update its timestamp (the indexes don?t allow to use REPLACE)
    $sql='DELETE FROM active_blogs_no_load
WHERE active_blog_name = "'.$what_are_we_looking_for[1].'"';
	$rsCat_query=mysql_query($sql, $cn);

// adding the blog to the active list
    $sql='INSERT INTO active_blogs_no_load (active_blog_name,active_blog_date) 
	VALUES ("'.$what_are_we_looking_for[1].'","'.date("Y-m-d H:i:s").'")';
	$rsCat_query=mysql_query($sql, $cn);


// adding to the table the blog_id so it will be easier to JOIN in queries
    $sql='update active_blogs_no_load INNER JOIN evo_blogs on blog_stub = active_blog_name set active_blog_id = blog_ID';
	$rsCat_query=mysql_query($sql, $cn);

Third make some changes to blog_load_cache function in \b2evocore\functions_blogs.php


	$cache_blogs = array();
		$query = "SELECT * FROM $tableblogs 
		INNER JOIN active_blogs_no_load on active_blog_id = blog_ID 
		ORDER BY blog_ID";
		$result = $DB->get_results( $query );

forth make some changes to cat_load_cache function in \b2evocore\functions_cats.php


		// echo "loading CAT cache";
		$sql = "SELECT cat_ID, cat_parent_ID, cat_name, cat_blog_ID
				FROM $tablecategories
				INNER JOIN active_blogs_no_load on active_blog_id = cat_blog_ID
				ORDER BY cat_name";

and later on

		$where_link = ' AND ';
		}

		$sql = "SELECT postcat_cat_ID AS cat_ID, COUNT(*) AS cat_postcount
			FROM $tablepostcats INNER JOIN $tableposts ON postcat_post_ID = ID
			INNER JOIN evo_categories on cat_ID = postcat_cat_ID 
			INNER JOIN active_blogs_no_load on active_blog_id = cat_blog_ID 
						$where
						GROUP BY cat_ID";
		$rows = $DB->get_results( $sql, ARRAY_A );

Hope it helps and good luck :)


Form is loading...