Ask HN: System Design – Fastest webserver to serve data in memory
1 comments
Huh, why to reinvent a wheel ?
G-WAN http://gwan.ch/imgs/gwan_hello.py.png http://gwan.ch/developers#tab8
G-WAN http://gwan.ch/imgs/gwan_hello.py.png http://gwan.ch/developers#tab8
Imagine we're making a webservice called "Primes". It has 1 endpoint, something like this:
We want the fastest webservice to serve this endpoint that handles as much QPS as possible.
### Constraints
- We have to load all the primes __into memory__, there's no database at all. - We cannot use memcache, redis, etc. - We have to use Python.
### Current Solution
The code above just serves the primes via the default webserver that comes bundled with Flask. Some ideas to improve upon this:
- Use a better webserver (eg. Tornado) - Proxy several instances of this behind an Nginx server
Can we make this even faster? We really don't need complicated routing or security... Is it possible to do better by writing a custom webserver?