vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Board Optimization - vB Accelerator (https://vborg.vbsupport.ru/showthread.php?t=244391)

Vitaly 06-10-2010 10:00 PM

vB Accelerator
 
1 Attachment(s)
ported & significantly improved vb 3.8 branch.

This mod is suited for medium and big boards. It reduces server load, caused by thumnails and big attachments. Includes significant recommendations for server tuning, to speedup pages loading.

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.
  3. Browser does lots of additional requests to static file, to check if modified
  4. JS/CSS not compressed
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. Static files are properly cached/compressed after tuning
how to install:
  1. Make sure, attachments are stored on disk, NOT in database.
  2. Make sure, that thumbnails are in web-accessible area. If not - reconfigure your web-server first.
  3. Check manually, that you can download any .thumb file via browser.
  4. !!! Tune cache/compression settings for static files (see example from next post)
  5. Import product XML & tune settings.
  6. Enjoy
This mod is developped here: http://github.com/rcdesign/vb-accelerator . Patches are welcome.

history:

0.9
- fixed path for duplicated attachments

0.8
- fixed back timestamp parameter & substitutions for XML output
- added conversion for assets.php thumbnails (in attachments manager)

0.7
- ported to vb4
- added basic CDN support for thumbnails

Vitaly 06-11-2010 06:51 AM


Nginx config sample


Code:

# Modified gzip settings: added CSS/JS,
# but completely disabled for broken browsers.
gzip_types      text/plain text/css application/x-javascript text/xml text/javascript;
gzip_disable    "MSIE [1-6].(?!.*SV1)";


# globally disable external access to attachments, but enable for X-Accel-Redirect
location /uploads {
    internal;
}
# enable thumbnails direct access, but nothing else!
location ~* /uploads/(.*)\.thumb$ {
    expires 24h;
}


# Expires for static files.
location /images/ {
    expires 24h;
}
location /clientscript/ {
    expires 24h;
}
location /custom { # All at once: profile pics, avatars, group images
    expires 24h;
}




Apache config example


TBD :) . Please, help to fill.

funmasti 06-11-2010 09:41 AM

Thanks... anyone tried it?

gwerzal 06-11-2010 10:11 AM

This looks good. thanks for sharing.

Vitaly 06-12-2010 12:35 PM

Updated mod to catch XML output & timestamp issues.

TeknoSounds 06-12-2010 05:46 PM

Will this work along side vbOptimize and vB4: Supercharged? Are there conflicts? Duplicated features?

ChopSuey 06-12-2010 05:54 PM

Quote:

Originally Posted by TeknoSounds (Post 2052600)
Will this work along side vbOptimize and vB4: Supercharged? Are there conflicts? Duplicated features?

vBOptimize is more of caching, vB4 supercharges is like "Store CSS As files" option but a little better. I don't see any conflicts.

Darkimmortal 06-12-2010 10:25 PM

Oh cool, this looks like an improved version of my 'Attachment Optimiser' in vB4 SuperCharged - installed :)

Dr.osamA 06-12-2010 10:59 PM

Thanks
installed

but i am not sour if it is working

anyone tried it?

waiting for tests

Vitaly 06-13-2010 12:31 AM

Quote:

Originally Posted by Darkimmortal (Post 2052690)
Oh cool, this looks like an improved version of my 'Attachment Optimiser' in vB4 SuperCharged - installed :)

In fact, on the second page load, other feature doesn't make sence, if you set long expire for static content :) . You can check with firebug NET bookmark.

Optimizing the first page load is potentially interesting, but price in your case is very high - big server load and lots of possible conflicts.


All times are GMT. The time now is 12:42 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.03353 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete