collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 353
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: Shoutbox (Heavy Load)  (Read 7481 times)

0 Members and 1 Guest are viewing this topic.

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Shoutbox (Heavy Load)
« on: February 03, 2011, 06:49:52 PM »
Hello,

My web host has requested that I disable my shoutbox (by requested, I mean told!) due to the heavy load this was creating on the server. I had the shoutbox configured as follows;

Shouts to display - 50
Max shouts - 1000
Caching enabled
Autorefresh enabled

My question is, is there a way to reduce the server load? I considered disabling the autorefresh feature, but I am unsure what this will actually achieve. When a user loads the page (and shoutbox) for the first time, what kind of load will this create?

I am running SMF 2.0 RC4 with SP 2.3.3.

I am naturally eager to not have my hosting package disabled completely.

If there are suitable hosts out there who are more supporting, I would be interested in knowing who they are.

Thanks

C

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #1 on: February 03, 2011, 07:00:23 PM »
Disable the autorefresh, that causes the biggest load. As every user viewing your site will make a request every x seconds, to get an update on the shoutbox.

Also consider disabling some of the bbc tags (if you have any enabled).
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline keith021773

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #2 on: February 05, 2011, 11:49:48 AM »
also disable the shoutbox for guests.   Use it just for members and that will reduce your load drastically if you have a lot of guests.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shoutbox (Heavy Load)
« Reply #3 on: February 07, 2011, 09:07:23 AM »
Cermno1981,
 
Does that help?
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #4 on: February 10, 2011, 02:24:10 PM »
We had to remove SP completely. My host took a hard line and said the presence of the script was a risk.

So.... I've arranged to move to a host who says I can use it. I just cannot cope with the TP shoutbox or portal, it's utter crud in comparison.

Thank you for the help though, if we experience issues again I'll be making the suggested changes. :)

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shoutbox (Heavy Load)
« Reply #5 on: February 10, 2011, 07:51:23 PM »
OK. The shoutbox can introduce a heavy load, though SimplePortal without shoutbox should not be too bad.  If you have trouble on the new host, we'll be here.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #6 on: February 13, 2011, 06:40:16 PM »
I changed host and have reinstated the SP shoutbox. The new host is far more obliging!

Again, thank you very much for your help. This is what will keep people coming back. :)

P.S. Do you take donations towards running costs?

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shoutbox (Heavy Load)
« Reply #7 on: February 14, 2011, 07:17:16 AM »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #8 on: February 15, 2011, 03:30:27 PM »
Will set something up. :nervous-happy:

Onto topic...

The new host is watching resource usage carefully, and we don't want to disable the auto refresh (it's just such a great feature), so.... is there a way to have the shoutbox deactivate itself after 'X' minutes of inactivity? Inactivity could be the last time you navigated the site or typed into the shoutbox.

I know of a VB shoutbox that does this.

Thanks

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #9 on: February 15, 2011, 04:21:04 PM »
Google is my friend, it seems this has been asked for before.

http://simpleportal.net/index.php?topic=3681.msg23387#msg23387

If I follow the link within, it seems this has already been done for 2.4. This is great news!

Now this might be a tall order, but is there any chance of a way to do it now before my new host goes grey with stress?  :)

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shoutbox (Heavy Load)
« Reply #10 on: February 15, 2011, 06:41:45 PM »
I do not know the code to disable refresh on an inactive shoutbox.
For now, I suggest two things:
1) Make the refresh time-out longer
2) Disable most of the BBC permitted in the shoutbox.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #11 on: February 16, 2011, 11:14:29 AM »
I'll need to find a more permanent solution I think, my host sent me usage and resource information and we're literally crippling the server.

SP is not only the best portal, but the best shoutbox too. I'll see what I can cook up.

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #12 on: February 16, 2011, 05:29:09 PM »
We've now increased the refresh to 20 seconds, and are seeing how that goes. My gut feeling is that 20 seconds is too long.

I may be asking for the impossible here, but would there be any chance of a hotfix? I understand if not, you don't want to be supporting different code bases.

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #13 on: February 22, 2011, 05:17:16 PM »
I'm not into shameless bumps, but I just wondered if there might be any possibility of getting my current shoutbox to deactivate as per the 2.4 version.

Thanks in advance.

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #14 on: February 25, 2011, 07:09:23 PM »
I think I solved this...

Code: [Select]
if (!empty($shoutbox['refresh']))
echo '
var counter = 0
interval_id_', $shoutbox['id'], ' = setInterval( "sp_auto_refresh_', $shoutbox['id'], '()", ', $shoutbox['refresh'], ' * 1000);


function sp_auto_refresh_', $shoutbox['id'], '()
{
       
if (window.XMLHttpRequest)
{
sp_refresh_shout(', $shoutbox['id'], ', last_refresh_', $shoutbox['id'], ');
}
else
clearInterval(interval_id_', $shoutbox['id'], ');

counter++;

if ( counter > 30 )
{
             
clearInterval(interval_id_', $shoutbox['id'], ');
        }
}';

Before tonight I had no experience in Java whatsoever, so if this is a valid fix then I am well chuffed! :nervous-happy: (is it??)

I declared a variable 'counter' as a default value of 0, and then increment this value on each refresh. I hard coded (as a test) a limit of 30, at which point it clears the refresh interval and ends the heavy load on the server.

Please can somebody validate? I am not a programmer, this is the result of many tutorials read over 2 hours.

Thanks!!

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shoutbox (Heavy Load)
« Reply #15 on: February 25, 2011, 07:24:43 PM »
This seems like a step in the right direction.
 
You can try this out on a "test" forum to see if it behaves as required (stops refreshing after the count interval).
I will let the team know you are customizing your own workaround.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #16 on: February 25, 2011, 07:29:13 PM »
Thanks Angelina

I've tested it on my home laptop with runs Ubuntu with Apache. I had both me and a friend spam the forum (me locally, him remotely) with 80+ sessions between us. After the counter hit 30, the usage dropped.

I guess as a newbie, I was looking for an assurance that my code was sound.

P.S. Thanks for taking the time to look at it :)

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shoutbox (Heavy Load)
« Reply #17 on: February 25, 2011, 10:12:18 PM »
(I didn't really take a look at it.  I didn't test it at all).
I'm glad you figured this out. Please let us know how this works on your production forum!
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #18 on: February 26, 2011, 06:08:31 AM »
This is in testing at the moment. I have to say, it feels a lot faster already.

Indications early on are good!

Offline Cermno1981

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Shoutbox (Heavy Load)
« Reply #19 on: February 26, 2011, 06:32:38 AM »