News:

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

Main Menu

Adding Memory Usage to Load Balacing Help Please

Started by JaGuR, June 08, 2015, 05:26:52 AM

Previous topic - Next topic

JaGuR

Hi guys,

I have implemented the load balancing via php admin and all is working ok, but .....

I would like to add memory usage to the load balancing also, not just cpu load.

Where do I find the code for the the load balancing in SMF 1.1.x

Basically my server is running very low on memory as well at times, cheers

Illori

in SMF 2.1 in the debug info it shows the memory used.

if (function_exists('memory_get_peak_usage'))
echo $txt['debug_memory_use'], ceil(memory_get_peak_usage() / 1024), $txt['debug_kb'], '<br>';


where $txt['debug_memory_use'] is $txt['debug_memory_use'] = 'Memory used: '; and debug_kb is $txt['debug_kb'] = 'KB.'; both are in index.template.php.

maybe that helps? you should really find out why it is running low on memory and planning on upgrade to 2.0.

JaGuR

Any idea's of how to find out what / why it is using so many resources ?

Also, will upgrading to SMF 2.0 be a very big improvement on 1.1.21 for resource load ?

Illori

can you provide a link to your forum? a list of all mods installed? a link to your host?

once we have those we can possibly tell you a bit more about why you are using a lot of memory.

upgrading to 2.0 is required if your host will ever upgrade php.

JaGuR

Forum is,

www.racehorsetalk.com.au

Host is

www.crucial.com.au

Is running on a VPS Server with 5 cores and 2 gig of ram I think.

A list of mods just copy and pasted, some are not running though.

Massive thanks for taking the time to reply

