Yii is fundamentally developed with high-traffic large-scale webapps in mind. I’m quite sure, if you get it right, Yii will do the rest to support that much simultaneous users.
In this case, you definitely want to keep your database structure neat, your queries fast, APC/memcache/etc. turned on. I also suggest aggressive caching where it is appropriate.
Please note that createUrl() can also be a bottleneck in your application if you have many url rules.
I have used ab -n 1000 -c 10 with a list page from my application. The result was nearly about only 6 rps (without caching). I am a bit worried about this.
Generally using APC is not the same as CApcCache. You can enable and configure APC in your php.ini.
If you want to use APC as a caching facility, set an application component (the default ‘cache’ for example) in your main.php configuration file. Add ‘class’=>‘CApcCache’.
Framework alone doesn’t ensure you to have a high-traffic and high-concurrency site. It is more of a system project which involves many aspects.
You need to design your database carefully (e.g. extremely high-traffic site should avoid FK constraints).
You need to write your code carefully (e.g. avoid SQL joins if necessary).
You need to use caching techniques extensively.
You may need multiple web servers and/or DB servers.
…
With Yii, what you can be sure of is that the framework won’t be the bottleneck. And Yii provides you powerful caching support that you can hardly find in other frameworks.
For your test, as pestaa suggested, enable APC extension and see how much the RPS improves. Note that the "hello world" benchmark already shows you the upper limit.
Yii has little overhead (compared to other PHP frameworks). However, as said in previous posts, there could be some other bottlenecks: CPU power, available memory, network bandwidth… even disk speeds.
In my opinion, you should:
Use several processing backends and one frontend. There are some ways to use Apache in this setup, but I found lighttpd easier to use (but a bit tricky to configure properlly). You setup one lighttpd frontend and several php-cgi backends, common data and sessions in NFS (or sessions in memcached/memcachedb/database). I would recommend you to do this from the start, so you will avoid a pain in the … when you’re in production
Design you DB and queries (if manually written) carefully (if you use MySQL, it’s a bit tricky regarding indexes).
Cache your query results in a smart way (memcached is a good choice)
This is my situation: My workplace has acquired a third-app developed in Ruby. Our server is receiveng about 100 rps and is hanging down.
So, as the ninja developer of my job ( ), I was requested to develop a new version of the program (in one day! ). I haven’t perfomed huge performance tests with Yii, so I am a bit worried about it.
However, Qiang is absolutely right. Performance depends on many other variables. But, I was wanting to hear your opinions, anyway.
I’m just thinking that I get great scalability out of Apache with a mongrel cluster, and it’s easy to set-up.
Also, since you are using Ruby. Another approach that I’ve used is to use JRuby and deploy via the Glassfish gem – if you can justify running a Glassfish server, which at 100 rps, I suspect you can – then try that. It’s not at all hard to set up.
We are receiving about 25-30 submissions per minute.
It was like Qiang said. It isn’t enough to tune your Yii application. You have to tune either your Apache and MySQL. In Apache, you have to have memory and connections enough, tune wait_timeout and max_connections in MySQl, etc. And, I didn’t even needed APC.
Check this out, i think you can get some ideas out of it… even tho if its made for ruby on rails, i am sure it will help you out in wateva the language/framework