Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will python provide enough performance for a proxy?

I want to start writing a http proxy that will modify responses according to some rules/filters I will configure. However, before I start coding it, I want to make sure I'm making the right choice in going with Python. Later, this tool would have to be able to process a lot of requests, so, I would like to know I can count on it later on to be able to perform when "push comes to shove".

like image 881
Geo Avatar asked Mar 22 '26 08:03

Geo


2 Answers

As long as the bulk of the processing uses Python's built-in modules it should be fine as far as performance. The biggest strength of Python is its clear syntax and ease of testing/maintainability. If you find that one section of your code is slowing down the process, you can rewrite that section and use it as a C module, while keeping the bulk of your control code in Python.

However if you're looking to make the most optimized Python Code you may want to check out this SO post.

like image 54
Jon W Avatar answered Mar 23 '26 22:03

Jon W


Yes, I think you will find Python to be perfectly adequate for your needs. There's a huge number of web frameworks, WSGI libraries, etc. to choose from, or learn from when building your own.

There's an interesting post on the Python History blog about how Python was supporting high performance websites in 1996.

like image 36
zweiterlinde Avatar answered Mar 23 '26 21:03

zweiterlinde