HNHacker News
TopNewBestAskShowJobs

james_roberts

77 karma · joined December 15, 2021

submissionscomments
james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
The pure fastwsgi results there are insane! Are you running a single process? That's double the RPS that I've been getting on my machine.
james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Awesome! That performs really well!
james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Thanks! Yeah, I stumbled upon it while looking for ways to parse http requests. Turns out its awesome. I believe NodeJS uses it under the hood as well. Could be mistaken...
james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Web Server Gateway Interface. Simply put, it is just a convention for forwarding requests to Python web applications.

More info here:

python.org/dev/peps/pep-0333/

james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Will do! Thanks for the feedback
james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Thanks so much for reporting a bug! You created the first issue for the project! I'll definitely have a look into this and push a fix
james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Hey, thanks! Great job on Bjoern by the way!

Yeah, I did get some inspiration from Bjoern for this project. Was also a learning project for me. I used this project to pick up C and learn a bit more about HTTP!

Hoping to add a few more features to the server side of things, still not finished, but I agree, there is only so much you can do to optimize things when you're making calls to Python anyway.

james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Thanks for the feedback! Yeah, some more "real world" benchmarks should be added.

And yes, if you have some application that you've tried to optimize somewhat and haven't managed to get the desired performance you would like, or if you simply haven't had the time to re-write components to be faster, ideally you could use FastWSGI as a drop in replacement for your current WSGI server and get the extra perf boost for "free". It's still in early development, but this is ultimately one of the main goals of the project.

james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Oops. This is a typo... should be WSGI apps. Not the uWSGI server
james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Thanks for the advice! I'll try this out
james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Thanks for the feedback! Will add it shortly
james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Thanks for the feedback! Yeah, the benchmarks just highlight higher numbers in very simple tests. They should definitely be taken with a grain of salt. I can try add some more practical highlights.
james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Yeah I don't have an optimal benchmarking setup currently. I have a 16-core CPU that I run everything off (server + benchmarks = not ideal).

I've been working on adding multiprocessing to FastWSGI (only works on Linux at the moment). The RPS almost scales linearly with the number of workers. At 4 processes it hits +260k RPS with decent CPU utilization.

I can definitely add more details to the benchmarks. Thanks for the feedback!

james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Thanks, nice catch! I will update that.
james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
In theory, any framework that follows the WSGI guidelines should be able to run on top of FastWSGI and take advantage of its speed.

There are many frameworks out there. I do intend to test out some more. For now I've only tested the popular Flask framework and a simple bare bones WSGI app.

Flask was never developed to be lightning fast. Even still, I am quite surprised at how slow it is now that I've seen what kind of numbers can be achieved. I haven't looked deep into it to see where the issues might be.

As for security, that is a work in progress... I definitely wouldn't use FastWSGI in production in the projects current state. It's still early days in terms of development.

james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
Thanks! I was quite surprised myself when I saw the numbers for the basic WSGI app. I'm still trying to figure out exactly why my server is so much faster than other servers out there...

My guess is that I avoid calling Python as much as possible. Most of the parsing and the `start_response` code is all written in C instead of Python.

Flask applications seem to have some bottleneck. I don't see the same performance numbers as I do with the basic WSGI app.

*A note: Those tests are just "Hello World" tests on a single worker. They should be taken with a grain of salt...

james_roberts··on Show HN: FastWSGI, an ultra-fast WSGI server for Python
I've been developing a Python extension, written in C, that provides users with an ultra-fast WSGI server that they can run their WSGI applications on (Flask, Django, uWSGI etc).

I have also recently managed to get it working on multiple platforms (Linux, MacOS and Windows).

If you want to significantly speed up your WSGI based applications, check it out!

It is still in early development at the moment. Any feedback would be greatly appreciated!

=== [Links] ===

Github: https://github.com/jamesroberts/fastwsgi

Pypi: https://pypi.org/project/fastwsgi/

Performance comparisons against other popular WSGI servers: https://github.com/jamesroberts/fastwsgi/blob/main/performan...