Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the fastest webserver solution with the lowest memory footprint? [closed]

Tags:

webserver

I need a webserver to serve up very simple POST/GET requests as JSON. I don't need MVC, Rails, Django. I need something that takes up very little memory, preferrably around 5K per reqeust. The webserver will talk to backend services like Scribe using Facebook Thrift. Each http request will also access a SQLLite database, one for each user and user's data do not overlap. It will serve up static html files as well as the json webservice.

I am considering the following:

  • Njinx with PHP,
  • Kepler from Lua,
  • rolling my own with libevent or libev perhaps calling out to Lua, or
  • MochiWeb.

Which of these options are best and what other options are out there? I can use PHP, python, or Lua for basic scripting and even could do basic C. I am leaning towards some sort of Erlang solution.


2 Answers

I've had a good experience with nginx (https://nginx.org/), that said, when choosing a webserver, you should look closely at your requirements and make an informed decision as these things can be very application specific.

You'll notice that in this question that a lot of people recommend g-wan, Webmachine, etc... these are all things you should look at and benchmark to see if they are faster for your use case.

This is the kind of question that encourages cheerleading, there is no "right answer".

like image 161
jonnii Avatar answered Sep 16 '25 07:09

jonnii


As one of the authors of Webmachine, I'm happy to help you out. One reason I'm following up is that even though there's no JSON-related code in Webmachine, you might find it useful to know that we use it on a daily basis for processing many different JSON requests and responses. It's simple, cleanly extensible, and performs reasonably well.

If you just wanted static delivery, then something like nginx or lighttpd would be an obvious way to go. For a mix of static and dynamic requests and built-in good Web behavior, you may find Webmachine a good fit.

Check out the trivial example code at http://code.google.com/p/webmachine/wiki/ExampleResources and the recent posts on the blog at http://blog.therestfulway.com/ for more information.

It has worked out well for us; if you have questions feel free to drop me a line.

like image 20
Justin Sheehy Avatar answered Sep 16 '25 07:09

Justin Sheehy