Answer the question
In order to leave comments, you need to log in
Socket server php or python?
Good day Habr!
I stand at the point of choice on what to write the socket server, the choice of python and php. The load on the server is planned to be very large, as it will serve to process personal messages.
Needed to ensure interaction between the site and realplexor `th (hence the restriction on languages, since it has api only for them).
I know PHP well, I wrote socket servers on it, but I didn’t do much load testing. I know Python a little bit, but I don't think it's much more difficult than in php. Here I think what to choose? Will the php server be able to process thousands of requests per second and, with prolonged use, not eat up resources from the server, since php was originally designed for a short operating time, which is why memory trouble is possible.
Perhaps someone has experience in a similar situation. I would appreciate any help.
Answer the question
In order to leave comments, you need to log in
Choose what you know best. If you are not writing to improve your skills. Then, at your leisure, you can make a variant in python (for self-education) and compare. Maybe the article will be born on Habr! And for production it is better to go where most of the rake has already been probed.
I didn’t have any problems with sockets, semaphores, or shared memory from php, memory didn’t leak, it was processed quickly ... but then it all depends on what you will do and use.
And then - the choice of language, a purely holivar conversation. Python has a larger selection of ready-made modules before php (and their organization is much more accurate), there are no problems with integers (32bit vs 64bit) and someone likes the language itself more, but memory consumption in python is much higher than in php, and synthetic tests on working with primitives in php show higher speed.
ps And if you have few external calls and a lot of internal calculations, can you immediately look at c ++? :)
> since php was originally designed for a short time of work, which is why trouble with memory is possible.
Both languages are scripting.
The resource consumption of PHP will be lower than that of Python.
The speed of work is approximately the same.
In Python, it will most likely be easier to implement.
In general, in a good way, such things are not done either in PHP or in Python. If I were you, I would look towards Java - it will be easier on it than on C, and the speed will be about the same, and maybe even higher (due to the “genius” of the JVM).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question