D
D
Dr. Robert Ford2019-07-22 21:58:21
Python
Dr. Robert Ford, 2019-07-22 21:58:21

When can a language become a bottleneck?

Hello. There is a small python project divided into microservices. The maximum planned load is about 70-130 rps. Ceiling - 200 rps, of which about 50 can arrive at the same time. The project interacts with the Docker API and database (postgresql). At what load is it worth rewriting this application (or its individual parts) in Go? And is it even worth it in the future?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Gornostaev, 2019-07-23
@sergey-gornostaev

First, the language affects the performance of programmers, not programs. The bottleneck can be the platform, in your case the CPython virtual machine. But when developing network software in general and web applications in particular, the main brake is input / output. The cost of it is orders of magnitude greater than the cost of interpretation, so that the latter practically does not affect performance. At the same time, CPython handles I/O well with Asyncio and is capable of solving the c10k problem.
Secondly, it depends on what exactly your microservices do with each request. For example, for an ordinary online store on a very synchronous Django, 300 rps is quite a normal load, which you should not worry about if there are no mentally retarded and crooked hands in the development team.

D
dollar, 2019-07-22
@dollar

For starters, you can type python vs go slant
on Google. Next, why Go and not Erlang, for example? Usually the choice of a particular tool depends on the specific task. So in the question it would not be superfluous to describe (at least inside the spoiler) what kind of project, what the emphasis is, etc., if it's not a secret, of course.

R
rPman, 2019-07-22
@rPman

The language almost never creates speed issues, but it is the tools and libraries that developers use to make their lives easier.
And in php (phpreact) you can write an application that processes 10k requests per second on one processor, or you can write an asynchronous application in nodejs (javascript), which will spend 99% of the time using a standard gzip unpacker to unpack gzip and then the remaining half to copy the array from data (due to which the speed is an order of magnitude lower than php, a real example of simple processing of a LARGE number of packed text dumps)
If data processing creates problems for you, write critical things in c ++ and connect with a module.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question