回复
主题工具
vB Accelerator
x0952060001   #1 (permalink) 旧 2009-03-08, 09:53
版主
 
x0952060001 的头像
 
注册日期: 2008-03-18
帖子: 100
声望力: 8
x0952060001 的星途闪耀x0952060001 的星途闪耀x0952060001 的星途闪耀x0952060001 的星途闪耀x0952060001 的星途闪耀x0952060001 的星途闪耀
下载/声望点数:537
vB Accelerator

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.
上传的缩略图
vbaccelerator.gif  
上传的附件
文件类型: rar product-vb_accelerator.rar (2.5 KB, 4 次查看)

此帖于 2009-03-08 13:39 被 Xiao_T 编辑。
x0952060001 当前离线   回复时引用此帖
共 2 位会员,感谢 x0952060001 发表的文章:
bestword (2009-03-08), s1unick0 (2009-03-08)
Xiao_T   #2 (permalink) 旧 2009-03-08, 13:39
普通会员
 
Xiao_T 的头像
 
注册日期: 2008-01-18
帖子: 4292
声望力: 10
Xiao_T 绝对是天王巨星Xiao_T 绝对是天王巨星Xiao_T 绝对是天王巨星Xiao_T 绝对是天王巨星Xiao_T 绝对是天王巨星Xiao_T 绝对是天王巨星Xiao_T 绝对是天王巨星Xiao_T 绝对是天王巨星Xiao_T 绝对是天王巨星Xiao_T 绝对是天王巨星Xiao_T 绝对是天王巨星
下载/声望点数:19247
回复: vB Accelerator

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.



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

___ Xiao_T 的签名 ________________________
我发布资源的解压密码|password: ziy.cc
新注册会员-没下载权限.如何获得权限请看这里
How to upgrade to Entitled Member? can't download?

-------------------------------------------------------------------
Xiao_T 当前离线   回复时引用此帖
↑ 返回顶端 ↑
回复
主题工具


相似的主题
主题 主题作者 版面 回复 最后发表
[教学]为 VBB 添加新的 vB Code wiwjxx vBulletin 设计讨论 3 2009-07-03 16:53
Who's Who on Team vB|Vbulletin 团队成员介绍 Xiao_T vBulletin 相关讨论 0 2009-06-30 13:44
vB Optimise 1.3.2 加速插件 Xiao_T vBulletin 3.8.X 英文插件 2 2009-01-19 23:21
WebTemplates 3.7.x: VB Integrated CMS (Content Management System) Collect vBulletin 3.7.X 英文插件 0 2008-10-09 16:46
vb ad management 4.0.2 for vBulletin forum software 3.5 or later. fatefox vBulletin 3.7.X 英文插件 0 2008-10-02 02:44

Automatic Translations (Powered by Powered by Google):
Afrikaans Albanian Arabic Belarusian Bulgarian Catalan Chinese Croatian Czech Danish Dutch English Estonian Filipino Finnish French Galician German Greek Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Taiwanese Thai Turkish Ukrainian Vietnamese Welsh Yiddish