High Performance IP.Board Hosting

cmanns

=D
Joined
May 15, 2007
Messages
159
cmanns submitted a new Article:

High Performance IP.Board Hosting

Welcome to my article :lildevil: now depending on what version you have this guide may not be so helpfull :shifty: 2.2/2.3 are only supported.

Now first we start off, how is your current setup, I hope you have enough space to run what I'll give :(

Start out with the basic!

1) Switch webservers, want high performance? Try a webserver other then Apache I prefer to call Apachitty. I personally recomend Lighttpd http://lighttpd.net runs 3 different IP.Boards so far, perfectly :bouncy:

2) Whats heavier, MySQL or Apache? Oh Apache? Well if you switch to Lighttpd, byebye Apache problem :lildevil: :lildevil: If its MySQL then depending on your income from site/other and how fast your growing I'd recommend a separate MySQL server in same datacenter.

3) Setting Update Topic Views Immediately to NO, thats in the Admin CP > TOOLS & SETTINGS > CPU SAVING fyi.

4) ibf_sessions :didi:
Login TO SSH via root
Code:
mysql -p dbname 
Password: type root mysqladmin password ;)

alter table ibf_sessions Engine = 'heap';
You might have to change the ibf_* prefix to whatever you use btw, that command 'should' work on every MySQL5 distro, if not just do a simple google

Google "alter table engine type" theres a few ways to change it, set it to heap or memory.


Cache, cache, cache!!
So everythings dynamic? Whats dynamic can still be cached :lildevil:

1) Ever hear about MemCached? IP.Board 2.2 and higher now has a API for it.

http://www.danga.com/memcached/

Sorry, I setup servers for $ so I cannot give EXACT instructions, please understand that if I do and you mess something up I also don't want to be held reliable, instructions on some systems may vary and such :tiphat:

You will also need http://pecl.php.net/package/memcache

How to apply into IP.Board?

Open conf_global.php

Code:
$INFO['use_memcache'] = 1;
$INFO['memcache_server_1'] = "nameofserver";
$INFO['memcache_port_1'] = "11211";
I HIGHLY recommend NOT to run on webserver if your not atleast running lighttpd w/a load lower then 1.00 on average, I used to run it on my webserver, runs quicker page loads but when our laod started hitting 1.80 it starts to not help asmuch, try to put it on a low load mysql server or its own server with 512M ram.

Start memcached with 256-512M ram btw, IP.Board doesn't need 1gB or 2gB of its own :p

2) XCACHE, is beta :confused: but the...

Read more about this article here...
 
Last edited by a moderator:

SageStone

just david(:
Joined
May 9, 2007
Messages
1,832
This is a great article for IP.Board users with dedicated servers! Thanks a lot for posting it for us! :)

SageStone
 

gogoblender

shiny happy pantless
Joined
Feb 20, 2006
Messages
15,307
And bookmarked...for that great day when we need our own dedicated server.
Ty cmanns!

:)

gogo
 

chartmusic

Participant
Joined
Jan 4, 2007
Messages
82
An useful post and thanks for posting cmanns.


3) Setting Update Topic Views Immediately to NO, thats in the Admin CP > TOOLS & SETTINGS > CPU SAVING fyi.

This bit isn't really required, your so unlikely to notice any difference performance wise. What you will notice is 101 questions from your members why does this 'new topic' have no views. So while it's a valid suggestion I would not recommend unless your desperate.
 

Ueland

Vikingboard developer
Joined
Feb 6, 2004
Messages
160
Time to give some corrections.


1) Load average is decided by the number of CPUS, a load average of 1 does not say _anything_ at all. Your server does not have to much to do until the load average is above the number of CPU-cores on the server. If you have 8 CPU`s, you can have a load average of eight before the server is starting to get "overloaded". ;)

2) To go away from Apache is "evil", at least if WWW and DB is not seperated to seperate servers. To split those 2 services up is whats going
to give you the biggest server performance "jump". Apache is more than powerfull enough to take away a lot of traffic. (We have had around 6000 users online within 15 minutes, without high load)

3) RAM is "magic", your DB-server MUST have more RAM than the total size of the whole forumDB, or else the performance will fly down below the floor.

We are running our boards with around 5/600 000 page views (pages, not images etc) each day, on we are running with around 30% of our server-resources in use. ;)

(1 www-server and 1 db-server, each with 8 CPUs and 16RAM)
 

cmanns

=D
Joined
May 15, 2007
Messages
159
Time to give some corrections.


1) Load average is decided by the number of CPUS, a load average of 1 does not say _anything_ at all. Your server does not have to much to do until the load average is above the number of CPU-cores on the server. If you have 8 CPU`s, you can have a load average of eight before the server is starting to get "overloaded". ;)

2) To go away from Apache is "evil", at least if WWW and DB is not seperated to seperate servers. To split those 2 services up is whats going
to give you the biggest server performance "jump". Apache is more than powerfull enough to take away a lot of traffic. (We have had around 6000 users online within 15 minutes, without high load)

3) RAM is "magic", your DB-server MUST have more RAM than the total size of the whole forumDB, or else the performance will fly down below the floor.

We are running our boards with around 5/600 000 page views (pages, not images etc) each day, on we are running with around 30% of our server-resources in use. ;)

(1 www-server and 1 db-server, each with 8 CPUs and 16RAM)

I have no clue what I'm running atm, I'm hired to tune servers I don't exactly check into the sites stats.

1 job i did in june was a high traffic render site + ipb forums, the forums always have 100people per 5 or 10 mins i cant recall the alexa rating is traffic rank of: 4,810

The server is a 4x dual core opteron system, so 8 cpu's and the avg load running cpanel was 27 points and it'd go much higher easially.

After I was done, a mear 1points, I occasionally ssh in to check the date of the software I installed, optimize the databases but otherwise the setup is stable, no need for a seperate db server or 8gb of ram its got almost 1mil posts so I think thats about 1.8gb db, its got 4gb ram, mysql is using about 25% if I recall.

The site is highly optimized you cannot just grab two servers and have your vb or ipb perform good =]

I will be putting out a optimization pack for ipb @ ahmodding.com hopefully soon, I'll post here with the link in the future, it has file edits for performance, methods of saving bandwidth, etc :unhunh: thxu for the explanation of server load, the server load stamp isnt 100% exactly as you explained nor is it 100% correct, if you look at the 3rd number, thats a better idea if your overloaded or not but it also takes in more factors if i recall.

Sure seperating apache is nice and all but I'd rather run a good webserver :) theres no reason why a script should depend on apache either, sucks having to change rewrite scrips

lighttpd has some great features, easy to customize, etc. I use a svn build on many many production sites top alexa 100k (like the above) with absolutely no problems.

-Chris
 

cmanns

=D
Joined
May 15, 2007
Messages
159
General Update


Hey guys, haven't been to TAZ in awhile, so I'll give a update :D

This will be more general for most PHP apps.

  1. Dedicated/VPS Server owners, consider another webserver type such as LightTPD, Cherokee, LightSpeed
  2. Tune your My.cnf, example tuned conf below this was for a server with 8GB of ram running apache 2.2 mod_fcgid w/PHP5 Ioncube & XCache enabled.... beware of copying and pasting, I'd suggest to view this my.cnf, please note I'm sorry it's messy but it's been passed through servers over the years and IS messy, but all our MySQL servers have over 2GB ram and this one seems to work GREAT, even with SQL servers hosting hundreds of sites!

    We use UTF8 as you can see, I SUGGEST UTF8 BUT YOUR SITE MAY NEED ITS CHARS CHANGED, THIS IS A COMPLICATED SQL PROCESS SOME HOSTS USE LATIN, ETC I DONT KNOW WHY! If you have the chance, switch to utf8 today!

    Code:
    [mysqld]
    set-variable = max_connections=500
    safe-show-database
    #THIS IS A SEPARATE DISK ON OUR SQL BOX!!!, PLEASE REMOVE THIS VALUE UNLESS YOU PLAN TO USE A SEPARATE #DRIVE, MAKE SURE THE PATH SPECIFIED CAN BE WRITTEN BY MYSQL!
    tmpdir = /archive/mysql-data/cache
    skip-bdb
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Default to using old password format for compatibility with mysql 3.x
    # clients (those using the mysqlclient10 compatibility package).
    default-character-set=utf8
    character-set-server=utf8
    collation-server=utf8_unicode_ci
    
    init_connect='SET collation_connection = utf8_general_ci'
    init_connect='SET NAMES utf8'
    default-character-set=utf8
    #performance shizzle
    # Try number of CPU's*2 for thread_concurrency
    thread_concurrency = 8
    # thread_concurrency * 2 normally (cpu*4)
    thread_cache_size = 16
    
    #Temp table stuff, must set both to be of use, or smallest is used
    #tmp_table_size = 32M
    #max_heap_table_size = 32M
    max_heap_table_size = 64M
    tmp_table_size = 32M
    
    long-query-time = 1
    key_buffer = 190M
    max_allowed_packet = 24M
    #log-slow-queries=/usr/sql/slow.log
    # Set to max number of open tables you have concurrently (730 currently)
    table_cache = 800
  3. If you're using apache enable mod_deflate and mod_memcache (Dedicated/VPS)
  4. Use CDN style loading, browsers can only open X amount of connections by default per domain, if you create a subdomain crafty (images.domain.com maps to /forums/style_images/) for instance, then you can load CSS and such from another URL, IPB has methods of doing this by default and so do other scripts! Firefox defaults at 6 or 8 connections per domain if I recall, I used to have a IPB mod that would make each avatar load from it's own subdomain avatar-*.domain.com and mapped it properly, was amazing boost in speed for topics.
  5. Always use PHP5 latest and XCache, Memcached is handy too! Some webproviders (Such as me self) provide you with Memcache, Eaccelerator, ETC. As in the above guide with the memcache you can enable xcache and such with the fallowing in conf_global.php IPB 3.x/2.x
    Code:
    $INFO['use_memcache'] = 1;
    $INFO['memcache_server_1'] = "nameofserver";
    $INFO['memcache_port_1'] = "11211";
    
    $INFO['use_xcache'] = '1';
    $INFO['use_apc'] = '1';
    etc
  6. Keep update topic views immideately disabled, this will help your SQL server load (Remember to be nice to shared hosts :), you can increase the task in IPB to save topic views every X interval, I choose 15 mins on most sites I tune.
  7. Don't feel afraid to post your site URL and ask if it's slow or fast and if you missed any tuning aspects.
  8. Browsers do make a difference for your visitors, suggest OpenDNS and Firefox (Latest Safari for Snow Leopard is VERY fast!)
  9. Shoutboxes can be quick on big sites, just remember to clear caches & prune shouts every so often, posts are like posts, don't you feel search slow as you get hundreds of thousands of posts? Yeah, keep shouts under 100k ;)
  10. If your search is slow, try out Sphinx search daemon it works great with scripts and is easy to implement!
  11. Some javascript is best placed at the bottom of pages, try to optimize your site theme's CSS/JS and HTML :D

Anything I'm missing or any questions just ask my friends :heart:
 
Last edited:
Top