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

BurningCa007

wouldn't having a unix server be an obvious way to make smf faster?

Ensiferous

Not necessarily. PHP and SMF runs fine on Windows or Solaris, probably also Mac. The platform overhead is small in all cases, so Unix, Windows, Solaris, it's pretty even.
My Latest Blog Post: Debugging Nginx Errors

青山 素子

Quote from: Ensiferous on November 27, 2010, 10:47:15 AM
The platform overhead is small in all cases, so Unix, Windows, Solaris, it's pretty even.

I would argue that Windows adds more overhead because the GUI is always running and taking up memory. The same can be said of Solaris (which boots X by default), or even Linux if X is ran at boot. Usually, however, Linux servers don't run X. Also, Windows Server 2008 and beyond support Server Core, which loads minimal services. In practice, this mode is rarely used as it is more difficult to manage due to the way it works. Maybe in the future, it will become more *NIX-like. Also, Server Core still loads the GUI, just none of the userland things like windows explorer. I believe on login you just get a GUI cmd.exe window.
Motoko-chan
Director, Simple Machines

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


Ensiferous

By default Windows servers are logged out so the GUI is minimal and only the required processes are running. That said, you are completely right, Windows does add more overhead relative to Linux and Solaris. My point is that seen in the grand scheme of things your OS is going to be far less than 1% of your total load, your actual application is going to take up the majority of time and switching to a different OS would not present a significant change in performance.
My Latest Blog Post: Debugging Nginx Errors

Vekseid

The primary reason for using *nix over Windows is, perhaps ironically, simplicity, rather than any significant performance advantage. Windows does tend to lag behind a bit in terms of 'state of the art', which can be a factor - e.g. nginx for Windows is only in beta.
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

Nginx for Windows is not really in Beta, it's just that Nginx is event based which means it uses the system calls: epoll() (Linux), kqueue() (FreeBSD) or select() (Global). Of these 3 Windows only supports select() - which is slow as hell.

Windows has it's own method of dealing with event based applications and Nginx does not have support for this, and as far as I know it's not on the immediate road map. That said, Nginx on Windows is stable enough, it's not going to randomly crash so it really cannot be considered beta.
My Latest Blog Post: Debugging Nginx Errors

rajanpert

Quote3: Enable (or disable) gzip compression. This is located in Server Settings -> Feature Configuration. This has the greatest benefit when combined with #1, particularly for dialup users.

Note: Your webserver configuration may render this irrelevant. If your webserver compresses the type of data you use to serve your webpages, you should specifically disable this, as the webserver can better handle it.

How could one check whether webserver compress the type of data or not?

Anyone :)

Spuds

I could type all the things that this site says, but going there would be much easier :)

Hack-King


stog

hi, happy new year!

Using SMF 1.1.12; custom theme, many mods including tinyportal 1.rc1 and pretty url's rc5

I like Flavious on previous page, followed the directions to change the directory for our avatars.

on the top of avatar settings I have:
Avatars directory:/home/myaccount/htdocs/avatars
Avatars url: http://www.mywebsite.com/avs


On the bottom:
Upload avatars to... Specific Directory
Upload Directory: /home/myaccount/htdocs/avs
Upload URL: http://www.mywebsite.com/avs

The AVS directory is set to 777

I ran the url move attachments. All of my old Avatars are in the AVS folder.

But now  all the avatars on the site are no longer linked - every user has a blank
eek

SO what did I do wrong?

When I look at an avatar in the browse files section of the avatar section (avatars), i see it linking with a double slash as http://www.mywebsite.com//avatar_46.png

whereas http://www.mywebsite.com/avs/avatar_46.png shows the avatar

any ideas please

many thx

folks are out to lynch me!

stog

several hours on i am wondering whether the double slash is caused by my running the "MoveAvatars" script twice, as what it does ? some 20 lines in,  is add a slash here
if (rename($filename, $modSettings['custom_avatar_dir'] . '/' . $row['filename']))

ref line 430 ManageAttachments.php

and if this is the case how could i correctly remove one of the slashes from the renamed dir path ?

any help appreciated

cheers

Brettflan

