I already look after a Drupal site running on Amazon EC2 and I’m interesting in running a yii site in a similar way. Based on my experience with Drupal I’m interested if yii tackles any of the scalability challenges present in Drupal. My questions are:
Does the assets folder have to be shared between servers or can each server have its own copy?
Is there an easy way in yii to change the file store mechanism to let me push assets and images uploaded by users to Amazon S3? I’m not too bothered about getting assets onto S3 but getting user profile images onto S3 is essential. I want to upload to S3 within the workflow of an image being uploaded and avoid having a CRON job to sync files.
Is there anything in yii that requires sticky sessions? Assuming I’m storing sessions in the DB or memcache is there any other reason I’d still require sticky sessions?
The documentation talks about “minifying” js using the mapping functionality. This isn’t really minfifying in what I understand to be the true sense of the word i.e. stripping unnecessary white space etc but actually file aggregation which reduces HTTP requests by aggregating files into a single downloadable asset. The documentation does allude to physically minifying js files but doesn’t go into any detail - does anyone have a strategy with yii for minifying JS (and CSS for that matter)?
Sticky session - for load balancing between servers. A “sticky session” means that the load balancer will always send the user back to the server that processed their original request (instead of using round robin for example). For http traffic sticky sessions frequently aren’t required but I’ve had problems with Drupal in the past when I tried to use “proper” load balancing - hence the question if yii had any similar quirks.
Possibly I’m being pedantic but I wonder if the existing minify functions would be more correctly named if they were related to aggregation? I’m fairly sure both Google and Yahoo make the distinction between file aggregation and minification in their performance tips. Only a thought though - it all works very well regardless!
There is only one thing you need to be careful, that is the validationKey of CSecurityManager. By default, this key is automatically/randomly generated the first time and is stored under runtime directory. In multiple server environment, you should explicitly configure this property so that all servers share the same key. This key is used widely to generate hash keys for various security-related measures.
Other than this, I don’t think Yii should limit you in any other aspects when being used with multiple servers. Yii is a generic framework, while Drupal is a CMS in the first place. So Drupal may have more limitations (which is very reasonable).
Yeah, regarding minifying, we will consider your suggestion. We may add some enhancements in the near future too.
If you’re taking feature requests for enhancements then a nice way of parallelizing resource downloads within css files and the page in general would be fantastic! I found that introducing parallelization into my css files had by the far the biggest performance increase on my site.
Sorry about re-opening this thread but it seemed the logical place…
Just to clarify on my question about needing sticky sessions (i.e. a load balancer always directing a user back to the same server); If we have two servers each with their own asset directory and we enable page caching is the path to the asset directory also part of the page cache? If so this would presumably mean that we’d need sticky sessions and server specific caching since the asset directory cached in the page would be server specific.
I hope that makes sense! Would be great if someone could confirm my assumption one way or another