1.    Twitter and Facebook Publisher mod    2.4    [ Apply Mod ] [ List Files ] [ Delete ]
2.    SMF 1.0.19 / 1.1.11 Update    1.0    [ List Files ] [ Delete ]
3.    vReportBoard Mod    1.02    [ List Files ] [ Delete ]
4.    User Email System    1.3    [ Uninstall ] [ List Files ] [ Delete ]
5.    TinyPortal    0.983    [ List Files ] [ Delete ]
6.    Inline Hover Spoiler    1.5    [ Uninstall ] [ List Files ] [ Delete ]
7.    vQuoteSelection Mod    0.90    [ List Files ] [ Delete ]
8.    SMF Poll Mod    1.2    [ Apply Mod ] [ List Files ] [ Delete ]
9.    SMF Prediction League    1.0.2    [ Uninstall ] [ List Files ] [ Delete ]
10.    Easy Screenshot Dumpster    1.2    [ Apply Mod ] [ List Files ] [ Delete ]
11.    Custom Profile Field Mod    3.20    [ Uninstall ] [ List Files ] [ Delete ]
12.    Custom Action Mod    2.04    [ Uninstall ] [ List Files ] [ Delete ]
13.    ColorizePost    2.0    [ Uninstall ] [ List Files ] [ Delete ]
14.    Enhanced Calendar    1.1    [ Uninstall ] [ List Files ] [ Delete ]
15.    Custom BBCode    2.00    [ Uninstall ] [ List Files ] [ Delete ]
16.    SMF 1.1.20 / 2.0.9 Update    1.0    [ Uninstall ] [ List Files ] [ Delete ]
17.    SMF 1.0.20 / 1.1.12 Update    1.0    [ List Files ] [ Delete ]
18.    Post_Board_Select    1.0    [ Uninstall ] [ List Files ] [ Delete ]
19.    SMF 1.0.21 / 1.1.13 Update    1.0    [ List Files ] [ Delete ]
20.    DonationCoder.com SMF Search Enhancement Mod    1.1.2    [ Uninstall ] [ List Files ] [ Delete ]
21.    SMF 1.0.22 / 1.1.16 Update    1.0    [ List Files ] [ Delete ]
22.    Mod Hide Post    1.2    [ Uninstall ] [ List Files ] [ Delete ]
23.    Who Voted What?    1.1.3    [ List Files ] [ Delete ]
24.    SMF 1.1.19 / 2.0.6 Update    1.0    [ List Files ] [ Delete ]
25.    AllCaps Notifier    1.0    [ Uninstall ] [ List Files ] [ Delete ]
26.    SMF 1.1.14 Update    1.0    [ List Files ] [ Delete ]
27.    Googlebot & Spiders Mod    2.0.4    [ Uninstall ] [ List Files ] [ Delete ]
28.    PM Readed    1.0    [ Uninstall ] [ List Files ] [ Delete ]
29.    Spam Me Not Mod    1.02    [ Uninstall ] [ List Files ] [ Delete ]
30.    FontandSizeDropdown_1.2    1.2    [ Uninstall ] [ List Files ] [ Delete ]
31.    Pretty URLs    1.0    [ List Files ] [ Delete ]
32.    Users Online Today Mod    1.4.0    [ Uninstall ] [ List Files ] [ Delete ]
33.    Bookmarks    2.2.1    [ Uninstall ] [ List Files ] [ Delete ]
34.    HacksPark shoutBox    1.2.1    [ Uninstall ] [ List Files ] [ Delete ]
35.    Ignore user    1.4    [ Uninstall ] [ List Files ] [ Delete ]
36.    SMF 1.0.14 / 1.1.6 Update    1.0    [ List Files ] [ Delete ]
37.    Add Domaintools to TrackIP    1.0    [ Uninstall ] [ List Files ] [ Delete ]
38.    New In Topic View    1.0    [ Uninstall ] [ List Files ] [ Delete ]
39.    Contact Page    1.1    [ Uninstall ] [ List Files ] [ Delete ]
40.    TextareaResizer    1.1    [ Apply Mod ] [ List Files ] [ Delete ]
41.    Color & BgColor BBCode Bar    3.0    [ Uninstall ] [ List Files ] [ Delete ]
42.    Simple Image Upload    1.3.0    [ Uninstall ] [ List Files ] [ Delete ]
43.    Inline Attachments    1.0.4.2    [ Uninstall ] [ List Files ] [ Delete ]
44.    Moderator and Administrator Comment Tags    1.0    [ Apply Mod ] [ List Files ] [ Delete ]
45.    SMF 1.1.19 / 2.0.6 Update    1.0    [ List Files ] [ Delete ]
46.    SMF 1.1.20 / 2.0.9 Update    1.0    [ Uninstall ] [ List Files ] [ Delete ]
47.    Are You Human? Anti-Bot Registration Check    1.0    [ Uninstall ] [ List Files ] [ Delete ]
48.    SMF 1.0.13 / 1.1.5 / 2.0 b3.1 Update    1.0    [ List Files ] [ Delete ]
49.    SMF 1.1.15 Update    1.0    [ List Files ] [ Delete ]
50.    SMF 1.0.23 / 1.1.17 Update    1.0    [ List Files ] [ Delete ]
51.    Tapatalk SMF Plugin    3.0.0    [ Uninstall ] [ List Files ] [ Delete ]
52.    SMF Sitemap    1.2.2    [ Uninstall ] [ List Files ] [ Delete ]
53.    First Post on every Page    1.1    [ Uninstall ] [ List Files ] [ Delete ]
54.    SMF 1.1.18 Update    1.0    [ List Files ] [ Delete ]
55.    SMF 1.0.17 / 1.1.9 / 2.0 RC1 Update    1.0    [ List Files ] [ Delete ]
56.    Welcome Topic Mod    1.0    [ List Files ] [ Delete ]
57.    Guests see no posts    0.1    [ Uninstall ] [ List Files ] [ Delete ]
58.    Pretty URLs    1.1.2    [ Uninstall ] [ List Files ] [ Delete ]
59.    Buy Me A Beer    1.1    [ Uninstall ] [ List Files ] [ Delete ]
60.    [HTML] Permission Mod    1.01    [ Uninstall ] [ List Files ] [ Delete ]
61.    SMF 1.0.16 / 1.1.8 Update    1.0    [ List Files ] [ Delete ]
62.    SMF 1.0.23 / 1.1.17 Update    1.0    [ List Files ] [ Delete ]
63.    SMF 1.0.18 / 1.1.10 / 2.0 RC1-2 Update    1.1    [ List Files ] [ Delete ]
64.    Aeva ~ Auto-Embed Video & Audio    5.0.18    [ Apply Mod ] [ List Files ] [ Delete ]
65.    SMFChess    1.1    [ Uninstall ] [ List Files ] [ Delete ]
66.    Force Topic Read On Login Mod    1.0    [ Uninstall ] [ List Files ] [ Delete ]
67.    New Style Message Icon    1.1    [ Uninstall ] [ List Files ] [ Delete ]
68.    Restrict Email Providers on Registration    1.2    [ Uninstall ] [ List Files ] [ Delete ]
69.    FlashChat Integration    1.0    [ Uninstall ] [ List Files ] [ Delete ]
70.    Wrap Text Around Image    1.0    [ Uninstall ] [ List Files ] [ Delete ]
71.    SMFChess    0.1    [ List Files ] [ Delete ]
72.    Floating Bar Mod    1.0    [ Uninstall ] [ List Files ] [ Delete ]
73.    SMF Arcade    2.0.17    [ List Files ] [ Delete ]
74.    Treasury    2.34    [ Uninstall ] [ List Files ] [ Delete ]
75.    Proxy Blocker    1.1.4    [ Uninstall ] [ List Files ] [ Delete ]
76.    Advanced image uploader    1.0.9    [ List Files ] [ Delete ]
77.    H tags: Improve SEO mod    1.0    [ Apply Mod ] [ List Files ] [ Delete ]
78.    SMF 1.0.18 / 1.1.10 / 2.0 RC1-2 Update    1.1    [ List Files ] [ Delete ]
79.    SMF 1.1.18 Update    1.0    [ List Files ] [ Delete ]
80.    Bookmarks    1.1    [ List Files ] [ Delete ]
81.    Hide Signatures for Guest    1.1    [ Uninstall ] [ List Files ] [ Delete ]
82.    Admins Can Post As Alternative User    1.0    [ Uninstall ] [ List Files ] [ Delete ]
83.    SMF Gallery Lite    1.7.4    [ List Files ] [ Delete ]


Illori

can you disable 69.    FlashChat Integration    1.0    [ Uninstall ] [ List Files ] [ Delete ]
and see if it makes a difference? chat mods tend to bog down forums.

do you have any other mods that are not really used that you could remove/disable?

since i cant really even find that many details on the hosting plans that host offers, i would start looking for another host that does clearly tell you what you are getting.

JaGuR

I will disable it tomorrow asking with a few others.

I have been holding off on upgrading to smf 2 because I have added a lot of custom features, but I guess I an going to have to upgrade at some point.

A any idea of the process and ease of upgrading to smf 2 ?

Cheers


JaGuR


I have installed status.php

http://www.racehorsetalk.com.au/status.php

Could somebody please take a look if you get a chance ?

Query cache prune rate seems to be a problem
(query_cache_size)    0.1779 (should be <= 0.05)

margarett

In more recent servers (and under a VPS) that shouldn't be a major problem ;)

As for these "query" values
Quotequery_cache_limit:    1048576
query_cache_min_res_unit:    4096
query_cache_size:    33554432
query_cache_type:    ON

I got this from another thread:
QuoteEvery time a query modifies a table, every query in the cache that refers to that table is purged. It takes time to search and purge these queries. Disable it to speed things up by setting query_cache_size=0.

Yet I doubt this is your problem, really.

I also checked your forum, it's not *that* busy so I guess it should behave properly with those specs. I also doubt that SMF by itself can consume all your memory (most PHP setups limit the maximum memory a script can use to 128-512Mb)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

JaGuR

Ok, I finally got my host to investigate further,

They Have suggested it is bots attacking my site and also saying Analogue Stats was chewing up memory.

They have disabled Analogue Stats and blocked the ip range of the bots.

Is there a mod, trick or easy way to determine what are bad bots and what are Google crawlers and stop them from hogging my resources ?


margarett

There are MODs that block registrations from known spammers (through spammer databases) but they do hit the forum first so the performance hit is there already...

Denying these bots needs to be done at server level (like your host did)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

JaGuR

Thanks,

So basically via htaccess ?

I have banned all IP from china, which seems to be the biggest problem for number of bots hitting my site

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

ziycon

At a very brief glance I would suggest an update of mysql as it's pushing over 2 1\2 years old now also I would look at using InnoDB instead of MyISAM storage engine if your tables are large, what size would the message table be?

JaGuR

Quote from: ziycon on July 21, 2015, 07:12:04 AM
At a very brief glance I would suggest an update of mysql as it's pushing over 2 1\2 years old now also I would look at using InnoDB instead of MyISAM storage engine if your tables are large, what size would the message table be?

Hi and thanks

My messages table is 564,775    rows and 493.1 MiB in size.

pretty urls seems to be pretty big also at 2,101,446 rows and 299.4 MiB in size

I have asked my host to update MySQL and will look at updating the engine to InnoDB if you think it will make a difference.

How hard is it to do that ?

I will get my host to do a back up of my database before I start mucking around with it.


Advertisement: