Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

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
      #52  
    Old 05-21-2009, 10:14 PM
    MmS1 MmS1 is offline
     
    Join Date: Nov 2008
    Posts: 51
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Thanks i have two problem
    1 when i active this mod i can't download any files "attachments"

    2 It's only for thumbs i mean is there any option to make it with other attachments i have a big Problem with attachments server load i have more then 60 user download attachments each One 20 mb and up to 40
    Thats will help me alot
    Reply With Quote
      #53  
    Old 05-21-2009, 10:43 PM
    Vitaly's Avatar
    Vitaly Vitaly is offline
     
    Join Date: Apr 2004
    Location: Russia, St.Petersburg
    Posts: 428
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    MmS1,

    Do you use nginx webserver? I have no problems with full attachments (not thumbs), but this option work ONLY with nginx. With other webserver "nginx acceleration" must be disabled, see FAQ. Don't enable all mod options "just for fun", if you don't have nginx webserver.

    If you use nginx, but full attaches can't be downloaded, check twice absolute path to directory (see config samples in FAQ)

    Try to re-read FAQ and my explanations on previous page.
    Reply With Quote
      #54  
    Old 05-21-2009, 10:58 PM
    mindhunter77 mindhunter77 is offline
     
    Join Date: Jan 2006
    Posts: 194
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    This is the config I used when I had your mod working AND vBSEO attachment rewrites going. Now from the site, everything worked. In fact, load even when down. Yet I'm not sure if it's correctly working or not.

    Notice I did not add your config options as this seemed to work.

    Code:
    server {
    listen   80 default;
    server_name www.xxxx.com xxxx.com;
    server_name_in_redirect on;
    
    
    location / {
    root   /www/vhosts/xxxx.com/htdocs;
    index index.php;
    autoindex on;
    access_log off;
    
    }
    
    location ~ \.php$ {
    root           /www/vhosts/xxxx.com/htdocs;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
    include   fastcgi_params;
    fastcgi_intercept_errors	on;
    }
    
    
    location /forum/ {
    
    if (!-e $request_filename) {
    rewrite ^/forum/(.*)$ /forum/vbseo.php last;
    }
    
    }
    if ($request_filename ~ "\.php$" ) {
    rewrite ^(.*)$ /forum/vbseo.php last;
    }
    
    
    
    location ~* \.(swf|pdf|ico|css|js|gif|jp?g|attach|thumb|png)(\?[0-9]+)?$ {
    expires max;
    root 	/www/vhosts/xxx.com/htdocs;
    }
    
    
    
    location /status {
        stub_status on;
        access_log   off;
    }
    
     }
    Reply With Quote
      #55  
    Old 05-21-2009, 11:29 PM
    Vitaly's Avatar
    Vitaly Vitaly is offline
     
    Join Date: Apr 2004
    Location: Russia, St.Petersburg
    Posts: 428
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    At first glance, that can work

    IMHO, there are no reasons to add "expires max". Very cheap economy, but potential problems with browser cache, if you upload new CSS for some mod and so on.
    Reply With Quote
      #56  
    Old 05-21-2009, 11:54 PM
    mindhunter77 mindhunter77 is offline
     
    Join Date: Jan 2006
    Posts: 194
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    ok, set at 30d; ??
    Reply With Quote
      #57  
    Old 05-22-2009, 12:04 AM
    Vitaly's Avatar
    Vitaly Vitaly is offline
     
    Join Date: Apr 2004
    Location: Russia, St.Petersburg
    Posts: 428
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    No. Remove it at all.
    Reply With Quote
      #58  
    Old 05-22-2009, 01:52 AM
    mindhunter77 mindhunter77 is offline
     
    Join Date: Jan 2006
    Posts: 194
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    ok,

    For those who want to test this mod with vBSEO still handling your attachments this is my working conf file nginx. This one is updated from the last one I posted and has some fixes. Keep in mind a few things.

    1) In my conf where it says /thumbnails is not attachment thumbnails, I embed flv video on my site and this is where the flv thumbs go. You will not need this.

    2) I placed this in the mod config area, and have both options set to YES.

    Code:
    /forum/uploadedimages
    3) My server was running between 2.00 and 3.00 at all times before this mod, it now runs at 1.0 or less. I could probably get it even lower then that if I disabled the handling of attachments through vBSEO all together, but I get a lot of google image traffic and don't want to risk loss of ranks.

    4) My forum gets about 50,000 unique per day, 90% of all threads contain pictures and video with picture thumbnails at 400px.



    Code:
    server {
    listen   80 default;
    server_name www.xxxx.com xxxx.com;
    server_name_in_redirect on;
    
    
    
    location / {
    root   /www/vhosts/xxxx.com/htdocs;
    index index.php;
    autoindex on;
    access_log off;
    
    }
    
    location ~ \.php$ {
    root           /www/vhosts/xxxx.com/htdocs;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
    include   fastcgi_params;
    fastcgi_intercept_errors	on;
    }
    
    
    
    location /forum/ {
    
    if (!-e $request_filename) {
    rewrite ^/forum/(.*)$ /forum/vbseo.php last;
    }
    
    }
    if ($request_filename ~ "\.php$" ) {
    rewrite ^(.*)$ /forum/vbseo.php last;
    }
    
    
    location /forum/uploadedimages {
    root    /www/vhosts/xxxx.com/htdocs;
    expires 24h;
    }
    
    
    
    location /forum/thumbnails {
    root    /www/vhosts/xxxx.com/htdocs;
    expires 24h;
    }
    
    
    location ~* ^.+\.(gif|png|ico|css|zip|tgz|gz|rar|pdf|bmp|js|swf) {
    access_log   off; 
    expires 24h; 
    root 	/www/vhosts/xxxx.com/htdocs;
    
    	}
    
    
    location /status {
        stub_status on;
        access_log   off;
    }
    
     }
    Reply With Quote
      #59  
    Old 05-22-2009, 11:09 AM
    MmS1 MmS1 is offline
     
    Join Date: Nov 2008
    Posts: 51
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Quote:
    Originally Posted by Vitaly View Post
    MmS1,

    Do you use nginx webserver? I have no problems with full attachments (not thumbs), but this option work ONLY with nginx. With other webserver "nginx acceleration" must be disabled, see FAQ. Don't enable all mod options "just for fun", if you don't have nginx webserver.

    If you use nginx, but full attaches can't be downloaded, check twice absolute path to directory (see config samples in FAQ)

    Try to re-read FAQ and my explanations on previous page.
    Thanks alot but iam not running with nginx
    I have hostshare is that oky i mean they can install nginx 4 me or not

    My attachments path out forum path how can mange this

    mydomain.com/vb this is my forum path
    mydomain.com/vbatttatn this is my attachments path
    Reply With Quote
      #60  
    Old 05-22-2009, 04:41 PM
    mindhunter77 mindhunter77 is offline
     
    Join Date: Jan 2006
    Posts: 194
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    nginx is a webserver, for this to work 100% you need to be using nginx as your webserver, your host may not just switch that for you, you will have to ask them
    Reply With Quote
      #61  
    Old 05-22-2009, 07:51 PM
    MmS1 MmS1 is offline
     
    Join Date: Nov 2008
    Posts: 51
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    thanks i'll ask them
    and about the path

    My attachments path out side forum path how can mange this

    mydomain.com/vb this is my forum path
    mydomain.com/vbatttatn this is my attachments path
    Reply With Quote
    Reply


    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 11:02 AM.


    Powered by vBulletin® Version 3.8.12 by vBS
    Copyright ©2000 - 2025, vBulletin Solutions Inc.
    X vBulletin 3.8.12 by vBS Debug Information
    • Page Generation 0.04559 seconds
    • Memory Usage 2,339KB
    • Queries Executed 27 (?)
    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
    • (3)bbcode_code
    • (1)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
    • (4)pagenav_pagelink
    • (11)post_thanks_box
    • (11)post_thanks_button
    • (1)post_thanks_javascript
    • (1)post_thanks_navbar_search
    • (11)post_thanks_postbit_info
    • (10)postbit
    • (2)postbit_attachment
    • (11)postbit_onlinestatus
    • (11)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