It looks like it's missing the "avs" in the path between the slashes rather than having an extra slash. Under Avatar Settings in the admin panel (Forum->Attachments and Avatars->Avatar Settings), at the bottom of the page should be the three options in question.
"Upload avatars to..." should of course be set to "Specific directory...". Make sure "Upload directory" and "Upload URL" both are correct, with the "avs" directory specified. It sounds like your "Upload URL" is incorrect.

stog

thx brettflan,
just been back to check after a sleep and find that the upload url is blank, so i retyped and saved;   it accepts the url (which is the same as the avatar url at the top, and my admin avatar appears (so the url is correct), then i go to home page to check the members avatars - no joy  .. no avatars -- so i return to avatar setting, only to find the upload url field empty and admin avatar gone?

thx for your help

can i save the avatar_url directly via ftp (or in mysql with phpmyadmin)? and, if so, in which file would i look?
(looking in the tables:custom_avatar_url and avatar_url are both showing the path  correctly in smf settings)

the 'save bit of manageattachments.php i think is around here

// Only update these settings if they are not disabled by JavaScript.
if (empty($_POST['avatar_download_external']))
updateSettings(array(
'avatar_max_width_external' => empty($_POST['avatar_max_width_external']) ? 0 : (int) $_POST['avatar_max_width_external'],
'avatar_max_height_external' => empty($_POST['avatar_max_height_external']) ? 0 : (int) $_POST['avatar_max_height_external'],
'avatar_action_too_large' => $_POST['avatar_action_too_large'],
));

if (!empty($_POST['custom_avatar_enabled']))
updateSettings(array(
'custom_avatar_dir' => $_POST['custom_avatar_dir'],
'custom_avatar_url' => $_POST['custom_avatar_url'],
));

// Save the adjusted permissions.
save_inline_permissions(array('profile_server_avatar', 'profile_upload_avatar', 'profile_remote_avatar'));
}

init_inline_permissions(array('profile_server_avatar', 'profile_upload_avatar', 'profile_remote_avatar'), array(-1));

$context['valid_avatar_dir'] = is_dir($modSettings['avatar_directory']);
$context['valid_custom_avatar_dir'] = empty($modSettings['custom_avatar_enabled']) || (is_dir($modSettings['custom_avatar_dir']) && is_writable($modSettings['custom_avatar_dir']));
}


have also tried 'saving' in default theme, and chkmoded avs to 755 - no joy - so is back to 777, now 707

i also ran the mysql query suggested in http://www.simplemachines.org/community/index.php?topic=197938.0

UPDATE `smf_attachments` SET `attachmentType` = '1' WHERE `smf_attachments`.`ID_MEMBER` != 0


also tried repair_settings , where it wants me to use /avatars instead of /avs for the avatar url

am also wondering whether tinyportal is involved

stog

have had to revert to an upload via attachments folder scenario, and request members get their own avatars back by choosing their avatars from the list in Profile; i copied the avs folder contents to avatars folder, and then screenshot the 'browse files (avatars)section of the avatar setting area, A-G, H-Q etc, so that they had their filename for their avatar.

posting this for any others who lose their member's avatars :)

i would still welcome any one's ideas btw

thx

Arantor


stog

sry-- i reverted back to my original settings, using the default avatar setup using the upload via attachments as opposed to specific directory

Arantor


stog

because i couldn't get the avs folder settings to work, or the browse files (avatar) to link correctly - they were //avatar45.png  instead of /avs/avatar45.png, and our members had lost their avatars -- scroll up for full description

thx for your interest

Arantor

Which usually means you put a / at the end of the URL/folder combination when it didn't need one...

stog

no  / in url
in fact -url won't save (although path in sql table shows correct path)
Quotei find that the upload url is blank, so i retyped and saved;   it accepts the url (which is the same as the avatar url at the top, and my admin avatar appears (so the url is correct), then i go to home page to check the members avatars - no joy  .. no avatars -- so i return to avatar setting, only to find the upload url field empty and admin avatar gone?

you need to scroll up further to see full story i think, and btw this forum here is still v difficult to read because of severe staccato scrolling problems (i am using firefox on a mac and did post on this some months ago)
will check in again with safari and report on that-->safari works fine

Advertisement: