Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Big Board Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Replicate attachments/images among servers Details »»
Replicate attachments/images among servers
Version: , by blackvborg blackvborg is offline
Developer Last Online: Nov 2008 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-03-2008 Last Update: Never Installs: 0
 
No support by the author.

Hello,
ho do you handle the replication of images/attachments among multiple servers to achive HA/LB ?

If you've multiple frontend web servers for your forum you've the problem of "sharing" attachments. Using rsync could be a good solution at the beginning but it's not efficient with hundred of thousand of files, moreover some webservers haven't the new images until the replication is complete.

I've read that some of you use a dedicated attachment server, but it's a single point of failure and for load balancing has the same problem as mentioned above (the lag before sync).
Any idea? I think a SAN/NAS is not a very affordable solution, NFS has other drawbacks

Thank you for sharing your solutions!

Show Your Support

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

Comments
  #2  
Old 02-03-2008, 03:43 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why would you want to duplicate your attachments ?
Reply With Quote
  #3  
Old 02-03-2008, 03:59 PM
nexialys
Guest
 
Posts: n/a
Default

did you check with your host about Mirroring your server content?!
Reply With Quote
  #4  
Old 02-04-2008, 04:37 PM
mute mute is offline
 
Join Date: Dec 2002
Location: Phoenixville, PA
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's the route we took with our multi-webserver setup:

1) Initially we tried rsync, but found that it sort of sucked for users when they'd upload an avatar or attachment and the link would be broken for some people until the rsync happened (1 minute is still too long to lag IMO).

2) We setup FASD or whatever it is called to monitor directories for changes and rsync based on activity. This worked OK, but it was sort of prone to problems, and still lagged a wee bit.

3) We decided to add a bunch of webservers, so we moved to a setup where we have an image server (running thttpd) that serves all the images and most of the static content (js, etc) on the site. This server also runs NFSd, and serves our webroot out to all of our webservers. The webservers mount the webroot via NFS, have rw access to avatars and attachments but only ro access to everything else.

#3 has been working well for us for a couple of years now. Sure, it's a single point of failure, but it has the least amount of headache compared to some of the other solutions I've seen (hacking code so image uploads go to a specific server, etc).

In the near future I'd like to start thinking about provisioning a better disaster recovery system where the webservers rsync a copy off the NFS to their local disks, and a new virtualhost so in the event of an imageserver failure, I can point the images url at our loadbalancer as opposed to the images server and move the local webroots into place and the webservers will pick up the slack until our images server is back online.
Reply With Quote
  #5  
Old 02-06-2008, 06:10 PM
blackvborg blackvborg is offline
 
Join Date: Dec 2006
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello mute, thank you for your post; I've evauleated all your points and the best (in theory) seems the 2nd, but it's not much reliable (eg the notify of file change happens when the write starts and not when it finish, moreover you've some headeache with the replication of new directories)

about NFS yes, it a SPOF. have you some figure about the performance of apache running against a local filesystem vs a network filesystem like NFS? in some benchmarks I've seen that the performance are much lower. for sure it's the easiest implementation.

About HA and NFS I think you could rsync the nfs content on a second passive server (or just one of your webserver) and in case of failure change the NFS server to the backup server

BTW I don't like none of them

for Loco.M: I'd replicate attachments bacause I need to have more webservers

for nexialys: I've not found much to date; I'm looking for realtime mirroring software; not found much except network filesystem like redhat gfs (poor performance for me)

any other advice?
Reply With Quote
  #6  
Old 02-06-2008, 06:25 PM
mute mute is offline
 
Join Date: Dec 2002
Location: Phoenixville, PA
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by blackvborg View Post
Hello mute, thank you for your post; I've evauleated all your points and the best (in theory) seems the 2nd, but it's not much reliable (eg the notify of file change happens when the write starts and not when it finish, moreover you've some headeache with the replication of new directories)

about NFS yes, it a SPOF. have you some figure about the performance of apache running against a local filesystem vs a network filesystem like NFS? in some benchmarks I've seen that the performance are much lower. for sure it's the easiest implementation.

About HA and NFS I think you could rsync the nfs content on a second passive server (or just one of your webserver) and in case of failure change the NFS server to the backup server

BTW I don't like none of them

for Loco.M: I'd replicate attachments bacause I need to have more webservers

for nexialys: I've not found much to date; I'm looking for realtime mirroring software; not found much except network filesystem like redhat gfs (poor performance for me)

any other advice?
Well, as far as NFS vs locally hosted content, I'm sure there's a performance hit, but I don't have any hard numbers. One thing to remember is that if you are using a PHP cache like Xcache, APC, etc, then a lot of your dynamic content (the only thing we serve via apache) is cached in memory, so the amount of traffic over the NFS is actually a lot less than you'd expect.
Reply With Quote
  #7  
Old 02-07-2008, 01:16 AM
EricGT EricGT is offline
 
Join Date: Jan 2004
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just use an NFS mount for the front-end servers and keep an rsync'ed copy of the mount on another server. My servers utilize RAID arrays, so while I have lost hard drives occasionally over the years, I've never lost an array or had any unexpected downtime due to hard drive failure, nor have I ever suffered any data loss. If there is a performance hit for setting things up this way, I haven't noticed it. Eric
Reply With Quote
  #8  
Old 02-09-2008, 12:00 PM
blackvborg blackvborg is offline
 
Join Date: Dec 2006
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've not found any benchmark/tests about NFS vs local; have you found any of it?
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 04:58 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.04264 seconds
  • Memory Usage 2,266KB
  • Queries Executed 21 (?)
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
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (8)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete