r/openstack • u/vb6ko • Sep 14 '19
Python? any performance issues?
Hello,
I'm just starting to learn Cloud Computing.
I thought the performance is of significance, and Python is not suitable.
But I just figured out that OpenStack is made by Python.
I totally agree that "Language is only the tool".
but you know, in practice, getting used to language gives us big synergies.
So.... I wanna know why they use python. And could you recommend me some promising language for cloud computing.
p.s.
also I think Python is not suitable for bigger projects because of ... like.. typeless and so on.
AFAIK, that's why typescript is getting popular.
2
Sep 14 '19
Python is used to handle the business logic of tying various optimized components together.
If the hypervisor tech is KVM, then the Python code is responsible for surveying running hypervisors for their capabilities, running state, CPU hardware features, etc. It takes this information and stores it in various locations for analysis when moving a VM (finding a suitable hypervisor) or other things.
If the network stack uses Openvswitch, then python is used to ask various OVS switches how they're feeling, what's connected to them, how to bind to the host iptables firewall, and so on.
KVM and OVS are very well optimised using well written C code.
1
u/vb6ko Sep 14 '19
Interesting. That's very reasonable to explain of Python's existance I guess.
Python has a lot of system(kernel) inspection library and most of them are cross-platform.
Furthermore they are also quite mature and stable because many system engineers used/use it as high level of bash script I guess haha.
Oh cool. Even Golang cannot replace it since Go is compile lang so Python's super independent interpreter wins in this part. Thank you so much.
1
u/remek Sep 14 '19
Openstack is an orchestration software, it is essentially a management plane and thus performance is of somewhat lesser concern as long as its good enough. On the other side, Openstack is such a crappy, bloated and overengineered piece of software that performance is/was an issue there, but the problems it had were not really a python problems - just rewriting it to golang or whatever would still render sloppy software if it was not also completely redesigned.
1
1
Sep 15 '19
Python has a Gil that makes it single threaded but nothing docker or containerization can’t solve. That’s how node solves it.
The language itself is fast to learn and very robust. You could write a flask app and serve as many requests as a go app as long as you run an interpreter per core and use an edge network to balance the traffic.
Languages have really nothing to do with “cloud”.. I. Could argue any language with a vm is too thick or compiled languages are too strict and not as portable.
Use whatever tools get the job done. Over optimization and believing in “correct languages” is a huge waste of effort too.
Sometimes there is absolutely a wrong tool for the job, but that comes with experience not generalized reddit posts :)
3
u/dremspider Sep 14 '19
Python is great for web apps. Python has performance issues like the inability to be properly threaded across cores, but for web apps that generally isnt an issue. Like anything, choose the right tool for the job and understand what you are trying to accomplish.