A
A
Anton Medvedev2012-04-10 00:58:40
symfony
Anton Medvedev, 2012-04-10 00:58:40

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

6 answer(s)
A
Anatoly, 2012-04-10
@taliban

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.

Q
quantum, 2012-04-10
@quantum

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" :)

D
Dunadan, 2012-04-10
@Dunadan

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?

S
Stdit, 2012-04-10
@Stdit

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?

A
Anton Medvedev, 2012-04-10
@Elfet

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 :))

V
Vladislav Klimanov, 2012-04-10
@ahmpro

How will the load increase with a large number of connections?

conduct a stress test, if the result does not satisfy, then it is necessary to optimize

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question