MyBB Community Forums

Full Version: Memory Usage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm just simply trying to establish what permissions you're setting for each forum that aren't inherited from the usergroup settings. For example, another user is having to change the 'Can view forum?' permission for every forum. What permissions are you actually changing on a per-forum basis??
(2011-05-27, 07:53 PM)StefanT Wrote: [ -> ]
(2011-05-27, 07:09 PM)MattRogowski Wrote: [ -> ]That's just to stop output like CSS and javascript being cached by your browser, that's not related to the forum cache.
No, MyBB has no influence on static files like images or Javascript.

If you enable the Send No Cache Headers setting, it will send headers telling the browser not to cache things...

if($mybb->settings['nocacheheaders'] == 1 && $mybb->settings['standardheaders'] != 1)
{
	header("Expires: Sat, 1 Jan 2000 01:00:00 GMT");
	header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
	header("Cache-Control: no-cache, must-revalidate");
	header("Pragma: no-cache");
}

This will stop things like CSS and javascript being cached by the browser. That's the point of it, is it not, to not cache things?? Hence the name of the setting.
(2011-05-27, 07:55 PM)MattRogowski Wrote: [ -> ]I'm just simply trying to establish what permissions you're setting for each forum that aren't inherited from the usergroup settings. For example, another user is having to change the 'Can view forum?' permission for every forum. What permissions are you actually changing on a per-forum basis??

There are no permissions set, they are all inherited from the default.


In the Admin Control Panel, the Total Cache Size is only 2.21 MB.
Why does it take 50MB to load 2MB from the cache?
(2011-05-27, 07:57 PM)MattRogowski Wrote: [ -> ]
(2011-05-27, 07:53 PM)StefanT Wrote: [ -> ]
(2011-05-27, 07:09 PM)MattRogowski Wrote: [ -> ]That's just to stop output like CSS and javascript being cached by your browser, that's not related to the forum cache.
No, MyBB has no influence on static files like images or Javascript.

If you enable the Send No Cache Headers setting, it will send headers telling the browser not to cache things...

if($mybb->settings['nocacheheaders'] == 1 && $mybb->settings['standardheaders'] != 1)
{
	header("Expires: Sat, 1 Jan 2000 01:00:00 GMT");
	header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
	header("Cache-Control: no-cache, must-revalidate");
	header("Pragma: no-cache");
}

This will stop things like CSS and javascript being cached by the browser. That's the point of it, is it not, to not cache things?? Hence the name of the setting.
AFAIK this tells the browser and the proxies not to cache the HTML output.
(2011-05-27, 08:07 PM)AndrewGB Wrote: [ -> ]
(2011-05-27, 07:55 PM)MattRogowski Wrote: [ -> ]I'm just simply trying to establish what permissions you're setting for each forum that aren't inherited from the usergroup settings. For example, another user is having to change the 'Can view forum?' permission for every forum. What permissions are you actually changing on a per-forum basis??

There are no permissions set, they are all inherited from the default.


In the Admin Control Panel, the Total Cache Size is only 2.21 MB.
Why does it take 50MB to load 2MB from the cache?
There may be parts where it loops through the forums (e.g. for hierarchy).
Quote:Generated in 0.2692540 seconds (84.85% PHP / 15.15% MySQL)
SQL Queries: 11 / Global Parsing Time: 0.1003740 / Memory Usage: 40 MB
PHP version: 5.2.12 / Server Load: 2.53 / GZip Compression: Disabled

I have attached the advanced stats. Can you just confirm the cache is causing the high memory usage? Also, can you give me a rough idea how much memory the forum will take once I start getting registered users and thousands of posts?

50MB x 40 Users = 2000MB

If I am hosting this forum on a server with 2GB of memory then I guess that the limit would be 40 users loading the page at the same time before there is a problem (excluding the OS memory)??
(2011-05-27, 08:17 PM)StefanT Wrote: [ -> ]
(2011-05-27, 07:57 PM)MattRogowski Wrote: [ -> ]
(2011-05-27, 07:53 PM)StefanT Wrote: [ -> ]
(2011-05-27, 07:09 PM)MattRogowski Wrote: [ -> ]That's just to stop output like CSS and javascript being cached by your browser, that's not related to the forum cache.
No, MyBB has no influence on static files like images or Javascript.

If you enable the Send No Cache Headers setting, it will send headers telling the browser not to cache things...

if($mybb->settings['nocacheheaders'] == 1 && $mybb->settings['standardheaders'] != 1)
{
	header("Expires: Sat, 1 Jan 2000 01:00:00 GMT");
	header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
	header("Cache-Control: no-cache, must-revalidate");
	header("Pragma: no-cache");
}

This will stop things like CSS and javascript being cached by the browser. That's the point of it, is it not, to not cache things?? Hence the name of the setting.
AFAIK this tells the browser and the proxies not to cache the HTML output.

It's not going to not cache the HTML but still cache the CSS and javascript... numerous people have had problems where CSS and javascript, and other things, are being cached and not updating, and changing this setting fixes it, because then it's not caching.

(2011-05-27, 08:07 PM)AndrewGB Wrote: [ -> ]
(2011-05-27, 07:55 PM)MattRogowski Wrote: [ -> ]I'm just simply trying to establish what permissions you're setting for each forum that aren't inherited from the usergroup settings. For example, another user is having to change the 'Can view forum?' permission for every forum. What permissions are you actually changing on a per-forum basis??

There are no permissions set, they are all inherited from the default.


In the Admin Control Panel, the Total Cache Size is only 2.21 MB.
Why does it take 50MB to load 2MB from the cache?

Then it's not even using the cache for permissions as it doesn't store anything extra if it's just using the default... right, go to ACP > Tools & Maintenance > Cache Manager, what's the biggest cache here by value??

It's not going to use 50MB of memory for every user (or does it...??), this forum is currently running at 15.75 MB with 230 users on; we can't really foresee how much memory your server will use though.
The "forums" cache is 2.16MB, everything else is just a few KB. For this site, does that mean though that if all 230 users accessed the forum at the same time, the server would need at least 3622.5MB to process the request?

Although all my forums are being displayed at the moment, I don't actually need to display 99% of them to be shown, the users will access the forums by a direct link. I have created an extra field in the forums database called "hidden", would will allow me to cut down the SQL query.

I have made this very simple change:
SELECT * FROM ".TABLE_PREFIX."forums WHERE active != 0 AND hidden = 0 ORDER BY pid, disporder

SELECT f.*, fr.dateline AS lastread FROM ".TABLE_PREFIX."forums f LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}') WHERE f.active != 0 AND hidden = 0 ORDER BY pid, disporder

This cuts the memory usage from 50MB to 21MB but I still don't understand why it is so high when it is only loading 28 forums.
I just wanted to comment on the memory usage vs number of users.
When the forum stats show that its using x amount of memory, it does not mean that that amount of memory is being used constantly by php, if the page was generated in .5 seconds then it means that during the .5 seconds that the page was generated, it used xMB of memory then released it after generating the page. The total memory usage for all your users is not a simple xMB multiplied by the # of users because for that to be true it would mean that all your users loaded the site in that same .5 seconds.
In addition to that, webservers use threads, so even though you may have 1000 users accessing the site, but the webserver is set to say 250 threads then it will only process the users 250 at a time further reducing the chances of memory usage as described above.




Pages: 1 2