Simpliest CGI script09 December 2008
Let's swith for a bit fron nginx internals. For fun not profit I want to compare how fast the modern script languages can run as CGI scripts. CGI is old, not hot, but very stable.
Here are rusults. For comparising a static file nginx serves 5201.02 times per second and JS built in nginx responses up to 15,000 times per second:
- С: 600,07;
- Perl: 419,53;
- Ruby: 271,65;
- Python: 32,45;
It's obvious that I do not know how to prepare Python right. In other cases everything shows that prefork would definitely be needed.
Tested on: Intel Core 2 Duo, 2.16 GHz, 4 Mb L2, 2 Gb memory. Mac OS X 10.5.5 (9F33), Darwin 9.5.0.
- ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1]
- python 2.5.2
- perl 5.8.8 (darwin-2level)
- gcc version 4.0.1 (Apple Inc. build 5488)