Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arrowchat and Amazon instances

I have a site with codeigniter, mysql, which has arrowchat installation in it. the site (say xyz.com) is hosted in amazon environment. It has S3 implementation for image uploads, CDN implementation for static file serving, RDS implementation for db, SES for Mail sending . There is a plan to integrate Auto scaling for the site. I have researched on how the arrowchat will be implemented in the this scenario, as arrowchat have template and configuration file being cached, had to do some research on this for this cache sharing among the instances. I tried

a). created an S3 bucket and mapped it to arrowchat cache folder - but it didnt go well as arrowchat library code included file in the cache directory, so being in s3 we couldnt directly include files in our arrowchat code.

b). created a subdomain chat.xyz.com and installed the arrowchat in that sub domain and used it in the instances. - it worked out well barring some cross domain code issues which was solved by some code fixes. Issue was, we had to manage same code in a domain and subdomain.

Please let me know whether the methods I have listed are proper methods. If no, please let me know if there is any other suggestion.

like image 928
Anoop n Avatar asked Nov 30 '12 09:11

Anoop n


1 Answers

You need to use ElasticCache and share the Node pool among all the instances of the autoscale group. If the templates need processing you can't use amazon S3 directly. (The php code on a specific instance HAS to read the template, process it and send it back). Pseudocode: Associate a unique Key to each template (i.e. data/template_name ). When a template is requested, check on Memcache if there is such Key. Otherwise read it from S3 and load it in the cache. Once is in the cache all the instances will be able to use that single value.

like image 152
fabrizioM Avatar answered Nov 10 '22 09:11

fabrizioM