A client of ours is asking us to implement a module in C in Apache webserver for performance reasons. This module should handle RESTful uri's, access a database and return results in json format. Many people here have recommended python mod_wsgi instead - but for simplicity of programming reasons. Can anyone tell me if there is a significant difference in performance between the mod_wsgi python solution vs. the Apache + C.module. Any anecdotes? Pointers to some study posted online?
This module should handle RESTful uri's, access a database and return results in json format.
That sounds like the bulk of the work is I/O bound so you will not get much of a performance boost by using C.
Here is the strategy I would recommend.
- Implement in Python
- After getting it done, profile the code to see if there are any CPU bottlenecks.
- Implement just the bottleneck portions in C.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki