I have a python script. Lets say http://domain.com/hello.py
, which only prints "Hello, World!".
Is it possible to precompile this Python file?
I get around 300 requests per second and the overhead of compiling is way to high. In Java the server can handle this easily but for calculations Python works much easier.
the problem is not that you need to "precompile" python, the problem is that you are trying to execute python scripts using normal cgi script stuff...
the real answer is to use a better web backend than simple cgi to run your python
I would suggest the following in order of appearance
1. nginx + gnunicorn
2. apache2 + mod-wsgi
3. something else
4. anything else
...
n-1. fcgi
n. cgi
I know this isnt really an answer and is entirely opinion based
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With