mod_servlet and Java Servlets Performance comparison - novalexei/mod_servlet GitHub Wiki

mod_servlet vs Java Servlets

This is not a formal performance comparison. I don't have time and hardware for it. I just ran Apache bench to measure the performance of simple servlet which doesn't really do anything except generating html text of about 750 bytes in size. The bench performed on a local machine.

Software

vs

HTTP results

Here are the results I got via plain http. In the table rps stands for "requests per second"

Concurrency Tomcat (rps) Apache mod_servlet (rps) Ratio
1 3834 4708 1.23
5 15209 16095 1.06
10 15321 18302 1.19
30 15794 19925 1.26
50 15532 20077 1.29

From 6% to 29% performance improvement. Not so bad for the application which essentially doesn't do anything. The measurements for the same servlets via SSL revealed much greater performance difference.

HTTPS results

The results for https are very important because dynamicly generated content very often served via secure channels.

Concurrency Tomcat (rps) Apache mod_servlet (rps) Ratio
1 11.99 69.65 5.81
5 43.26 163.74 3.79
10 54.12 171.39 3.17
30 49.35 166.17 3.37
50 45.34 162.36 3.58

From 337% to 580% performance improvement!

Comparison on throughput or average response time has very similar results.