News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

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

Punxx

Thanks very much, many of your suggestions were missed by me and have now been implemented. Always happy to optimize in any way I can. Also looking forward to the intermediate suggestions when my forum's big enough to really need a vps or dedicated host.

Bookmarked.

knightofdoom

Glory is fleeting, but obscurity is forever.
Web Designer Sri Lanka


Vekseid

Adult Role Playing Forums - - Over five million posts - - Elliquiy's LAMP configuration (maybe NSFW)

Blog about Forums and Servers - - Twenty things to make Simple Machines Forum go faster

Private/Instant Message requests for free support will be ignored.

Ensiferous

An easy way to gain additional speed when users post a message is to install the mbstring extension for php. (compile flag --enable-mbstring) as this means SMF does not have to use PHP code to do UTF-8 translations but rather can do it with a C extension.

Profiling showed that 70 utf8_strtoupper() calls are have been replaced with mb_strtoupper() reducing the execution time from 41,268 microseconds to 529 microseconds and reducing memory usage from 535 KB memory usage to 1 KB memory usage.

In my test this was 16.6% of total execution time removed when posting. Quite possibly larger for you since I am using a networked server for MySQL so I have network overhead for queries which makes them take longer.
My Latest Blog Post: Debugging Nginx Errors

Joshua Dickerson

In your language files - remove $txt['lang_capitalize_dates'] or comment it out... the entire line.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

lastnico

I really think the best you can do is to use optimizations of your server environment:

- with Xcache/memcache (PHP modules),
- mod_deflate (Apache modules, reduce bandwidth)
- and of course increasing of cache lifespan for static resources.

Any other optimizations are weak compared to these 3 major things.

lastnico

And I almost forgot the database side: remember to launch, after one or two weeks of load, the MySQL optimization script, found here:

http://www.joehayes.org/optimizing-mysql-for-dummies.html

Ensiferous

Quote from: lastnico on August 18, 2010, 08:32:34 AM
Any other optimizations are weak compared to these 3 major things.

Those you mentioned are important and has already been mentioned but you'd be foolish to consider everything else weak. SMF caching isn't extremely good and while an opcode cache will provide faster PHP overall the code still has to run. A lot of these improvements such as specifying a custom avatar directory will help much more due to how SMF works logging views of uploaded files.

Something as simple as what I specified in my previous post removed 43 ms run time, that's a lot of time on busy sites, so don't discount every other method as irrelevant.
My Latest Blog Post: Debugging Nginx Errors

vbgamer45

That mbstring is a great tip wish i could skip some of that uft8 stuff completed since i do not use it.
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

qtime

How to improve server speed (not related to the smf script):
if you have lots of small thumbs, avatars, format the data partition for your content  as EXT4 and use small blocks, 512 for example. This could speed up your hard disk performance

Something like that

Quote from: qtime on September 19, 2010, 01:43:05 PM
How to improve server speed (not related to the smf script):
if you have lots of small thumbs, avatars, format the data partition for your content  as EXT4 and use small blocks, 512 for example. This could speed up your hard disk performance

That doesn't make sense to me. If you use 512 byte blocks, instead of the usual 4k, you'll end up doing far more seeking to find all the pieces. Not just for avatars and thumbs, but everything else, like your database files, server logs, and program files. Furthermore, Linux handles memory in 4k chunks (on x86/x86-64 at least) so you'll only decrease performance when paging files (swapping). Not only that, but by using blocks 1/8th the size, you'll 8-tuple your inode usage, making file lookups take more time, plus you'll consume more memory as EXT4 caches the disk structure in memory. In short, unless you have a tiny disk (like in an embedded system) this is a really bad idea for performance.

Did you measure an improvement when you did this?

Hj Ahmad Rasyid Hj Ismail


Forum Labs

Can anyone give me the right mysql query to convert all my smf_log_* to innoDB I can convert them one by one but :) I am feeling lazy right now :)
Premium Support & Services for SMF

Something like that

Quote from: S-M-F Labs on September 27, 2010, 10:10:03 PM
Can anyone give me the right mysql query to convert all my smf_log_* to innoDB I can convert them one by one but :) I am feeling lazy right now :)

See the first post of this thread.

ysNoi

Owwww..! This one's awesome..! I will try doing these on my forum as well...

Thank You So Much creator...
"Don't fix it if it ain't broken, don't break it if you can't fix it."


TGB

www.dreamcasthaven.com <----- Running SMF 1.1.16 & heavily modified
www.psxhaven.com <----- Running SMF 1.1.16 & heavily modified
www.romhaven.info <----- Running SMF 1.1.16 & heavily modified
www.bthaven.com <----- Running TT 2.06

Flavious

Using SMF 1.1.11

I carefully followed the directions to change the directory for my several thousand avatars.

Not sure if this matters, but on the top I have:
Avatars directory:/home/myaccount/public_html/forum/avatars
Avatars url: http://mywebsite/form/avs


On the bottom:
Upload avatars to... Specific Directory
Upload Directory: /home/myaccount/public_html/forum/avs
Upload URL: /home/myaccount/public_html/forums/avs

The AVS directory is set to 777

I ran the update move attachements. All of my old Avatars are in the AVS folder.

But now uploading an avatar fails, and all the avatars on the site are no longer linked - every user has the dreaded red X. Many of them are very upset.

SO what did I do wrong?

When I look at what URL SMF is looking for to display a URL it shows: http://mywebsite.com/home/myaccount/public_html/forum/avs/avatar_3514.png

Which is wrong. It should be looking in: http://mywebsite.com/forum/avs/avatar_3514.png


Oya

the upload url should actually be a url not a local path, so it begins with http and points to the same folder - if the url to /.../public_html/forum/ is http://domain.com/forum/, the url to the avatars would be http://domain.com/forum/avs/

Advertisement: