MyBB Community Forums

Full Version: Thoughts on reducing memory usage?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
To sum up the issues I am having with memory usage:

1. Resting Physical Memory Usage is around 25-27 MB when just viewing the index, and around 33 MB when someone is viewing a post or posting.
2. This increases during weekends, and last weekend the forum just crashed with a 503 error.
3. An example load when loading the forum is: Generated in 156 ms (77.01% PHP / 22.99% MySQL), SQL Queries: 23 / Server Load: 0.83 / Memory Usage: 16 MB.
SQL Queries: 23 / Server Load: 0.93 / Memory Usage: 16 MB
I am not sure whether this is related to tasks, or some mysql error. 

I am less inclined to think it is entirely related to plugins, as even if I set it to Disable All Plugins, and Uninstall/Delete the plugins, the Physical Memory Usage is little different, and the same with the load time. 

After the forum came back after the crash, I removed some plugins that weren't necessary, and hopefully that helped. But my concern is that it might crash this weekend again or hypothetically if more users than usual go online and post. 

Task List:

(Enabled) Backup NewPoints
Creates a backup of NewPoints default tables and users's points.
05-26-2019, 12:00 AM

(Enabled) Daily Cleanup
Cleans out old sessions and read threads.
05-25-2019, 12:00 AM

(Enabled) Delayed Moderation
Automatically performs delayed moderation actions every 24 hours.
05-25-2019, 12:00 AM

(Enabled) Half-hourly User Cleanup
Automatically expires bans, warnings and posting suspension and moderation times for users.
05-24-2019, 05:59 PM

(Enabled) Hourly Cleanup
Cleans out old searches, captcha images, registration questions and expires redirects.
05-24-2019, 06:00 PM

(Enabled) Log Pruning
Automatically cleans up old MyBB log files (administrator, moderator, task, promotion, and mail logs.)
05-25-2019, 05:21 AM

(Enabled) Mass Mail
Automatically sends any queued mass mailings every 15 minutes.
05-24-2019, 05:40 PM

(Enabled) MentionMe Name Caching
Caches active user names mention links to conserve queries during daily use.
05-25-2019, 12:00 AM

(Enabled) MyAlerts Cleanup
A task to cleanup old read alerts. This is required as otherwise the alerts table could swell to massive sizes.
05-27-2019, 01:00 AM

(Enabled) NewPoints Bank System
This task work everyday and it is a part of Bank System plugin for NewPoints.
05-25-2019, 12:00 PM

(Enabled) OUGC Awards
Adds a powerful awards system to you community.
05-26-2019, 12:00 AM

(Enabled) Promotion System
Automatically runs the promotion system every 20 minutes.
05-24-2019, 05:45 PM

(Enabled) Stylesheet Re-Cache
Re-caches all stylesheets to the filesystem, including minifying the styles.
01-05-2020, 12:00 AM

(Enabled) Tables Check
Automatically runs a table check and attempts to repair any crashed tables.
05-24-2019, 06:00 PM

(Enabled) Thread Views
Automatically updates thread views every 15 minutes. This task will automatically be enabled or disabled when changing the 'Delayed Thread Views' setting.
05-24-2019, 05:55 PM

(Enabled) User Pruning
Automatically prunes users based on criteria set in the settings every day.
05-25-2019, 02:00 AM

(Enabled) Version Check
Automatically checks for news and new versions of MyBB every day.
05-25-2019, 02:00 PM

(Enabled) Weekly Backup
Automatically backups your MyBB tables to your backups directory.
05-26-2019, 12:00 AM

Crash occurred on the 19-21st of this month, and this is what I got in the Resource Usage snapshot:

[attachment=41792][attachment=41793][attachment=41794]

Other info:
  • MySQL Disk Usage is about 11.99 MB.
  • Forum address is: https://lazarusns.com
  • There are about 201 users registered, but they are never on at one time.
  • Database is Mysqli. 
  • File Verification shows no errors.
  • Forum themes are Default, NetPen Pro, and FunkyOne.
  • There are not a lot of visitors to the forum, and at any one time there are maybe three or four online, as most users use discord. 
  • Having Google Ads does slow down the forum load, and make the forum load longer, but might as well have the revenue. 
Change hosts. What hosting service do you use?
How many members do you have along with daily posts?

Any reasonable host shouldn't have a memory problem with a small to medium sized forum.

That memory shouldn't be an issue.

Enable error logging in ACP too. This may help you track bugs.
Already switched hosts once already this year.

Currently with Hostwinds.

Edit: Though, if I had to re-host again, I'll probably switch to DigitalOcean as I have had my fill of shared hosting, and it can't be drastically different from Amazon AWS. 

Basically whenever showthreads is accessed or someone goes to post, the forum usage goes to a very high value, like 15-30 MBs, regardless of forum users online. 

The forum isn't crashing now that I have disabled a large number of tasks, and I/O usage is limited at least one or two days a week. 

I'll ask the support at Hostwinds about /usr/sbin/httpd -k start showing high memory usage.

Only other thing I can think of is that when I enabled SMTP mail it crashed the forum. 

The database or apache may have gone haywire in the process.

So I might just wait for whenever the next myBB update is, and try and fix it then. 

As long as it is working okay, that is really all that is bothering me. 

Already spent enought days with mysql and checking the forum files.
Summer classes have started for me, so I am just leaving it for now, rather than pulling my hair out.   Smile
Definitely a host issue.

Mine is no where near that?

[attachment=41819]
(2019-06-02, 01:33 AM)New Rogernomics Wrote: [ -> ]Already switched hosts once already this year.

Currently with Hostwinds.

Edit: Though, if I had to re-host again, I'll probably switch to DigitalOcean as I have had my fill of shared hosting, and it can't be drastically different from Amazon AWS. 

Basically whenever showthreads is accessed or someone goes to post, the forum usage goes to a very high value, like 15-30 MBs, regardless of forum users online. 

The forum isn't crashing now that I have disabled a large number of tasks, and I/O usage is limited at least one or two days a week. 

I'll ask the support at Hostwinds about /usr/sbin/httpd -k start showing high memory usage.

Only other thing I can think of is that when I enabled SMTP mail it crashed the forum. 

The database or apache may have gone haywire in the process.

So I might just wait for whenever the next myBB update is, and try and fix it then. 

As long as it is working okay, that is really all that is bothering me. 

Already spent enought days with mysql and checking the forum files.
Summer classes have started for me, so I am just leaving it for now, rather than pulling my hair out.   Smile

Have you considered getting VPS hosting? 

I did have shared hosting, but due to many restrictions, I decided to dump shared hosting and go with VPS hosting.

Since, I've been using VPS, I have had far fewer issues and the speed of the webpage loading has gotten faster.
 
Check out my THREAD about me making the switch.
As an update on this since the 1.8.21 update:

Think whatever was heavily going wrong was resolved after I ran the update.

Still high memory usage, but it isn't having issues like before.

Only the automedia plugin now shows errors in the error.log. So I have removed that for now.