Your example is true if all you're doing is printing headers, and if you're on a dedicated server, and if you're not running a database server. The way I'm arranging this site, there will be one script that will probably be run at least 100 times more than any other. I'd rather be cautious and not get kicked off my host for using too many resources.
Since know one seems to know of any situation where hand-crafted headers might be a problem, I'll just do that and I can switch to CGI later if I need to. The more complicated and less popular scripts can still use CGI. | [reply] |
Yes my numbers are only true in that case but it is all relative. The point wasn't the number, they where the wow, the point was that both take an exceptionaly small amount of time, so don't base any judgments on a benchmark figure that is "relativly" worthless. Sorry if i missed that point before.
| [reply] |
Just for grins, I thought I'd have a go a seeing how the benchmark figures, as well as the extrapolations from them, stood up to a "real world" test. The following shows a the results of hitting the same, lightweight preforking server serving similar dynamic pages via CGI.pm, or a simplistic, 'raw cgi' script:
10 concurrent users making 100 requests each: c:\test>608420-b.plt -REQUESTS=100 -THREADS=10 -MODE=raw
10 threads running
100 trials of Mode:raw thread: 2 (23.386s total), 233.863ms/trial
100 trials of Mode:raw thread: 3 (23.495s total), 234.949ms/trial
100 trials of Mode:raw thread: 1 (23.670s total), 236.701ms/trial
7 threads running
100 trials of Mode:raw thread: 7 (23.491s total), 234.911ms/trial
100 trials of Mode:raw thread: 6 (23.697s total), 236.970ms/trial
100 trials of Mode:raw thread: 8 (23.482s total), 234.823ms/trial
100 trials of Mode:raw thread: 10 (23.323s total), 233.227ms/trial
100 trials of Mode:raw thread: 9 (23.424s total), 234.242ms/trial
100 trials of Mode:raw thread: 5 (23.901s total), 239.014ms/trial
100 trials of Mode:raw thread: 4 (23.953s total), 239.527ms/trial
c:\test>608420-b.plt -REQUESTS=100 -THREADS=10 -MODE=cgi
10 threads running
100 trials of Mode:cgi thread: 6 (80.614s total), 806.141ms/trial
9 threads running
100 trials of Mode:cgi thread: 1 (82.629s total), 826.292ms/trial
100 trials of Mode:cgi thread: 10 (81.855s total), 818.548ms/trial
100 trials of Mode:cgi thread: 2 (82.535s total), 825.349ms/trial
6 threads running
100 trials of Mode:cgi thread: 8 (83.137s total), 831.375ms/trial
100 trials of Mode:cgi thread: 9 (83.092s total), 830.920ms/trial
4 threads running
100 trials of Mode:cgi thread: 4 (84.023s total), 840.234ms/trial
100 trials of Mode:cgi thread: 7 (83.910s total), 839.102ms/trial
100 trials of Mode:cgi thread: 5 (84.161s total), 841.614ms/trial
100 trials of Mode:cgi thread: 3 (84.292s total), 842.917ms/trial
100 concurrent users making 10 requests each
The signifciance of these numbers? Probably very little as the users were running in the same box as the server and networking effects are eliminated, but it may serve to show that whilst the relativistic headline percentages produced by Benchmark serve to inflate differences, so extrapolations of the wallclock timings are equally flawed.
The only difference between the raw and cgi tests is the loading and use of the CGI.pm module. Whilst with 10 concurrent users the 3x difference in the delivery time, from ~250ms to ~850ms (excluding network latency), is neither here nor there. Once you get 100 users concurrent, the increase from ~3 seconds to ~9 seconds (exclusive) is likely to begin to impact the users perceptions of the website.
Is this significant enough to consider hand rolling CGIs with the risks that entails? Probably not. But it might be enough to consider looking elsewhere than CGI.pm, say CGI::Simple?
I'll make my test scripts available to anyone who's set up to run the tests under more real world conditions
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |