Most used front end: poll results no comments
For severals month now I put a poll about which front end people use for their website. Even if it s not a reference with only 85 votes I would like to publsih some result. Of course as the content of this website is ruby oriented, then the results will be also.
First it started with most of votes for apache. At the end Apache it’s still the first:
- 47%: apache
- 40%: nginx
- 7% : lighttpd
- 5% : others
The result for nginx is over general real stats but for the trend is here and nginx is more and more the choice for a ruby stack as I did present in my last post
Scaling a Rails app (Part 3 of 3) no comments
This the third and last part for a summary about solutions to help better computing of your rails app
Some home made benchmarks
NB: Following benchmarks have been made to a quick look study and not for a proof of concept.
The test machine (dedibox, ubuntu 6.10) is 1 core cpu @2Ghz – 1024 Mo memory. In each case the http server uses 10 processes on a real world application (not just ‘hello world!’). Sending 500 rq with 1 or 10 concurrency req:
| conc. req. | 1 | 10 |
|---|---|---|
| apache | ||
| mongrel | 39.4s – 12.7 r/s | 21.9s – 22.8 r/s |
| thin | 37.6s – 13.3 r/s | 17.7s – 28,15 r/s |
| nginx | ||
| mongrel | 39.2s – 12.8 r/s | 22.2s – 22.5 r/s |
| thin 0.5.4 | 39.8s – 12.6 r/s | 17.7s – 28.15 r/s |
| thin 0.6.1 socket x2 | 37.6s – 13.3 r/s | 17.8s – 28.1 r/s |
Since last time, Rails world has a new nice app server: thin. Replacement of mongrel, based on rack interface, it’s also recently added a unix socket connector where usually we use IP connector. For better performance, avoid longest stuff as scripts (google analytics). Other scripts/images/css are keys in http performances also, usage of assets in recommended.
As we can see in equivalent configuration there is no major difference for http server. Thin seems to be definitly faster than mongrel when you need to server more than 1 request at a time. And of course on a 1 core cpu, having more than one app server doesnt make the content served really faster.
Memory usage
Mongrel (48 Mo) -> Thin (40 Mo) less 15%
Apache (10 Mo) -> Nginx (1.4 Mo) less 85%
Finally I decided to move to a nginx / thin on socket configuration because of the memory usage and the fair performances. I even moved my PHP stuff with an fcgi connector.
Other ideas of tests: Varnish, Nginx and memcached. Maybe next time :)
[update]
Please find a good benchmark about nginx vs apache on Joe’s blog
Overall conclusion
I think when we need to compare two framework, about which one is faster, we should keep in mind all these levels of optimisation to scale an application, and then the raw performance is a secondary issue.
Radiant to Merb no comments
Merb is a (future) great framework. Radiant is good CMS. And they have so much in common. I’m curious about porting Radiant to Merb then I started the challenge. For people interested in the same challenge, I set up a repository. Then please feel free to participate.
[update]
I got invited on github then I cloned the git repository to http://github.com/sbusso/merb_radiant/tree/master
Action plan:
Merb is a framework equivalent to Action Pack. It can use Active Record. For generator we can use Rubigen, it s an extract of RailsGenerator.
For this we will use:
- Radiant trunk r742
- Merb (core and more) 0.9.0
- Merb helpers 0.9.0
- Merb ActiveRecord 0.9.0
- ActiveRecord 2.0.2
- Rubigen 1.2.0
The repository tree was build with:
- Hoe (modified) generated skeleton
- Merb application
- Radiant source
1. Move Radiant base:
- use plugins as gem:
- radius 0.5.1
- highline 1.4.0
- rubypants 0.2.0
- use other plugins as ruby libraries:
- redcloth
- bluecloth
- using active record: nothing to do
- radius and other ruby libs: nothing to do
- replace RailsGenerator with Rubigen (Radiant bin)
- work on initializer
- desactivate extension dependencies (first step we move only the base)
- manage Controller and libraries using controllers
- check routes management
- work on views to replace Rails specific code
2. Replace extension system with gems:
- first, activate gem with only code features
- second, deal with extension providing assets
Merb 0.9.0 - only for developer 2 comments
Following the next version of Merb, I’m a bit surprised by the way this new version came out:
Help of developers is needed for going on 1.0, then install it and try it.
Included :
- merb-core
- merb-action-args
- merb-assets
- merb-gen
- merb-haml
- merb-mailer
- merb-parts
- merb-more
- merb
merb-gen myapp



