Advertisement:

Author Topic: Twenty-four things you can do to make SMF go faster (Updated June 16th, 2010)  (Read 502159 times)

Offline roshaoar

  • Jr. Member
  • **
  • Posts: 205
  • Gender: Male
Thanks!

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,348
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Twenty-four things you can do to make SMF go faster (Updated June 16th, 2010)
« Reply #381 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.
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

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,020
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: Twenty-four things you can do to make SMF go faster (Updated June 16th, 2010)
« Reply #382 on: September 17, 2015, 01:52:57 AM »
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

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

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


Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,348
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Twenty-four things you can do to make SMF go faster (Updated June 16th, 2010)
« Reply #383 on: September 17, 2015, 08:57:57 AM »
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

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,348
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Another tip just discovered that the smf_sessions table last_update should have an index to add one run
Code: [Select]
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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,038
    • Arantor on GitHub
That's only if you're not doing the memcache thing ;)
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,348
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,038
    • Arantor on GitHub
Then turn off DB sessions and get PHP to use memcache for sessions.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,348
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Will give that a shot and test.
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

Offline MobileCS

  • Jr. Member
  • **
  • Posts: 124
Quote
8: 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?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,038
    • Arantor on GitHub
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.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline albertlast

  • Development Contributor
  • Jr. Member
  • *
  • Posts: 171
Another tip just discovered that the smf_sessions table last_update should have an index to add one run
Code: [Select]
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.

Offline MobileCS

  • Jr. Member
  • **
  • Posts: 124
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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,038
    • Arantor on GitHub
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.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.