Answer the question
In order to leave comments, you need to log in
Should the script be optimized?
Hello!
I am writing a chat in php using Doctrine ORM. So now the page generation time is on average 0.1 seconds. This consumes 3.25MB of memory.
Do you think this is a normal chat response time?
How will the load increase with a large number of connections?
Or does the ajax part need to be rewritten in pure php?
PS PHP is only used to send messages. The upload works via node.js.
Thank you.
Answer the question
In order to leave comments, you need to log in
Do you like this kind of time? If yes, then it is not necessary, if not, then it is necessary to optimize. There are no ideal numbers, there are acceptable numbers, and if these numbers go beyond the allowable limit, then they optimize, otherwise not.
There is no single answer. It all depends on many factors: how many people are planned in the chat, what kind of hardware, write for self-satisfaction or to order, whether you want to learn a new technology for yourself or already own a doctrine.
There are also tools for load testing. If the test result does not satisfy, then rewrite or optimize.
ps there will probably be two types of comments below: “What are you, sending messages to the chat, what the hell doctrine, overhead, a cannon on sparrows” and “only correct, only doctrine, development speed is more important, and if you have to switch to another database ?, patterns, oops, rabi-rabi-rabi" :)
In our chat, we managed to send a message in 0.04 seconds.
php + mysql.
In your case, it is better to think about not so much the Doctrine as such, but about the architecture of the application. How exactly do you receive messages by the end user?
If you plan to send more than 10 messages per second to the chat, or the server is doing something else, then it’s worth it. In general, of course, it’s hard for a chat, you can improve both time and memory by an order of magnitude. By the way, do you have APC or another accelerator installed?
Messages are not received via php. Just sent. The architecture, as I think, is more correct: front controller, router, controller, doctrine, answer (in short, licked from the symphony :))
How will the load increase with a large number of connections?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question