Twenty-four things you can do to make SMF go faster (Updated June 16th, 2010)

Started by Vekseid, February 16, 2009, 06:29:50 AM

Previous topic - Next topic

vbgamer45

If your mysql server is on the same machine change from connecting from localhost to 127.0.0.1 and get a big boost in some cases just saw this on one of my sites and it just had a massive increased in performance.
http://stackoverflow.com/questions/17815604/very-slow-1-second-connections
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

青山 素子

Quote from: vbgamer45 on September 16, 2015, 11:20:04 PM
If your mysql server is on the same machine change from connecting from localhost to 127.0.0.1 and get a big boost in some cases just saw this on one of my sites and it just had a massive increased in performance.

That's really weird. Normally, localhost resolves internally and should add little to no overhead. If you have control over the server, make sure localhost is an entry in your hosts file.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


vbgamer45

Yeah was shocked myself on my windows servers I updated it made a huge difference it for all my sites that that had databases on the same server.   The issue was php tries to look for ipv6 localhost first for mysql then ipv4. And mysql by default wasn't listening on ipv6.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

vbgamer45

Another tip just discovered that the smf_sessions table last_update should have an index to add one run

alter table smf_sessions add index last_update (last_update);
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Arantor


vbgamer45

That server does have memcache with level 3 smf caching I still saw that query hit though.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Arantor

Then turn off DB sessions and get PHP to use memcache for sessions.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

MobileCS

Quote8: Run the mark read for inactive users script periodically. The log_topics, log_boards, and log_mark_read tables are not the best designs, and for some unlucky folks end up dominating their database. Pruning them can help.

I think this should be rephrased. The "mark read for inactive users script" does not prune anything. In fact, it makes log_topics, log_boards and log_mark_read tables substantially larger.

What exactly is the benefit of running this script again?

Arantor

It prunes one set of tables and outs records in the other because if the way SMF works. It just so happens that for you it made it bigger, this is not universally true.

albertlast

Quote from: vbgamer45 on July 09, 2017, 04:58:44 AM
Another tip just discovered that the smf_sessions table last_update should have an index to add one run

alter table smf_sessions add index last_update (last_update);


Don't do this kind of advice based on your wrong setup smf.
index slow down dml actions.

MobileCS

Quote from: Arantor on August 06, 2017, 06:27:28 AM
It prunes one set of tables and outs records in the other because if the way SMF works. It just so happens that for you it made it bigger, this is not universally true.

Ok, after going through the code more carefully, I can see what you're talking about.

In my opinion, this script should ignore users with 0 posts. I've modified my version to do just that. On my forum, I have lots of registered users that just want to access members only content.

This will clear up more than 750,000 entries in the smf_log_mark_read table alone.

Arantor

In my opinion, the script is fine for normal use, and your use case is atypical, such that changing the script generically will hurt more people than it would help.

albertlast

The hint to switch from localhost to 127.0.0.1 is only valid for Windows server,
On Linux your hurt yourself because mysql use on localhost socket connection and
On 127.0.0.1 tcp/ip.
Socket >tcp/ip

gaminh

Please help.

After using some of the general tips now my bandwidth is increasing day by day.
From 3.6 it has increased to 5.5.

Please help and let me know the cause.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Arantor


SpacePhoenix

Quote from: gaminh on May 12, 2020, 12:12:06 PM
Please help.

After using some of the general tips now my bandwidth is increasing day by day.
From 3.6 it has increased to 5.5.

Please help and let me know the cause.

Quote from: Arantor on May 12, 2020, 01:38:36 PM
Also, what do 3.6 and 5.5 mean?

Linux server load averages?

https://www.tecmint.com/understand-linux-load-averages-and-monitor-performance/

Arantor

That doesn't really make sense for 'my bandwidth increased' though, and on a multi-core server (common), those numbers might not even be bad. But we don't know without context.

Advertisement: