• Welcome to Simple Machines Community Forum. Please login or sign up.
November 27, 2021, 10:12:47 PM

News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord


Database Input/Output Usage extremely High at times

Started by @rjen, May 02, 2021, 02:37:58 AM

Previous topic - Next topic

@rjen

Last week I was contacted by my hosting partner that our website is exceeding server limits for Input/Output Usage.

I was told to optimize our website or they would shut it down. This website is our SMF forum.
Unfortunately the forum is already optimezed to the best of my knowledge, following these guidelines:
https://wiki.simplemachines.org/smf/Performance_enhancements

We are using SMF 2.0.18
PHP version 7.4
The host provides REDIS caching, so to use that I have implemented this mod:
https://custom.simplemachines.org/mods/index.php?mod=4119

The forum is not extremely big:
290245 messages in 12600 Topics by 1097 members.

What I need help with is this:
I see that the server I/O Usage goes wild for a period of time, but it also slows down but for reasons I cannot find: mind you there have been NO changes in mods or settings in the forum at the time. I also see no increases in visitors at the time.

See attached images for illustration.

I have checked the REDIS caching, to find that the caching is working, but the average cache used is around 1MB, which (according to my host) is VERY low and I have not been able to use more of it (tried by updating the ttl setting from 120 seconds to as much as 7200, but no difference)

I also checked my various MOD's, but they have been there for quite a while and I am not directly seeing any issues there...
(List below).

Since there are also some test forums on the same server I did close those down to make sure they are not causing it, but no difference.

So now I do not know what to check next. I could use some hints or pointers if possible...

Mods currently installed
View Only Boards   1.2c
Ignore Topics   2.3
AJAX Recent Topics   1.1
Auto Lock Old Topics   2.0
Custom Board Sort   1.0.2
Alternate User Posting   1.0.1
Group Attachment Limits   1.1.0
EU Cookie FJR   1.3fjr
Remove "Last edit" mod   0.2.5
Float BBCODE   1.0.2
Users Online Today   2.1
Board Index Unread Icon Fix   1.0
Spiders Don't Increase Topic Views   1.1.1
Search Focus Dropdown   1.6.1
Image Processing Memory Limit   0.1.2
Sortable Packages (and Installed Time)   1.3.5
Tidy Child Boards   2.0
Google Analytics Code   1.5.1
Simple .htaccess Cache Mod   2.7
Responsive Curve   1.1.0 (Unofficial Rev2)
Global Topics   2.2
More Spiders   1.2
PECL Redis Support   0.1FJR
SMF Optimus   2.6.6 [06.08.20]
Generic Avatars   1.11
Previous and Next Links for Page Index   2.1.204 FJR
Simple Audio Video Embedder   6.0
Voter Visibility   2.1(2.0.18)
Voter Visibility   2.1 FJR
YandexGarland   1.3.3
Downloads System   3.0.8b
TinyPortal   2.0.1
Image Attachment Thumbnail View   1.0
Post and PM Inline Attachments   7.01
Automatic Attachment Rotation (and Resize)   6.02
SMF-20-fix_birthdate (uninstall before 2.0.19)   1.0


Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Aleksi "Lex" Kilpinen

Sadly, it sounds like your best course of action might actually be to search for a better host.
You can try to cut down DB usage by limiting access for bots and spiders, lowering logging settings (for example, don't log spiders), and so on - but at the core of it all, SMF is a UI for a database.
So SMF will cause DB traffic. ( Any and all AJAX stuff is likely to cause unnecessary calls though, so you may want to reconsider that AJAX recent topics mod for example.. )
A Finnish Project Manager (Support Specialist)
 Happily running multiple SMF 2.x installations.
  Fooling around with i7-10700 @ 2,90GHz-4.80GHz / 16Gb / RTX-2070 Super / 3840x2160 / Win 10 x64


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

@rjen

I was just looking at the AJAX recent topics. Already set the update interval to every 60 seconds (was set to 10)
Logging of spiders was set to very high, set that to minimal now...

I also noticed that the reported value under load balancing in SMF is pretty High: seems to fluctuate around a value of 20 to 25...




Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Kindred

anything AJAX will be "expensive"

Also, if you do not have full text or custom search index enabled, that will cause database spikes.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

@rjen

Ajax update is set to 60 secs, index is Custom index . Still the load does fluctuate. Today it is very low again, no changes on my end though...
Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

shawnb61

Hard to tell without knowing which queries are the problems. 

My first suggestion would be to enable & use MySQL's slow query log to ID long-running queries. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

@rjen

Ok, that's something. Not sure how to activated that though?
Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Kindred

well, I asked my host and they pin pointed it for me within 5 mins....  :P
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

@rjen

That does not help, my host keeps telling me it's something I should fix... but maybe with this specific question I can get a better answer.
Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

shawnb61

I would first try to do it via the command line.  Something obvious might pop up quickly.

You can also enable it by default by changing your config.  Over time there are utilities that help you understand the log better.  Worth being careful here, because you'll forget about it & then your log will just grow indefinitely.  But good for a broader analysis of all long running queries.

To enable it via the command line for temporary usage:
https://www.a2hosting.com/kb/developer-corner/mysql/enabling-the-slow-query-log-in-mysql

To enable it in your config:
https://docs.cpanel.net/knowledge-base/sql/how-to-enable-the-slow-query-log-in-mysql-or-mariadb/

Helpful overviews - including using the log analyzer:
https://blog.toadworld.com/2017/08/09/logging-and-analyzing-slow-queries-in-mysql
https://mariadb.com/kb/en/slow-query-log-overview/
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

Even if your host refuses to diagnose the issue, they should at least be able to start the logging for you.

Once you have some queries in hand, you need to run explain plans on them & see what's going on...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: