Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

Reply
 
Thread Tools
vB Accelerator Details »»
vB Accelerator
Version: 0.4, by Vitaly Vitaly is offline
Developer Last Online: Jul 2014 Show Printable Version Email this Page

Category: Board Optimization - Version: 3.8.x Rating:
Released: 03-06-2009 Last Update: 03-09-2009 Installs: 87
Uses Plugins Auto-Templates
Re-useable Code  
No support by the author.

vb 4.0 version here

This mod is suited for medium and big boards. It reduces server load, caused by thumnails and big attachments.

what's the problem with?
  1. In original vB all thumbnails a downloaded via php. So, if you page contains 10-20 attached images, then each page php request will be followed by 10-20 thumbnails php requests. That's very bad.
  2. When attachments body transfered via php, that's much more waisteful, than direct transfer of static file. Especially for big files.
what this mod does:
  1. All thumbnails will have DIRECT links (served as static files). Much lower reply latency and server load.
  2. If you have nginx webserver, you php-fcgi will not participate in file transfer any more. It will reply with X-Accel-Redirect header. Then nginx will proceed attachment as static file.
    • No more problems with multiple downloads of 10-mb files.
    • No needs to restrict attachments and full-size images for guests and search bots.
  3. That works for forum posts, blogs, albums. Everywhere!
how to install:
  1. Make sure, this files are stored on disk, NOT in database:
    • post attachments & thumbnails
    • blog attachments & thumbnails
    • album images & thumbnails
  2. Make sure, that thumbnails are in web-accessible area. If not - reconfigure your web-server first. If you own big board - then you know how to do that .
  3. Check manually, that you can download any .thumb file via browser.
  4. Import this product, and set options for you configuration.
  5. Be happy to reduce server count in your cluster
PS. It's tested and works fine at my production site for 1 week. But I'll be happy to know server load statistics from big boards owners.

This mod is developped here: http://github.com/rcdesign/vb-accelerator . Patches are welcome.

History

0.4
- fixed bug with PHP wagnings in server logs.

0.3
- first public release

Download Now

File Type: xml product-vb_accelerator.xml (12.8 KB, 535 views)

Screenshots

File Type: gif vbaccelerator.gif (42.9 KB, 0 views)

Supporters / CoAuthors

    Show Your Support

    • This modification may not be copied, reproduced or published elsewhere without author's permission.

    Comments
      #2  
    Old 03-06-2009, 11:54 PM
    Vitaly's Avatar
    Vitaly Vitaly is offline
     
    Join Date: Apr 2004
    Location: Russia, St.Petersburg
    Posts: 428
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Faq

    Q1. I don't have nginx. Will this mod work for me?

    Yes, partially. Enable direct thumbnail links, but disable nginx acceleration. You'll still have serious benefit, if your forum is plenty of attachments.

    Q2. What about lignttpd, apache and so on? They have X-Sendfile, alternative to nginx X-Accel-Redirect.

    I know, but:
    • I don't have such configurations to test, and I don't have time to implement that. You can do it yourself or hire someone (NOT ME) for this work.
    • X-Sendfile don't support partial content download . Nginx's X-Accel-Redirect it the best you can use.
    Q3. Is it safe to give direct access for thumbnails?

    Why not? You can give direct access for thumbnails, but disable direct access to original files. Just configure your server properly. See examples below.

    Q4. Thumbnails looks like files with strange extention and mime-type. Will those be ok in browser?

    Yes. HTML-page address those files via imagetag. So, browser show those properly, even with wrong mime and strange extention.

    Q5. Why don't you fix that for sure?

    Because that requires vB sources modification, and i hate such things. And if everyting works fine, who cares about mimes ?

    Q6. My forum has 20 users online, and I don't see difference at my 32-core server with 128Gb ram and 8 SSD raid array.

    You a happy man, really.

    Q7. Does it work with VBSEO ?

    If attachment rewrite is disabled - yes, it works. And check, that attachments path is separated in vbseo rewrite rules in webserver config. I use vbseo in this mode with no problems. Sorry, no plans now to make better integration with vbseo. But code is reuseable, or you can send your patches



    Server configuration examples

    let's say, whe have the following folders structure:

    /uploads
    /uploads/blogs/* <- blog attachments & thumbnails
    /uploads/posts/* <- forum attachments & thumbnails
    /uploads/albums/* <- album images
    /uploads/al_thumbs/* <- album previews

    So, we have to setup direct access for thumbtails, but protect original files.

    Nginx

    # globally disable external access, but enable for X-Accel-Redirect
    location /uploads {
    internal;
    }
    # enable direct access to blogs & posts thumbnails, but nothing else!
    location ~* /uploads/(.*)\.thumb$ {
    }
    # enable direct access to album thumbnails
    location /uploads/al_thumbs/ {
    }

    Apache/Lighttpd

    TBD. You are welcome to share your one
    Reply With Quote
      #3  
    Old 03-07-2009, 12:05 AM
    lonasdigital's Avatar
    lonasdigital lonasdigital is offline
     
    Join Date: Dec 2006
    Posts: 9
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Gracias Voy a probarlo ahora mismo .
    Reply With Quote
      #4  
    Old 03-07-2009, 12:25 AM
    Frondy's Avatar
    Frondy Frondy is offline
     
    Join Date: Feb 2009
    Location: Zagreb, Croatia
    Posts: 62
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Well, it works! Thank you!
    Reply With Quote
      #5  
    Old 03-07-2009, 02:03 AM
    rob01 rob01 is offline
     
    Join Date: Sep 2008
    Location: Mexico
    Posts: 410
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    is this a good option for small forums?
    Reply With Quote
      #6  
    Old 03-07-2009, 02:25 AM
    JamesAB JamesAB is offline
     
    Join Date: Dec 2003
    Posts: 125
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Quote:
    Q4. Thumbnails looks like files with strange extention and mime-type. Will those be ok in browser?

    Yes. HTML-page address those files via imagetag. So, browser show those properly, even with wrong mime and strange extention.
    I'm not using this mod, but I recently looked into serving static thumbnails on vBulletin.

    In apache httpd.conf, I know you can use:
    Code:
    AddType image/jpeg .thumb
    Reply With Quote
      #7  
    Old 03-07-2009, 02:33 AM
    lazydesis lazydesis is offline
     
    Join Date: Sep 2006
    Posts: 234
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    what is this nginx ?i have centos OS and apache .. will this increase performance on that?
    Reply With Quote
      #8  
    Old 03-07-2009, 02:38 AM
    Vitaly's Avatar
    Vitaly Vitaly is offline
     
    Join Date: Apr 2004
    Location: Russia, St.Petersburg
    Posts: 428
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Quote:
    Originally Posted by rob01 View Post
    is this a good option for small forums?
    Everything is relative in this life . That depends on attachments count and CPU/IO load. If you have no attachments at all, you'll have nothing with this mod.

    But nobody prohibit you to try and compare if server load changes . At least, direct linked thumbnails will be loaded faster for your users.

    Quote:
    Originally Posted by JamesAB View Post
    I'm not using this mod, but I recently looked into serving static thumbnails on vBulletin.

    In apache httpd.conf, I know you can use:
    Code:
    AddType image/jpeg .thumb
    Yes. Exactly. But in fact that's not required. My rule is simple: the less customisations - the less possible mistakes in the future . You can always add it later, if something goes wrong.
    Reply With Quote
      #9  
    Old 03-07-2009, 02:46 AM
    Vitaly's Avatar
    Vitaly Vitaly is offline
     
    Join Date: Apr 2004
    Location: Russia, St.Petersburg
    Posts: 428
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Quote:
    Originally Posted by lazyindian View Post
    what is this nginx ?i have centos OS and apache .. will this increase performance on that?
    Yes. Nginx/lighttpd/lightsphere/zeus + php-fcgi will give you serious benefits over apache + mod_php on burst loads.

    In fact, that should be done before any futher vb optimizations. Maybe I'm a bit categoric, but in my opinion apache+mod_php system is absolutely inpredictable at big loads.

    Server optimisation should be done prior to any scripts optimization. That's essential.
    Reply With Quote
      #10  
    Old 03-07-2009, 06:59 AM
    Bounce's Avatar
    Bounce Bounce is offline
     
    Join Date: Mar 2004
    Location: Edinburgh,Scotland
    Posts: 919
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    I don't have an uploads folder so I don't know the paths

    Path to etc

    How do I find this out?
    Reply With Quote
    Reply

    Thread Tools

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT. The time now is 03:28 PM.


    Powered by vBulletin® Version 3.8.12 by vBS
    Copyright ©2000 - 2024, vBulletin Solutions Inc.
    X vBulletin 3.8.12 by vBS Debug Information
    • Page Generation 0.09352 seconds
    • Memory Usage 2,325KB
    • Queries Executed 25 (?)
    More Information
    Template Usage:
    • (1)SHOWTHREAD
    • (1)ad_footer_end
    • (1)ad_footer_start
    • (1)ad_header_end
    • (1)ad_header_logo
    • (1)ad_navbar_below
    • (1)ad_showthread_beforeqr
    • (2)bbcode_code
    • (4)bbcode_quote
    • (1)footer
    • (1)forumjump
    • (1)forumrules
    • (1)gobutton
    • (1)header
    • (1)headinclude
    • (1)modsystem_post
    • (1)navbar
    • (4)navbar_link
    • (120)option
    • (1)pagenav
    • (1)pagenav_curpage
    • (2)pagenav_pagelink
    • (10)post_thanks_box
    • (10)post_thanks_button
    • (1)post_thanks_javascript
    • (1)post_thanks_navbar_search
    • (10)post_thanks_postbit_info
    • (9)postbit
    • (2)postbit_attachment
    • (10)postbit_onlinestatus
    • (10)postbit_wrapper
    • (1)spacer_close
    • (1)spacer_open
    • (1)tagbit_wrapper 

    Phrase Groups Available:
    • global
    • inlinemod
    • postbit
    • posting
    • reputationlevel
    • showthread
    Included Files:
    • ./showthread.php
    • ./global.php
    • ./includes/init.php
    • ./includes/class_core.php
    • ./includes/config.php
    • ./includes/functions.php
    • ./includes/class_hook.php
    • ./includes/modsystem_functions.php
    • ./includes/functions_bigthree.php
    • ./includes/class_postbit.php
    • ./includes/class_bbcode.php
    • ./includes/functions_reputation.php
    • ./includes/functions_post_thanks.php 

    Hooks Called:
    • init_startup
    • init_startup_session_setup_start
    • init_startup_session_setup_complete
    • cache_permissions
    • fetch_threadinfo_query
    • fetch_threadinfo
    • fetch_foruminfo
    • style_fetch
    • cache_templates
    • global_start
    • parse_templates
    • global_setup_complete
    • showthread_start
    • showthread_getinfo
    • forumjump
    • showthread_post_start
    • showthread_query_postids
    • showthread_query
    • bbcode_fetch_tags
    • bbcode_create
    • showthread_postbit_create
    • postbit_factory
    • postbit_display_start
    • post_thanks_function_post_thanks_off_start
    • post_thanks_function_post_thanks_off_end
    • post_thanks_function_fetch_thanks_start
    • post_thanks_function_fetch_thanks_end
    • post_thanks_function_thanked_already_start
    • post_thanks_function_thanked_already_end
    • fetch_musername
    • postbit_imicons
    • bbcode_parse_start
    • bbcode_parse_complete_precache
    • bbcode_parse_complete
    • postbit_attachment
    • postbit_display_complete
    • post_thanks_function_can_thank_this_post_start
    • pagenav_page
    • pagenav_complete
    • tag_fetchbit_complete
    • forumrules
    • navbits
    • navbits_complete
    • showthread_complete