Advertisement:

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

Offline Something like that

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,496
  • Gender: Male
  • ]
Re: Seventeen things you can do to make SMF go faster.
« Reply #20 on: February 17, 2009, 09:17:05 AM »
Quote
To move existing avatars to the new directory, access index.php?action=manageattachments;sa=moveAvatars


This is what I don't understand.
Sheryl

Click this: http://daysofourlives.sherylspage.com/index.php?action=manageattachments;sa=moveAvatars

Offline sheryltoo

  • Jr. Member
  • **
  • Posts: 295
    • Sheryl's Page
Re: Seventeen things you can do to make SMF go faster.
« Reply #21 on: February 17, 2009, 09:22:36 AM »
I get this error when going there:

The attachments upload directory is not writable. Your attachment or avatar cannot be saved.

My attachment directory is set to 777 so I'm  not sure why I'd get that error.
Maybe it has something to do with the fact that my site seems to be one big mess at the moment.
Sheryl

Offline Something like that

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,496
  • Gender: Male
  • ]
Re: Seventeen things you can do to make SMF go faster.
« Reply #22 on: February 17, 2009, 09:35:12 AM »
The new directory that you created for the avatars has to be writable (777), too.

Offline sheryltoo

  • Jr. Member
  • **
  • Posts: 295
    • Sheryl's Page
Re: Seventeen things you can do to make SMF go faster.
« Reply #23 on: February 17, 2009, 10:27:24 AM »
I think I give up. Either I'm not understanding what needs to be done or the problems I'm having with my site are effecting how this works.

Here's what I did.
I created a folder in my root directory for smf for the attachments, then changed the path to attachments to read:
/home/site/public_html/root/attach and set the permissions to all 7's.
Under Avatar settings I changed it to say "Upload avatars to specific directory" and put this new path on both the lines.
Then I went to the area that you linked me to but don't see anything that says I can move avatars, however, I did copy all the avatars that were in the folder on my domain into the new folder but that didn't help.
I clicked a maintenance button and it said it found 24 images that were no longer there so I clicked fix or something and it deleted them all.
Before I did this, I had 36 avatars in the orginial attachment folder on my domain.

And I signed into my site with a non management account and tried to upload an avatar. It seemed to upload ok. No errors, however all I see is a red x so something isn't right.
Either I goofed up or my site isn't working right.
Sheryl

Offline Something like that

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,496
  • Gender: Male
  • ]
Re: Seventeen things you can do to make SMF go faster.
« Reply #24 on: February 17, 2009, 11:09:46 AM »
When you moved the avatar files, it doesn't automatically update the database. That's what that link does :)

What did you set for the avatars URL? Something like http://daysofourlives.sherylspage.com/attach ?

Offline Something like that

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,496
  • Gender: Male
  • ]
Re: Seventeen things you can do to make SMF go faster.
« Reply #25 on: February 17, 2009, 11:28:21 AM »
There's an emergency power outage in my building. It's a transformer problem. No ETA on power return. UPS won't last long. I'll be back later.

Offline Vekseid

  • Full Member
  • ***
  • Posts: 548
  • Gender: Male
    • Elliquiy Adult Role Playing Forums
Re: Seventeen things you can do to make SMF go faster.
« Reply #26 on: February 17, 2009, 12:17:33 PM »
In my experience the less you have per page, the less the resource usage, in fact in the past when I was having a lot of traffic, I used to reduce mine from 40 to 20 in order to cope with the influx.

Yes, you will have more page views to contend with with lower figures, but you will also be manipulating less data with each page view.

Actually, my page views and forum activity went up when I raised the figures, is what I was referring to.
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.

Offline Vekseid

  • Full Member
  • ***
  • Posts: 548
  • Gender: Male
    • Elliquiy Adult Role Playing Forums
Re: Seventeen things you can do to make SMF go faster.
« Reply #27 on: February 17, 2009, 12:22:18 PM »
I get this error when going there:

The attachments upload directory is not writable. Your attachment or avatar cannot be saved.

My attachment directory is set to 777 so I'm  not sure why I'd get that error.
Maybe it has something to do with the fact that my site seems to be one big mess at the moment.
Sheryl

http://daysofourlives.sherylspage.com/attach/

There are no files here, so it wasn't able to upload. Are you sure -that- directory is set to 777?
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.

Offline sheryltoo

  • Jr. Member
  • **
  • Posts: 295
    • Sheryl's Page
Re: Seventeen things you can do to make SMF go faster.
« Reply #28 on: February 17, 2009, 03:38:01 PM »
Seeing how nothing seemed like it was working, I put the avatars back in the attachment folder and I think I've set everything back to the default settings as far as where to upload attachments.
One of the reasons I thought I'd do this is because no one's attachment was showing up  after I edited some files and no one could upload any more attachments even though the permission is set to 777.

Like I said, I think there's some issues going on with my site and I'm trying to get that straightened out. I think I need to do that first before I try to make any more changes but thanks for trying to help me.
Maybe I'll be back if I ever get my site working right again.
Sheryl

Offline Ashdaw

  • Jr. Member
  • **
  • Posts: 183
  • Gender: Male
    • GreycastleOZ
Re: Seventeen things you can do to make SMF go faster.
« Reply #29 on: February 21, 2009, 12:26:30 AM »
A VERY helpful guide this is. I made a few changes that were refered to here and have already noticed a 50% (approx) improvement, thanks :)
You are more than welcome to visit my site.
Greycastle

Offline Something like that

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,496
  • Gender: Male
  • ]
Re: Seventeen things you can do to make SMF go faster.
« Reply #30 on: February 21, 2009, 05:30:19 AM »
If you have a lot of attachments, this change can greatly lower SMF's CPU usage.

This modification disables theme loading for attachments. It's a simple tweak for a big boost.

In Load.php, copy this:
Code: [Select]
// The following determines the user agent (browser) as best it can.
$context['browser'] = array(
'is_opera' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false,
'is_opera6' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 6') !== false,
'is_opera7' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 7') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera/7') !== false,
'is_opera8' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 8') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera/8') !== false,
'is_ie4' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 4') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'WebTV') === false,
'is_safari' => strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== false,
'is_mac_ie' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false,
'is_web_tv' => strpos($_SERVER['HTTP_USER_AGENT'], 'WebTV') !== false,
'is_konqueror' => strpos($_SERVER['HTTP_USER_AGENT'], 'Konqueror') !== false,
'is_firefox' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false,
'is_firefox1' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/1.') !== false,
'is_firefox2' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/2.') !== false,
);

$context['browser']['is_gecko'] = strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false && !$context['browser']['is_safari'] && !$context['browser']['is_konqueror'];

// Internet Explorer 5 and 6 are often "emulated".
$context['browser']['is_ie7'] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false && !$context['browser']['is_opera'] && !$context['browser']['is_gecko'] && !$context['browser']['is_web_tv'];
$context['browser']['is_ie6'] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false && !$context['browser']['is_opera'] && !$context['browser']['is_gecko'] && !$context['browser']['is_web_tv'];
$context['browser']['is_ie5.5'] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.5') !== false && !$context['browser']['is_opera'] && !$context['browser']['is_gecko'] && !$context['browser']['is_web_tv'];
$context['browser']['is_ie5'] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.0') !== false && !$context['browser']['is_opera'] && !$context['browser']['is_gecko'] && !$context['browser']['is_web_tv'];

$context['browser']['is_ie'] = $context['browser']['is_ie4'] || $context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] || $context['browser']['is_ie6'] || $context['browser']['is_ie7'];
$context['browser']['needs_size_fix'] = ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] || $context['browser']['is_ie4'] || $context['browser']['is_opera6']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') === false;
to a new function, detectBrowser(), in Load.php. Don't forget to include global $context; at the top.

I replaced this in index.php:
Code: [Select]
// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
loadTheme();
with
Code: [Select]
// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
if (! (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach'))
loadTheme();
else
detectBrowser();

On my system, it reduced my CPU usage by 14%. I do about 4 downloads for every 1 page view.

I do about 800,000 attachments & thumbnail downloads per day, so it really added up.

Offline shumilica

  • Jr. Member
  • **
  • Posts: 218
  • Gender: Male
  • SMF all the way!
    • Psiholog Body Mind Spirit
Re: Seventeen things you can do to make SMF go faster.
« Reply #31 on: February 22, 2009, 02:15:45 AM »
I want to move the avatar from attachements, but i have enabled the "Encrypt stored filenames" option, and I want to ask so i'll be sure:
If I will go to mysiteforumurl/index.php?action=manageattachments;sa=moveAvatars every avatar jpg will decrypt and everything will be allright, or this option is only available when "Encrypt stored filenames" is disabled?
Today, if you're not confused it means you're not thinking clear!

Offline Something like that

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,496
  • Gender: Male
  • ]
Re: Seventeen things you can do to make SMF go faster.
« Reply #32 on: February 22, 2009, 02:21:57 AM »
It should, yes.

Offline shumilica

  • Jr. Member
  • **
  • Posts: 218
  • Gender: Male
  • SMF all the way!
    • Psiholog Body Mind Spirit
Re: Seventeen things you can do to make SMF go faster.
« Reply #33 on: February 23, 2009, 01:31:28 PM »
Very weird. I tried to go to myforumurl/index.php?action=manageattachments;sa=moveAvatars, and it got me on the first page without doing nothing :o I have created a folder, i specified in avatars settings to use that folder to put avatar, new avatars go there (so it is chmod correctly) but old one doesn't move when i specify that hidden function.

This hidden future is only in SMF 1 series? Because i have 2.0 RC1 :-?


Later edit:
From what I see sintax for actions/url in smf 2 is different froms smf 1. So maybe the function exists but it is a different URL for SMF 2.

For example, to see somebody's pots in SMF1 the link would be like this:
forum_url/index.php?action=profile;u=1422;sa=showPosts

but for SMF 2 the link is this:
forum_url/index.php?action=profile;u=1422;area=showposts;sa=messages

« Last Edit: February 23, 2009, 01:54:29 PM by shumilica »
Today, if you're not confused it means you're not thinking clear!

Offline Something like that

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,496
  • Gender: Male
  • ]
Re: Seventeen things you can do to make SMF go faster.
« Reply #34 on: February 23, 2009, 02:03:45 PM »
I'm not sure about that function in SMF 2. I haven't looked. It was never a documented feature ;)

Offline shumilica

  • Jr. Member
  • **
  • Posts: 218
  • Gender: Male
  • SMF all the way!
    • Psiholog Body Mind Spirit
Re: Seventeen things you can do to make SMF go faster.
« Reply #35 on: February 23, 2009, 03:37:56 PM »
I figured it out....
In manageattachements.php i searched for moveavatars and saw this:
void MoveAvatars()
      - move avatars from or to the attachment directory.
      - called from the maintenance screen by
       index.php?action=admin;area=manageattachments;sa=moveAvatars

So maybe you want to edit your first post so that SMF 2.0 Users can use it too. Everythink worked like a charm, it asked for my password and then went to file maintanance. I checked the folder in ftp and it was full with moved avatars.

Thank you for your support!


P.S. it is documented in smf function pages: http://support.simplemachines.org/function_db/index.php?action=view_function;id=89
« Last Edit: February 23, 2009, 05:03:38 PM by shumilica »
Today, if you're not confused it means you're not thinking clear!

Offline exxocet

  • Jr. Member
  • **
  • Posts: 121
Re: Seventeen things you can do to make SMF go faster.
« Reply #36 on: February 24, 2009, 12:47:06 AM »
  The myISAM > innoDB conversion is recommended for all forums, including small or medium?
I have a forum with 2500 members, 40 members online at the same time average. They seems to publish ~1post/5minutes, 25,000topics, 70,000posts, not big load there, but there is a lot of searching. Every member use the search heavily.
The forum is fast (after optimization, bandwidth lows from over 1 GB/day to 500MB/day), but I'm just looking to make it even faster. I'm on VPS, so I can modify mySQL characteristics. It would be recommended to go with innoDB on some tables? Thank you.

« Last Edit: February 24, 2009, 12:51:31 AM by exxocet »

Offline Something like that

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,496
  • Gender: Male
  • ]
Re: Seventeen things you can do to make SMF go faster.
« Reply #37 on: February 24, 2009, 01:38:15 AM »
  The myISAM > innoDB conversion is recommended for all forums, including small or medium?
I have a forum with 2500 members, 40 members online at the same time average. They seems to publish ~1post/5minutes, 25,000topics, 70,000posts, not big load there, but there is a lot of searching. Every member use the search heavily.
The forum is fast (after optimization, bandwidth lows from over 1 GB/day to 500MB/day), but I'm just looking to make it even faster. I'm on VPS, so I can modify mySQL characteristics. It would be recommended to go with innoDB on some tables? Thank you.

Your forum is big enough that you would likely benefit from switching to InnoDB.

You may wish to use Sphinx for search, if you're getting a lot of search activity. Search around the forums here.

Offline exxocet

  • Jr. Member
  • **
  • Posts: 121
Re: Seventeen things you can do to make SMF go faster.
« Reply #38 on: February 24, 2009, 01:53:07 AM »
  Thank you Phalloidium,
Indeed, I forgot to tell that I consider about using Sphinx, but i'm not sure if it's fit for me, but your answer helped there too. Just one more question, Sphinx will change the search alghorithm? I like SMF kind of searching, per instance if you search for termA termB it would first display the results containg both terms. On Invision and phpBB it's a completely mess on search, even if you search two terms, it will dispaly results containg each of those terms, not both. I hate that. Will Sphinx stick with the SMF search?
  In conversion innoDB tutorial that's nothing about smf_log_search_words table (available only for index search)? It should be converted too? Thank you very much.
« Last Edit: February 24, 2009, 02:19:58 AM by exxocet »

Offline Something like that

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,496
  • Gender: Male
  • ]
Re: Seventeen things you can do to make SMF go faster.
« Reply #39 on: February 24, 2009, 04:03:44 AM »
If you install Sphinx, and then don't like it, you can easily change your search mechanism back in the Admin area.