digitalpoint
Well-known member
Not sure what it's going to be like trying to keep avatars files within data/avatars in sync across multiple web servers... Especially when you get a ton of them.
csync2 works fairly well for maintaining cluster synchronization, but I can see where it might start getting obnoxious when it's trying to calculate exactly what files changed across 4 or 5 web servers when you have a ton of avatars (say you have 600,000 users and even of only 100,000 have avatars... 3 sizes saved, it's 300,000 files it has to check on every web server every time someone changes their avatar). It could even be the source of a user-triggered DDoS attack by changing their avatar over and over and your syncing mechanism not able to sync as fast as new avatars are coming in.
The database load for pulling avatars from the database is pretty minimal if you use Cache-Control headers properly... 1 query per avatar seen by the end user and then force their browser to not even bother checking if the image changed for 180 days or something (if the avatar does change, it will be reflected instantly since the timestamp of when it was last updated is appended to the avatar URL already).
Thankfully it doesn't look terribly hard to make an addon to make it database based if I need to extend Model_Avatar to do so... but still would be a nice option for bigger sites that have multiple web servers.
csync2 works fairly well for maintaining cluster synchronization, but I can see where it might start getting obnoxious when it's trying to calculate exactly what files changed across 4 or 5 web servers when you have a ton of avatars (say you have 600,000 users and even of only 100,000 have avatars... 3 sizes saved, it's 300,000 files it has to check on every web server every time someone changes their avatar). It could even be the source of a user-triggered DDoS attack by changing their avatar over and over and your syncing mechanism not able to sync as fast as new avatars are coming in.
The database load for pulling avatars from the database is pretty minimal if you use Cache-Control headers properly... 1 query per avatar seen by the end user and then force their browser to not even bother checking if the image changed for 180 days or something (if the avatar does change, it will be reflected instantly since the timestamp of when it was last updated is appended to the avatar URL already).
Thankfully it doesn't look terribly hard to make an addon to make it database based if I need to extend Model_Avatar to do so... but still would be a nice option for bigger sites that have multiple web servers.
Upvote
8