MyBB Community Forums

Full Version: Windows server issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Just installed MyBB into a Windows machine but i have some problems.

System specs: P4/3.4Ghz, 2 X 120MB SCSI 320, 2GB Ram, XP/SP2 - Apache2 (2.0.52) - PHP 4.3.10 - MySQL 4.0.23. Btw tt works just fine with all tested scripts.
MyBB is installed in D:\public_html\forum. All system files including OS, Apache and the rest are in C:

In fact MyBB installed fine and looks OK but...
When forum index page is been fully refreshed (using IE Ctrl-F5), it doesn't appear immediately, but in 1 - 1.5 sec. The problem is that while page refresh, Apache goes up to more than 50% in CPU resources and system disk C: is spinning like a crazy.

I'm not sure, if this overload happens because of Apache or MySQL requests, but it never happened to this system using any other PHP/MySQL script ever tested including heavy ones like VB, IPB even some PHP intranet applications (really heavy).
BTW same happens when in "post" "user CP" etc, but not in ACP. Footer debug says that page refresh was almost instantaneus, with no sign of overloading.

I do like MyBB but this excessive use of resources scares me.

Any idea ?
I've never experienced anything like this with MyBB. I develop on both Apache in Linux and Windows (as well as IIS in Windows) and the processing times on the boards as well as cpu usage are never really spiking. Even once significant load it put on the server from background tasks MyBB still runs fine.

What are the debug stats at the bottom of the page saying? That is the time it is taking MyBB to run start right through till finish before Apache serves the html to you.
Debug results follows...
Generated in 0.1667891 seconds (85.45% PHP / 14.55% MySQL)
MySQL Queries: 18 / Parsing 0.0011899 / Global Parsing Time: 0.1361361
PHP version: 4.3.10 / Server Load: Unknown / GZip Compression: Disabled
Although looks quite in order, i still have this problem, even after db cleanup and MyBB clean install.
Because of strange nature of this issue, i've installed Apache + MySQL + PHP in another Windows machine (no SCSI amd less RAM) but still MyBB has exactly the same weird behavior, 3-4 sec to refresh a page and during that time disk spins and server uses 30-40% of CPU resources Sad .
Admin panel work just fine though ! Strange...
I'm on Windows myself, I have just done a test with myBB and phpBB, By using the ctrl + Alt + Del and selecting the performance tab, which comes up with your CPU Usage.

When i refresh the page in mybb, my CPU Usage gauge goes upto 40 - 60%, but with phpBB it goes up to no even half what MyBB does.

Although the page refreshes instantly without no problems.

I think the reasoning for more CPU usage than phpBB is because evrythink is stored into the Database, which means more work for MySQL to fetch styles, settings, forums, threads etc.

NOTE: My Processer is an AMD Athlon 1.5Ghz which is two times as low as yours tedn.
wildteen88 Wrote:I think the reasoning for more CPU usage than phpBB is because evrythink is stored into the Database, which means more work for MySQL to fetch styles, settings, forums, threads etc.

Hmm, interesting, didn't know that MyBB stores everything in MySQL
In my case, the problem is that page isn't refreshed immediately.
I don't know maybe things would be smoother with a different MySQL version or setup...
Never experienced such an issue before, I'm confused Sad
I noticed
Quote:GZip Compression: Disabled
Try enabling it (if you can). Im no expert, but if the page is compressed, it should get to you and load much faster!

Admin CP > Board Settings > Change > Server and Optimization Options > Use GZip Page Compression? > Yes > Submit Changes
Gzip page compression will only speed up the downloaded HTML to the user as it is compressed. It will also add more CPU usage.

When MyBB is running you're bound to see spikes in CPU usage in MySQL and PHP. Depending on your setup they will differ. The same applies for any PHP script.
I ahve done a bit of prodding with myBB.

I have found out that in my error log that when I change a setting in the AdminCP the inc/settings.php becomes like this:
$settings[*value*] = "value" and causes this error:
[b]PHP Notice: Use of undefined constant
and a whole load of them which comes from inc/settings.php

heres an example of my log:

Quote:[03-Mar-2005 19:58:58] PHP Notice: Use of undefined constant load - assumed 'load' in C:\server\www\forums\mybb\inc\settings.php on line 7

[03-Mar-2005 19:58:58] PHP Notice: Use of undefined constant adminemail - assumed 'adminemail' in C:\server\www\forums\mybb\inc\settings.php on line 8

[03-Mar-2005 19:58:58] PHP Notice: Use of undefined constant pmsallowhtml - assumed 'pmsallowhtml' in C:\server\www\forums\mybb\inc\settings.php on line 9

And this causes the server to write extra error logs as the errors get written before the page content tis shown.

I have found a fix for this which will lower the stress on the sever to right the errors in log.

NOTE: Before doing this patch, download inc/settings.php to your computer for a backup, incase this doesn't work, and this can currupt your forum if not done properly.

open up admin/settings.php

and find (line 51):
$settings .= "\$settings[$setting[name]] = \"$setting[value]\";\n";

and replace with:
$settings .= "\$settings['$setting[name]'] = \"$setting[value]\";\n";

Now save an re-upload admin/settings.php.

Now login to your AdminCP as Admin, and Change and change a setting by disabling the board and enable the boars again.

You should see a lower CPU Usage percentage as the server isn't having to write out 110 plus errors out to your error log.

I have found this reduces stress on the CPU by 20 - 30%! Which is better! I think!

If I haven't explained well enough, when you chnage a setting in teh AdminCP, teh inc/settings.php changes the arrys like this:

$settings[value] which is incorrect and thus lots of PHP Notices: in the your server log. Mu fix will put in the right way which is:
$settings['value']

Hope you understand!

And sorrry for the lates bug fix, Chris. But its a simple code error to fix!

EDIT:

I have attached inc/settings.php with the patched line. BUT still backup inc/settings.php though. BUT it should work! Rolleyes
You didn't need to post the mile long log file Rolleyes While this is something Chris does need to fix (and hopefully has for Gold), I don't think the developers of PHP intended for notices to be turned on in a live setup. Notices are meant for program development.
Indeed, that is all fixed in gold.
Pages: 1 2